From c6788dd17839ef916c6096fe913c341a765ffb8d Mon Sep 17 00:00:00 2001 From: Sola Date: Sun, 19 Oct 2025 20:42:22 +0800 Subject: [PATCH] fix: fish shell integration should not modify universal path variable `fish_add_path` by default updates the `fish_user_paths` universal variable which makes the modification persist across shell sessions. The integration also tries to update the `fish_user_paths` when the desired path already appears in the `PATH` environment variable but not in `fish_user_paths`. Because `fish_user_paths` will always be inserted before the inherited `PATH` env. This makes the added path unintentionally has a higher priority. This patch makes the above issues by adding `--global` and `--path` options to `fish_user_paths` which limits the modification scope and ensures that the path won't be added if it already exists in `PATH`. --- .../fish/vendor_conf.d/ghostty-shell-integration.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 f745bbb13..47af9be98 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 @@ -67,7 +67,7 @@ function __ghostty_setup --on-event fish_prompt -d "Setup ghostty integration" # Add Ghostty binary to PATH if the path feature is enabled if contains path $features; and test -n "$GHOSTTY_BIN_DIR" - fish_add_path --append "$GHOSTTY_BIN_DIR" + fish_add_path --global --path --append "$GHOSTTY_BIN_DIR" end # When using sudo shell integration feature, ensure $TERMINFO is set