mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 00:36:07 +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
|
||||
|
||||
if [[ -n "$GHOSTTY_SSH_INTEGRATION" && "$GHOSTTY_SSH_INTEGRATION" != "off" ]]; then
|
||||
if [[ -n "$GHOSTTY_SSH_INTEGRATION" ]]; then
|
||||
# Wrap `ssh` command to provide Ghostty SSH integration.
|
||||
#
|
||||
# This approach supports wrapping an `ssh` alias, but the alias definition
|
||||
|
@ -99,7 +99,7 @@
|
||||
}
|
||||
|
||||
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) {
|
||||
ssh-term-only $@args
|
||||
} elif (eq "basic" $E:GHOSTTY_SSH_INTEGRATION) {
|
||||
@ -195,7 +195,7 @@
|
||||
}
|
||||
|
||||
# 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~
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ function __ghostty_setup --on-event fish_prompt -d "Setup ghostty integration"
|
||||
end
|
||||
|
||||
# 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"
|
||||
switch "$GHOSTTY_SSH_INTEGRATION"
|
||||
case term-only
|
||||
|
@ -245,7 +245,7 @@ _ghostty_deferred_init() {
|
||||
fi
|
||||
|
||||
# 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
|
||||
ssh() {
|
||||
case "$GHOSTTY_SSH_INTEGRATION" in
|
||||
|
Reference in New Issue
Block a user