From 4206ab121053870c424b69107e4f46b2866c1a3b Mon Sep 17 00:00:00 2001 From: Jason Rayne Date: Mon, 16 Jun 2025 16:04:37 -0700 Subject: [PATCH] fix: use idiomatic Fish shell syntax in SSH integration - Use `set --append` for array operations - Use `type -q` for command existence checks --- .../fish/vendor_conf.d/ghostty-shell-integration.fish | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 e0644b8c6..4ceb5324a 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 @@ -118,12 +118,12 @@ function __ghostty_setup --on-event fish_prompt -d "Setup ghostty integration" # Fix TERM compatibility if test "$TERM" = xterm-ghostty - set env_vars $env_vars TERM=xterm-256color + set --append env_vars TERM=xterm-256color end # Propagate Ghostty shell integration environment variables if test -n "$GHOSTTY_SHELL_FEATURES" - set env_vars $env_vars GHOSTTY_SHELL_FEATURES="$GHOSTTY_SHELL_FEATURES" + set --append env_vars GHOSTTY_SHELL_FEATURES="$GHOSTTY_SHELL_FEATURES" end # Execute with environment variables if any were set @@ -137,7 +137,7 @@ function __ghostty_setup --on-event fish_prompt -d "Setup ghostty integration" # Level: full - All features function _ghostty_ssh_full # Full integration: Two-step terminfo installation - if command -v infocmp >/dev/null 2>&1 + if type -q infocmp echo "Installing Ghostty terminfo on remote host..." >&2 # Step 1: Install terminfo using the same approach that works manually @@ -153,7 +153,7 @@ function __ghostty_setup --on-event fish_prompt -d "Setup ghostty integration" # Propagate Ghostty shell integration environment variables if test -n "$GHOSTTY_SHELL_FEATURES" - set env_vars $env_vars GHOSTTY_SHELL_FEATURES="$GHOSTTY_SHELL_FEATURES" + set --append env_vars GHOSTTY_SHELL_FEATURES="$GHOSTTY_SHELL_FEATURES" end # Normal SSH connection with Ghostty terminfo available