mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 08:46:08 +03:00
refactor: simplify ssh integration environment variable checks
This commit is contained in:
@ -103,7 +103,7 @@ if [[ "$GHOSTTY_SHELL_FEATURES" == *"sudo"* && -n "$TERMINFO" ]]; then
|
|||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$GHOSTTY_SSH_INTEGRATION" && "$GHOSTTY_SSH_INTEGRATION" != "off" ]]; then
|
if [[ -n "$GHOSTTY_SSH_INTEGRATION" ]]; then
|
||||||
# Wrap `ssh` command to provide Ghostty SSH integration.
|
# Wrap `ssh` command to provide Ghostty SSH integration.
|
||||||
#
|
#
|
||||||
# This approach supports wrapping an `ssh` alias, but the alias definition
|
# This approach supports wrapping an `ssh` alias, but the alias definition
|
||||||
|
@ -99,7 +99,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn ssh-with-ghostty-integration {|@args|
|
fn ssh-with-ghostty-integration {|@args|
|
||||||
if (and (has-env GHOSTTY_SSH_INTEGRATION) (not-eq "" $E:GHOSTTY_SSH_INTEGRATION) (not-eq "off" $E:GHOSTTY_SSH_INTEGRATION)) {
|
if (has-env GHOSTTY_SSH_INTEGRATION) {
|
||||||
if (eq "term-only" $E:GHOSTTY_SSH_INTEGRATION) {
|
if (eq "term-only" $E:GHOSTTY_SSH_INTEGRATION) {
|
||||||
ssh-term-only $@args
|
ssh-term-only $@args
|
||||||
} elif (eq "basic" $E:GHOSTTY_SSH_INTEGRATION) {
|
} elif (eq "basic" $E:GHOSTTY_SSH_INTEGRATION) {
|
||||||
@ -195,7 +195,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Register SSH integration if enabled
|
# Register SSH integration if enabled
|
||||||
if (and (has-env GHOSTTY_SSH_INTEGRATION) (not-eq "" $E:GHOSTTY_SSH_INTEGRATION) (not-eq "off" $E:GHOSTTY_SSH_INTEGRATION) (has-external ssh)) {
|
if (and (has-env GHOSTTY_SSH_INTEGRATION) (has-external ssh)) {
|
||||||
edit:add-var ssh~ $ssh-with-ghostty-integration~
|
edit:add-var ssh~ $ssh-with-ghostty-integration~
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ function __ghostty_setup --on-event fish_prompt -d "Setup ghostty integration"
|
|||||||
end
|
end
|
||||||
|
|
||||||
# SSH integration wrapper
|
# SSH integration wrapper
|
||||||
if test -n "$GHOSTTY_SSH_INTEGRATION"; and test "$GHOSTTY_SSH_INTEGRATION" != off
|
if test -n "$GHOSTTY_SSH_INTEGRATION"
|
||||||
function ssh -d "Wrap ssh to provide Ghostty SSH integration"
|
function ssh -d "Wrap ssh to provide Ghostty SSH integration"
|
||||||
switch "$GHOSTTY_SSH_INTEGRATION"
|
switch "$GHOSTTY_SSH_INTEGRATION"
|
||||||
case term-only
|
case term-only
|
||||||
|
@ -245,7 +245,7 @@ _ghostty_deferred_init() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# SSH
|
# SSH
|
||||||
if [[ -n "$GHOSTTY_SSH_INTEGRATION" && "$GHOSTTY_SSH_INTEGRATION" != "off" ]]; then
|
if [[ -n "$GHOSTTY_SSH_INTEGRATION" ]]; then
|
||||||
# Wrap `ssh` command to provide Ghostty SSH integration
|
# Wrap `ssh` command to provide Ghostty SSH integration
|
||||||
ssh() {
|
ssh() {
|
||||||
case "$GHOSTTY_SSH_INTEGRATION" in
|
case "$GHOSTTY_SSH_INTEGRATION" in
|
||||||
|
Reference in New Issue
Block a user