You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ReleaseNotes-v4.md
+78-39Lines changed: 78 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -244,6 +244,16 @@ or you can replace it with the following, which works with both Geodesic v3 and
244
244
either `$HOME`, `$WORKSPACE_MOUNT`, or `$WORKSPACE_FOLDER` as appropriate. As a temporary workaround,
245
245
you can run `ln -s "$LOCAL_HOME" /localhost` in your customizations.
246
246
247
+
- By default, Geodesic automatically sets `TF_PLUGIN_CACHE_DIR` to `"${HOME}/.terraform.d/plugin-cache"`
248
+
to provide a location for the [Terraform Provider Plugin Cache](https://developer.hashicorp.com/terraform/cli/config/config-file#provider-plugin-cache).
249
+
This is a location on the host filesystem, allowing the cache to be shared between the host and the container,
250
+
and to persist between container runs. This saves significant time and bandwidth, and we highly recommend
251
+
using the plugin cache, which is why we have been setting it for years.
252
+
However, the way this was implemented, it was difficult for users to opt-out of the plugin cache altogether.
253
+
To accommodate those users while maintaining backward compatibility,
254
+
Geodesic now checks, and if `TF_PLUGIN_CACHE_DIR` is set empty, or to "false" or "disabled",
255
+
Geodesic unsets the variable, allowing users to avoid having a cache directory.
256
+
247
257
- Previously, you could have Geodesic perform file ownership mapping between host and container
248
258
by setting `GEODESIC_HOST_BINDFS_ENABLED=true`; this variable is now deprecated.
249
259
Use `MAP_FILE_OWNERSHIP=true` instead. This feature is disabled by default and can
@@ -528,16 +538,18 @@ the directories being searched.
528
538
529
539
#### New Customization Command-Line Options
530
540
531
-
3 command line options regarding customization have been added:
541
+
Some line options regarding customization have been added:
532
542
533
543
1.`--no-custom` (or `--no-customization`, or `--geodesic-customization-disabled`) will disable all user-specific
534
544
customizations. This is equivalent to setting `GEODESIC_CUSTOMIZATION_DISABLED=true`. This is useful for
535
545
"works in my environment" testing, where you want to disable all customizations to see if the problem is in the
536
546
customizations or in the base image. Note that this does not disable changes made by `launch-options.sh`.
537
547
2.`--trace` will enable tracing the Geodesic script as it performs customizations. Equivalent to `--trace=custom`.
538
548
3.`--trace="custom terminal hist` will enable tracing of the customizations, terminal configuration (mainly with respect
539
-
to light and dark mode support), and determining which Bash history file to use, respectively. You can use these options
540
-
in any combination, for example, `--trace="hist"`.
549
+
to light/dark mode support), and the determination of which Bash history file to use, respectively.
550
+
You can use these options in any combination.
551
+
4.`--dark` and `--light` will set the terminal theme to dark or light, respectively, disabling attempts to automatically detect it.
552
+
This is mainly useful if the automatic detection is not working.
541
553
542
554
## Dark mode support
543
555
@@ -546,49 +558,69 @@ Support for terminals being in dark mode was introduced in Geodesic v2.10.0,
546
558
but was not previously well documented. There have also been some enhancements
547
559
since then. The following describes the state of support as of v4.0.0.
548
560
549
-
### Switching between light and dark mode
561
+
### Switching between light and dark themes
550
562
551
-
Geodesic provides basic support for terminal dark and light modes.
563
+
Geodesic provides basic support for terminal dark and light themes.
552
564
Primarily, this is used to ensure Geodesic's colored output is readable in both modes,
553
565
for example, black in light mode and white in dark mode.
554
566
555
-
There is no standard way to be notified of a terminal's color mode change. Geodesic
556
-
listens for SIGWINCH and updates the color mode when receiving it. Some terminals
557
-
send this when the color mode changes, but not all do. (For example, macOS Terminal does not.)
558
-
559
-
There can be issues with the signal handler. For example, if your computer is
560
-
waking from sleep, the signal handler may be called multiple times, but
561
-
the terminal may take several seconds to respond to the query about its color mode.
562
-
This can result in long delays while Geodesic waits for the terminal to respond,
563
-
and if it times out, the response may eventually be written to the terminal
564
-
command line, looking something like `10;rgb:0000/0000/000011;rgb:ffff/ffff/ffff`.
565
-
This area of Geodesic is still new and under development, so there are likely to be subtle bugs.
566
-
If you want to disable this feature, you can set `GEODESIC_TERM_COLOR_AUTO=false`.
567
-
If Geodesic detects a problem with the terminal color mode, it will disable this feature
568
-
by setting `GEODESIC_TERM_COLOR_AUTO=disabled`.
569
-
570
-
You can report issues with this, or any Geodesic feature, via the `#geodesic`
571
-
channel in the [Cloud Posse Slack workspace](https://cpco.io/slack?utm_source=github&utm_medium=release_notes&utm_campaign=cloudposse/geodesic&utm_content=slack).
572
-
573
-
Geodesic provides a shell function called `update-terminal-color-mode` that can be used to manually
574
-
update the terminal mode. This function is called automatically when Geodesic starts, but
575
-
if you change the terminal color mode while Geodesic is running, you can call this function
576
-
to update the color mode. If your terminal supports calling a function when the color mode changes,
577
-
you can call this function from there. Alternately, you can trigger the function call
578
-
by resizing the terminal window, which triggers the SIGWINCH signal handler.
579
-
580
-
The `update-terminal-color-mode` function takes one argument, which is the terminal color mode,
581
-
either `light` or `dark`. If you do not provide an argument, it will attempt to determine
582
-
the terminal color mode itself.
583
-
584
-
You can query Geodesic for its cached color mode setting by running `get-terminal-color-mode`.
585
-
586
-
Changing Geodesic's color mode does not change anything already on the screen. It only affects
567
+
While there are standard ways to detect the terminal color settings, they are not
568
+
universally supported, and various terminals have their quirks. As a result, color
569
+
detection is not always reliable, and you may see errors or 'garbage' output
570
+
during startup, especially if you are not using a widely popular terminal.
571
+
572
+
#### Initial theme detection
573
+
574
+
It is critical to detect the terminal theme when Geodesic starts. This is done
575
+
by default, and can only be disabled by specifying the desired theme,
576
+
"light" or "dark", via `--light` or `--dark` command line options,
577
+
or by setting the GEODESIC_TERM_THEME environment variable to "light" or "dark". This
578
+
must be set in the environment before Geodesic starts, e.g. in the `launch-options.sh` file.
579
+
580
+
#### Detecting changes in theme while running (experimental)
581
+
582
+
You may have your terminal set to automatically switch between light and dark themes
583
+
based on the time of day, or you may manually switch between themes. Unfortunately,
584
+
there is no standard way for a shell to be notified when a terminal's theme changes. Furthermore,
585
+
due to the inherent challenges of detecting terminal themes, automatic
586
+
detection of changes in the terminal theme has too often injected disruptive characters and messages
587
+
into the user's workflow. As a result, Geodesic by default does not attempt to detect changes
588
+
in the terminal theme while running.
589
+
590
+
If you want to manually notify Geodesic of the change, you can call
591
+
592
+
```bash
593
+
set-terminal-theme [light|dark]
594
+
```
595
+
596
+
If you provide an argument, it will set the terminal theme to that argument. If you do not provide an argument,
597
+
it will attempt to determine the terminal theme itself.
598
+
599
+
You can query Geodesic for its cached theme setting by running
600
+
601
+
```bash
602
+
get-terminal-theme
603
+
```
604
+
605
+
Some terminals notify the shell of color changes by sending a `SIGWINCH` signal.
606
+
Geodesic also sends this signal to its shell when it detects a change in the size of the window.
607
+
You can set the environment variable `GEODESIC_TERM_THEME_AUTO=enabled` to enable
608
+
Geodesic to listen for this signal and update the theme when it is received.
609
+
Beware that while updates are called from the prompt command hook, we have seen many
610
+
instances where the terminal does not respond to the query about its color settings
611
+
promptly, resulting in failed detection, and the response being written to the
612
+
terminal command line. It might look something like `^[]11;rgb:fdfd/f6f5/e3e3^G`.
613
+
614
+
Be aware that this is not an area where good solutions exist, which is why
615
+
this feature is disabled by default. Unlike with the initial theme detection,
616
+
this is not an area where we are investing effort to improve.
617
+
618
+
Changing Geodesic's theme does not change anything already on the screen. It only affects
587
619
future output.
588
620
589
621
#### Named text color helpers
590
622
591
-
To help you take advantage of the color mode, Geodesic provides a set of named text color helpers.
623
+
To help you take advantage of the terminal color theme support, Geodesic provides a set of named text color helpers.
592
624
They are defined as functions that output all their arguments in the named mode.
593
625
The named colors are
594
626
@@ -600,6 +632,12 @@ The named colors are
600
632
Note: yellow is problematic. To begin with, "yellow" is not necessarily yellow,
601
633
it varies with the terminal theme, and would be better named "caution" or "info".
602
634
In addition, it is too light to be used in light mode, so we substitute magenta instead.
635
+
We intentionally avoid `blue` and `magenta` because they are problematic in dark mode,
636
+
and because we use magenta as a substitute for yellow in light mode.
637
+
We also avoid `black` and `white` because they are completely unsuitable for use in
638
+
an environment where the terminal theme can switch between light and dark. Instead,
639
+
we take care to use the terminal's stated foreground and background colors, which
640
+
the terminal itself will change (including text already on the screen) when changing its theme.
603
641
604
642
Each of these colors has 4 variations. Using "red" as an example, they would be:
605
643
@@ -682,4 +720,5 @@ V4 changes:
682
720
-`WORKSPACE_FOLDER` is the base directory of the project inside the container. Analogous to the target of Dev Container's
683
721
`workspaceFolder`. Typically, this is the same as `WORKSPACE_MOUNT`, but may be a subdirectory if, for example, the Git repository is
684
722
a "monorepo" containing multiple projects. It must be an absolute path either equal to or a subdirectory of `WORKSPACE_FOLDER_HOST_DIR`.
685
-
-`GEODESIC_TERM_COLOR_AUTO` is normally unset. Set it to "false" to disable attempts at automatic terminal light/dark mode detection.
723
+
-`GEODESIC_TERM_THEME` is normally unset. Set it to "light" or "dark" _before launching Geodesic_ to disable the initial attempt at automatic terminal light/dark theme detection, and use the set value instead.
724
+
-`GEODESIC_TERM_THEME_AUTO` is normally unset. Set it to "enabled" to enable automatic attempts to detect changes in terminal light/dark theme. This feature should be considered experimental and may not work as expected.
Copy file name to clipboardExpand all lines: docs/environment.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,14 +34,15 @@ Geodesic version 4 additions and changes:
34
34
-`WORKSPACE_MOUNT` is the container path where `WORKSPACE_MOUNT_HOST_DIR` will be mounted. Analogous to the target of Dev Container's
35
35
`workspaceMount`. Defaults to `/workspace`, which is the default for a Dev Container, but you may want to set it to
36
36
something like your project name or git repository name for visibility in the container.
37
-
-`GEODESIC_TERM_COLOR_AUTO` is normally unset. Set it to "false" to disable attempts at automatic terminal light/dark mode detection.
37
+
-`GEODESIC_TERM_THEME` is normally unset. Geodesic will attempt to detect the terminal light/dark mode and default to light. Set this to "light" or "dark" to disable the automatic detection at startup and force the theme.
38
+
-`GEODESIC_TERM_THEME_AUTO` is normally unset. Set it to "true" to enable attempts to automatically detect _changes_ in terminal light/dark theme. Use `set-terminal-theme` to manually switch between light and dark themes.
38
39
-`GEODESIC_MOTD_ENABLED` can be set to "false" to disable printing the message of the day at shell startup.
39
40
-`MAP_FILE_OWNERSHIP` replaces `GEODESIC_HOST_BINDFS_ENABLED`. If set to true, Geodesic will use `bindfs` to map file ownership
40
41
between the host and container. This not normally needed, as it should be handled automatically by Docker.
41
42
42
43
### Geodesic Version 3 Environment Variables
43
44
44
-
Below is a list of environment variable that may be visible in the shell and were present in Geodesic v3.
45
+
Below is a list of environment variables that may be visible in the shell and were present in Geodesic v3.
45
46
Many of these variables are only recognized if you explicitly set or export them prior to running the script.
46
47
Others are set and read internally to control optional behaviors.
47
48
@@ -107,13 +108,14 @@ and not Geodesic itself.
107
108
|`PROMPT_STYLE`| Style of the prompt: plain, fancy, or unicode. |
108
109
|`PS1`|`bash`: Primary prompt string (the final assembled Bash prompt). |
109
110
|`SCREEN_SIZE`| Internal: Tracks the current terminal screen size as LINES x COLUMNS. |
110
-
|`SHLVL`|`bash`1: Shell nesting level (1 for the main shell, higher for subshells). |
111
+
|`SHLVL`|`bash`: Shell nesting level (1 for the main shell, higher for subshells).|
111
112
|`SSH_AGENT_CONFIG`*| Obsolete: Path to the file storing SSH agent environment variables. |
112
113
|`SSH_AUTH_SOCK`|`ssh`: Socket path for the running SSH agent. |
113
114
|`SSH_KEY`*| Path to private SSH key file to automatically add to the SSH agent. |
114
115
|`STAGE`| Identifies the environment stage (e.g., dev, prod). |
115
116
|`TELEPORT_LOGIN`|`teleport`: Username for Teleport-based SSH sessions. |
116
117
|`TELEPORT_LOGIN_BIND_ADDR`|`teleport`: Local bind address for Teleport SAML-based login callbacks. |
117
118
|`TELEPORT_PROXY`|`teleport`: Teleport proxy host (defaults to tele.<docker-image-subdomain>). |
119
+
|`TF_PLUGIN_CACHE_DIR`|`terraform`: Location for the [Terraform Provider Plugin Cache][1]. |
0 commit comments