From a1cb52dcd35794c61dc7fb583f25284b7b6347d5 Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Wed, 9 Jul 2025 14:29:46 -0400 Subject: [PATCH] fish: prefer 'command -q' to check for commands This is a fish built-in 'command' option that's the more idiomatic way to check for the availability of a command. https://fishshell.com/docs/current/cmds/command.html --- .../fish/vendor_conf.d/ghostty-shell-integration.fish | 6 +++--- 1 file changed, 3 insertions(+), 3 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 0bba43b31..546f05fc8 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 @@ -124,9 +124,9 @@ function __ghostty_setup --on-event fish_prompt -d "Setup ghostty integration" if test -n "$ssh_hostname" # Check if terminfo is already cached - if command -v ghostty >/dev/null 2>&1; and ghostty +ssh-cache --host="$ssh_target" >/dev/null 2>&1 + if command -q ghostty; and ghostty +ssh-cache --host="$ssh_target" >/dev/null 2>&1 set ssh_term "xterm-ghostty" - else if command -v infocmp >/dev/null 2>&1 + else if command -q infocmp set -l ssh_terminfo set -l ssh_cpath_dir set -l ssh_cpath @@ -149,7 +149,7 @@ function __ghostty_setup --on-event fish_prompt -d "Setup ghostty integration" set -a ssh_opts -o "ControlPath=$ssh_cpath" # Cache successful installation - if test -n "$ssh_target"; and command -v ghostty >/dev/null 2>&1 + if test -n "$ssh_target"; and command -q ghostty ghostty +ssh-cache --add="$ssh_target" >/dev/null 2>&1; or true end else