mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-19 10:16:12 +03:00
shell-integration: use $GHOSTTY_BIN_DIR/ghostty
Locate our ghostty binary using $GHOSTTY_BIN_DIR rather than searching the PATH.
This commit is contained in:
@ -124,7 +124,7 @@ if [[ "$GHOSTTY_SHELL_FEATURES" == *ssh-* ]]; then
|
|||||||
builtin local ssh_target="${ssh_user}@${ssh_hostname}"
|
builtin local ssh_target="${ssh_user}@${ssh_hostname}"
|
||||||
|
|
||||||
# Check if terminfo is already cached
|
# 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"
|
ssh_term="xterm-ghostty"
|
||||||
elif builtin command -v infocmp >/dev/null 2>&1; then
|
elif builtin command -v infocmp >/dev/null 2>&1; then
|
||||||
builtin local ssh_terminfo ssh_cpath_dir ssh_cpath
|
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")
|
ssh_opts+=(-o "ControlPath=$ssh_cpath")
|
||||||
|
|
||||||
# Cache successful installation
|
# 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
|
else
|
||||||
builtin echo "Warning: Failed to install terminfo." >&2
|
builtin echo "Warning: Failed to install terminfo." >&2
|
||||||
fi
|
fi
|
||||||
|
@ -120,11 +120,11 @@ function __ghostty_setup --on-event fish_prompt -d "Setup ghostty integration"
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if test -n "$ssh_hostname"
|
||||||
set -l ssh_target "$ssh_user@$ssh_hostname"
|
set -l ssh_target "$ssh_user@$ssh_hostname"
|
||||||
|
|
||||||
if test -n "$ssh_hostname"
|
|
||||||
# Check if terminfo is already cached
|
# 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"
|
set ssh_term "xterm-ghostty"
|
||||||
else if command -q infocmp
|
else if command -q infocmp
|
||||||
set -l ssh_terminfo
|
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"
|
set -a ssh_opts -o "ControlPath=$ssh_cpath"
|
||||||
|
|
||||||
# Cache successful installation
|
# Cache successful installation
|
||||||
if command -q ghostty
|
if test -x "$GHOSTTY_BIN_DIR/ghostty"
|
||||||
ghostty +ssh-cache --add="$ssh_target" >/dev/null 2>&1; or true
|
"$GHOSTTY_BIN_DIR/ghostty" +ssh-cache --add="$ssh_target" >/dev/null 2>&1; or true
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
echo "Warning: Failed to install terminfo." >&2
|
echo "Warning: Failed to install terminfo." >&2
|
||||||
|
@ -276,7 +276,7 @@ _ghostty_deferred_init() {
|
|||||||
local ssh_target="${ssh_user}@${ssh_hostname}"
|
local ssh_target="${ssh_user}@${ssh_hostname}"
|
||||||
|
|
||||||
# Check if terminfo is already cached
|
# 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"
|
ssh_term="xterm-ghostty"
|
||||||
elif (( $+commands[infocmp] )); then
|
elif (( $+commands[infocmp] )); then
|
||||||
local ssh_terminfo ssh_cpath_dir ssh_cpath
|
local ssh_terminfo ssh_cpath_dir ssh_cpath
|
||||||
@ -299,7 +299,7 @@ _ghostty_deferred_init() {
|
|||||||
ssh_opts+=(-o "ControlPath=$ssh_cpath")
|
ssh_opts+=(-o "ControlPath=$ssh_cpath")
|
||||||
|
|
||||||
# Cache successful installation
|
# 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
|
else
|
||||||
print "Warning: Failed to install terminfo." >&2
|
print "Warning: Failed to install terminfo." >&2
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user