From 66a9b1b99f833bccf9ea9de44203fa24ffdbbeab Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 27 May 2024 16:18:51 -0700 Subject: [PATCH] rename env var --- src/shell-integration/elvish/lib/ghostty-integration.elv | 6 +++--- .../fish/vendor_conf.d/ghostty-shell-integration.fish | 6 +++--- src/termio/shell_integration.zig | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/shell-integration/elvish/lib/ghostty-integration.elv b/src/shell-integration/elvish/lib/ghostty-integration.elv index 9e7f0bd5f..bd86b5e2a 100644 --- a/src/shell-integration/elvish/lib/ghostty-integration.elv +++ b/src/shell-integration/elvish/lib/ghostty-integration.elv @@ -1,6 +1,6 @@ { fn restore-xdg-dirs { - var integration-dir = $E:GHOSTTY_INTEGRATION_DIR + var integration-dir = $E:GHOSTTY_SHELL_INTEGRATION_XDG_DIR var xdg-dirs = [(str:split ':' $E:XDG_DATA_DIRS)] var len = (count $xdg-dirs) @@ -27,9 +27,9 @@ } else { set-env XDG_DATA_DIRS (str:join ':' $xdg-dirs) } - unset-env GHOSTTY_INTEGRATION_DIR + unset-env GHOSTTY_SHELL_INTEGRATION_XDG_DIR } - if (and (has-env GHOSTTY_INTEGRATION_DIR) (has-env XDG_DATA_DIRS)) { + if (and (has-env GHOSTTY_SHELL_INTEGRATION_XDG_DIR) (has-env XDG_DATA_DIRS)) { restore-xdg-dirs } } diff --git a/src/shell-integration/fish/vendor_conf.d/ghostty-shell-integration.fish b/src/shell-integration/fish/vendor_conf.d/ghostty-shell-integration.fish index 2716be110..6ccec3933 100644 --- a/src/shell-integration/fish/vendor_conf.d/ghostty-shell-integration.fish +++ b/src/shell-integration/fish/vendor_conf.d/ghostty-shell-integration.fish @@ -6,7 +6,7 @@ function ghostty_restore_xdg_data_dir -d "restore the original XDG_DATA_DIR value" # If we don't have our own data dir then we don't need to do anything. - if not set -q GHOSTTY_INTEGRATION_DIR + if not set -q GHOSTTY_SHELL_INTEGRATION_XDG_DIR return end @@ -19,7 +19,7 @@ function ghostty_restore_xdg_data_dir -d "restore the original XDG_DATA_DIR valu set --function --path xdg_data_dirs "$XDG_DATA_DIRS" # If our data dir is in the list then remove it. - if set --function index (contains --index "$GHOSTTY_INTEGRATION_DIR" $xdg_data_dirs) + if set --function index (contains --index "$GHOSTTY_SHELL_INTEGRATION_XDG_DIR" $xdg_data_dirs) set --erase --function xdg_data_dirs[$index] end @@ -30,7 +30,7 @@ function ghostty_restore_xdg_data_dir -d "restore the original XDG_DATA_DIR valu set --erase --global XDG_DATA_DIRS end - set --erase GHOSTTY_INTEGRATION_DIR + set --erase GHOSTTY_SHELL_INTEGRATION_XDG_DIR end function ghostty_exit -d "exit the shell integration setup" diff --git a/src/termio/shell_integration.zig b/src/termio/shell_integration.zig index aed7ae49f..392fb5b48 100644 --- a/src/termio/shell_integration.zig +++ b/src/termio/shell_integration.zig @@ -419,8 +419,8 @@ test "bash: preserve ENV" { /// their modules from paths in `XDG_DATA_DIRS` env variable. /// /// Path of shell-integration dir is prepended to `XDG_DATA_DIRS`. -/// It is also saved in `GHOSTTY_INTEGRATION_DIR` variable so that -/// the shell can refer to it and safely remove this directory +/// It is also saved in `GHOSTTY_SHELL_INTEGRATION_XDG_DIR` variable +/// so that the shell can refer to it and safely remove this directory /// from `XDG_DATA_DIRS` when integration is complete. fn setupXdgDataDirs( alloc_arena: Allocator, @@ -439,7 +439,7 @@ fn setupXdgDataDirs( // Set an env var so we can remove this from XDG_DATA_DIRS later. // This happens in the shell integration config itself. We do this // so that our modifications don't interfere with other commands. - try env.put("GHOSTTY_INTEGRATION_DIR", integ_dir); + try env.put("GHOSTTY_SHELL_INTEGRATION_XDG_DIR", integ_dir); if (env.get("XDG_DATA_DIRS")) |old| { // We have an old value, We need to prepend our value to it.