From 2f2f1df6371832b885d281cb9a3e2f5718c699a9 Mon Sep 17 00:00:00 2001 From: HuaDeity Date: Wed, 16 Jul 2025 23:34:36 +0800 Subject: [PATCH 1/3] shell-integration.fish: don't use $ssh_terminfo --- .../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 834f0ef10..1c8cc714b 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 @@ -139,7 +139,7 @@ function __ghostty_setup --on-event fish_prompt -d "Setup ghostty integration" set ssh_cpath_dir (mktemp -d "/tmp/ghostty-ssh-$ssh_user.XXXXXX" 2>/dev/null; or echo "/tmp/ghostty-ssh-$ssh_user."(random)) set ssh_cpath "$ssh_cpath_dir/socket" - if echo "$ssh_terminfo" | command ssh $ssh_opts -o ControlMaster=yes -o ControlPath="$ssh_cpath" -o ControlPersist=60s $argv ' + if infocmp -0 -x xterm-ghostty 2>/dev/null | command ssh $ssh_opts -o ControlMaster=yes -o ControlPath="$ssh_cpath" -o ControlPersist=60s $argv ' infocmp xterm-ghostty >/dev/null 2>&1 && exit 0 command -v tic >/dev/null 2>&1 || exit 1 mkdir -p ~/.terminfo 2>/dev/null && tic -x - 2>/dev/null && exit 0 From 6769f3c307d3e7ae0a018c7006d05490cf7fc0ab Mon Sep 17 00:00:00 2001 From: HuaDeity Date: Sat, 19 Jul 2025 16:52:03 +0800 Subject: [PATCH 2/3] Fix shell variable expansion in fish SSH setup --- .../fish/vendor_conf.d/ghostty-shell-integration.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 1c8cc714b..0e63bc538 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 @@ -131,7 +131,7 @@ function __ghostty_setup --on-event fish_prompt -d "Setup ghostty integration" set -l ssh_cpath_dir set -l ssh_cpath - set ssh_terminfo (infocmp -0 -x xterm-ghostty 2>/dev/null) + set ssh_terminfo "$(infocmp -0 -x xterm-ghostty 2>/dev/null)" if test -n "$ssh_terminfo" echo "Setting up xterm-ghostty terminfo on $ssh_hostname..." >&2 @@ -139,7 +139,7 @@ function __ghostty_setup --on-event fish_prompt -d "Setup ghostty integration" set ssh_cpath_dir (mktemp -d "/tmp/ghostty-ssh-$ssh_user.XXXXXX" 2>/dev/null; or echo "/tmp/ghostty-ssh-$ssh_user."(random)) set ssh_cpath "$ssh_cpath_dir/socket" - if infocmp -0 -x xterm-ghostty 2>/dev/null | command ssh $ssh_opts -o ControlMaster=yes -o ControlPath="$ssh_cpath" -o ControlPersist=60s $argv ' + if echo "$ssh_terminfo" 2>/dev/null | command ssh $ssh_opts -o ControlMaster=yes -o ControlPath="$ssh_cpath" -o ControlPersist=60s $argv ' infocmp xterm-ghostty >/dev/null 2>&1 && exit 0 command -v tic >/dev/null 2>&1 || exit 1 mkdir -p ~/.terminfo 2>/dev/null && tic -x - 2>/dev/null && exit 0 From d8c64c05112a8d15fa591e11cb29957f974b44a4 Mon Sep 17 00:00:00 2001 From: HuaDeity Date: Sat, 19 Jul 2025 16:52:55 +0800 Subject: [PATCH 3/3] Remove unnecessary stderr redirection in fish integration --- .../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 0e63bc538..5e650da54 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 @@ -139,7 +139,7 @@ function __ghostty_setup --on-event fish_prompt -d "Setup ghostty integration" set ssh_cpath_dir (mktemp -d "/tmp/ghostty-ssh-$ssh_user.XXXXXX" 2>/dev/null; or echo "/tmp/ghostty-ssh-$ssh_user."(random)) set ssh_cpath "$ssh_cpath_dir/socket" - if echo "$ssh_terminfo" 2>/dev/null | command ssh $ssh_opts -o ControlMaster=yes -o ControlPath="$ssh_cpath" -o ControlPersist=60s $argv ' + if echo "$ssh_terminfo" | command ssh $ssh_opts -o ControlMaster=yes -o ControlPath="$ssh_cpath" -o ControlPersist=60s $argv ' infocmp xterm-ghostty >/dev/null 2>&1 && exit 0 command -v tic >/dev/null 2>&1 || exit 1 mkdir -p ~/.terminfo 2>/dev/null && tic -x - 2>/dev/null && exit 0