summaryrefslogtreecommitdiff
path: root/src/shell-integration
diff options
context:
space:
mode:
authorJon Parise <jon@indelible.org>2025-07-09 17:25:34 -0400
committerJon Parise <jon@indelible.org>2025-07-09 17:25:34 -0400
commitf5f2a4dd20642d7ca1d3f380349eb83762f1eb7e (patch)
treeb48a2d1b6d013ed4c5de0b4f9356d245dc1e964e /src/shell-integration
parent87579b8594cddf860805ce9ab6aff2d4e2ff260e (diff)
shell-integration: use $GHOSTTY_BIN_DIR/ghostty
Locate our ghostty binary using $GHOSTTY_BIN_DIR rather than searching the PATH.
Diffstat (limited to 'src/shell-integration')
-rw-r--r--src/shell-integration/bash/ghostty.bash4
-rw-r--r--src/shell-integration/fish/vendor_conf.d/ghostty-shell-integration.fish10
-rw-r--r--src/shell-integration/zsh/ghostty-integration4
3 files changed, 9 insertions, 9 deletions
diff --git a/src/shell-integration/bash/ghostty.bash b/src/shell-integration/bash/ghostty.bash
index 5b338b11e..aacf37c3a 100644
--- a/src/shell-integration/bash/ghostty.bash
+++ b/src/shell-integration/bash/ghostty.bash
@@ -124,7 +124,7 @@ if [[ "$GHOSTTY_SHELL_FEATURES" == *ssh-* ]]; then
builtin local ssh_target="${ssh_user}@${ssh_hostname}"
# Check if terminfo is already cached
- if ghostty +ssh-cache --host="$ssh_target" >/dev/null 2>&1; then
+ if "$GHOSTTY_BIN_DIR/ghostty" +ssh-cache --host="$ssh_target" >/dev/null 2>&1; then
ssh_term="xterm-ghostty"
elif builtin command -v infocmp >/dev/null 2>&1; then
builtin local ssh_terminfo ssh_cpath_dir ssh_cpath
@@ -147,7 +147,7 @@ if [[ "$GHOSTTY_SHELL_FEATURES" == *ssh-* ]]; then
ssh_opts+=(-o "ControlPath=$ssh_cpath")
# Cache successful installation
- ghostty +ssh-cache --add="$ssh_target" >/dev/null 2>&1 || true
+ "$GHOSTTY_BIN_DIR/ghostty" +ssh-cache --add="$ssh_target" >/dev/null 2>&1 || true
else
builtin echo "Warning: Failed to install terminfo." >&2
fi
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 5381f834b..834f0ef10 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
@@ -120,11 +120,11 @@ function __ghostty_setup --on-event fish_prompt -d "Setup ghostty integration"
end
end
- set -l ssh_target "$ssh_user@$ssh_hostname"
-
if test -n "$ssh_hostname"
+ set -l ssh_target "$ssh_user@$ssh_hostname"
+
# Check if terminfo is already cached
- if command -q ghostty; and ghostty +ssh-cache --host="$ssh_target" >/dev/null 2>&1
+ if test -x "$GHOSTTY_BIN_DIR/ghostty"; and "$GHOSTTY_BIN_DIR/ghostty" +ssh-cache --host="$ssh_target" >/dev/null 2>&1
set ssh_term "xterm-ghostty"
else if command -q infocmp
set -l ssh_terminfo
@@ -149,8 +149,8 @@ function __ghostty_setup --on-event fish_prompt -d "Setup ghostty integration"
set -a ssh_opts -o "ControlPath=$ssh_cpath"
# Cache successful installation
- if command -q ghostty
- ghostty +ssh-cache --add="$ssh_target" >/dev/null 2>&1; or true
+ if test -x "$GHOSTTY_BIN_DIR/ghostty"
+ "$GHOSTTY_BIN_DIR/ghostty" +ssh-cache --add="$ssh_target" >/dev/null 2>&1; or true
end
else
echo "Warning: Failed to install terminfo." >&2
diff --git a/src/shell-integration/zsh/ghostty-integration b/src/shell-integration/zsh/ghostty-integration
index f3fb46180..8607664a2 100644
--- a/src/shell-integration/zsh/ghostty-integration
+++ b/src/shell-integration/zsh/ghostty-integration
@@ -276,7 +276,7 @@ _ghostty_deferred_init() {
local ssh_target="${ssh_user}@${ssh_hostname}"
# Check if terminfo is already cached
- if (( $+commands[ghostty] )) && ghostty +ssh-cache --host="$ssh_target" >/dev/null 2>&1; then
+ if "$GHOSTTY_BIN_DIR/ghostty" +ssh-cache --host="$ssh_target" >/dev/null 2>&1; then
ssh_term="xterm-ghostty"
elif (( $+commands[infocmp] )); then
local ssh_terminfo ssh_cpath_dir ssh_cpath
@@ -299,7 +299,7 @@ _ghostty_deferred_init() {
ssh_opts+=(-o "ControlPath=$ssh_cpath")
# Cache successful installation
- ghostty +ssh-cache --add="$ssh_target" >/dev/null 2>&1 || true
+ "$GHOSTTY_BIN_DIR/ghostty" +ssh-cache --add="$ssh_target" >/dev/null 2>&1 || true
else
print "Warning: Failed to install terminfo." >&2
fi