mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-17 23:31:56 +00:00
rename env var
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
@@ -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"
|
||||
|
Reference in New Issue
Block a user