fix: use kebab-case for ssh-integration enum values

This commit is contained in:
Jason Rayne
2025-06-13 17:03:20 -07:00
parent 142e07c502
commit 8f93d8fe03
5 changed files with 22 additions and 22 deletions

View File

@ -6114,7 +6114,7 @@ pub const ShellIntegrationFeatures = packed struct {
/// ///
/// * `off` - No SSH integration, use standard ssh command /// * `off` - No SSH integration, use standard ssh command
/// ///
/// * `term_only` - Only fix TERM compatibility (xterm-ghostty -> xterm-256color) /// * `term-only` - Only fix TERM compatibility (xterm-ghostty -> xterm-256color)
/// ///
/// * `basic` - TERM fix + environment variable propagation /// * `basic` - TERM fix + environment variable propagation
/// ///
@ -6123,7 +6123,7 @@ pub const ShellIntegrationFeatures = packed struct {
/// The default value is `off`. /// The default value is `off`.
pub const SSHIntegration = enum { pub const SSHIntegration = enum {
off, off,
term_only, @"term-only",
basic, basic,
full, full,

View File

@ -111,8 +111,8 @@ if [[ -n "$GHOSTTY_SSH_INTEGRATION" && "$GHOSTTY_SSH_INTEGRATION" != "off" ]]; t
# will take precedence over this function, and it won't be wrapped. # will take precedence over this function, and it won't be wrapped.
function ssh { function ssh {
case "$GHOSTTY_SSH_INTEGRATION" in case "$GHOSTTY_SSH_INTEGRATION" in
"term_only") "term-only")
_ghostty_ssh_term_only "$@" _ghostty_ssh_term-only "$@"
;; ;;
"basic") "basic")
_ghostty_ssh_basic "$@" _ghostty_ssh_basic "$@"
@ -127,8 +127,8 @@ if [[ -n "$GHOSTTY_SSH_INTEGRATION" && "$GHOSTTY_SSH_INTEGRATION" != "off" ]]; t
esac esac
} }
# Level: term_only - Just fix TERM compatibility # Level: term-only - Just fix TERM compatibility
_ghostty_ssh_term_only() { _ghostty_ssh_term-only() {
if [[ "$TERM" == "xterm-ghostty" ]]; then if [[ "$TERM" == "xterm-ghostty" ]]; then
TERM=xterm-256color command ssh "$@" TERM=xterm-256color command ssh "$@"
else else

View File

@ -100,7 +100,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 (and (has-env GHOSTTY_SSH_INTEGRATION) (not-eq "" $E:GHOSTTY_SSH_INTEGRATION) (not-eq "off" $E: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) {
ssh-basic $@args ssh-basic $@args
@ -116,7 +116,7 @@
} }
fn ssh-term-only {|@args| fn ssh-term-only {|@args|
# Level: term_only - Just fix TERM compatibility # Level: term-only - Just fix TERM compatibility
if (eq "xterm-ghostty" $E:TERM) { if (eq "xterm-ghostty" $E:TERM) {
TERM=xterm-256color (external ssh) $@args TERM=xterm-256color (external ssh) $@args
} else { } else {

View File

@ -90,8 +90,8 @@ function __ghostty_setup --on-event fish_prompt -d "Setup ghostty integration"
if test -n "$GHOSTTY_SSH_INTEGRATION"; and test "$GHOSTTY_SSH_INTEGRATION" != off if test -n "$GHOSTTY_SSH_INTEGRATION"; and test "$GHOSTTY_SSH_INTEGRATION" != off
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
_ghostty_ssh_term_only $argv _ghostty_ssh_term-only $argv
case basic case basic
_ghostty_ssh_basic $argv _ghostty_ssh_basic $argv
case full case full
@ -102,8 +102,8 @@ function __ghostty_setup --on-event fish_prompt -d "Setup ghostty integration"
end end
end end
# Level: term_only - Just fix TERM compatibility # Level: term-only - Just fix TERM compatibility
function _ghostty_ssh_term_only -d "SSH with TERM compatibility fix" function _ghostty_ssh_term-only -d "SSH with TERM compatibility fix"
if test "$TERM" = xterm-ghostty if test "$TERM" = xterm-ghostty
TERM=xterm-256color command ssh $argv TERM=xterm-256color command ssh $argv
else else
@ -143,18 +143,18 @@ function __ghostty_setup --on-event fish_prompt -d "Setup ghostty integration"
# Full integration: Two-step terminfo installation # Full integration: Two-step terminfo installation
if command -v infocmp >/dev/null 2>&1 if command -v infocmp >/dev/null 2>&1
echo "Installing Ghostty terminfo on remote host..." >&2 echo "Installing Ghostty terminfo on remote host..." >&2
# Step 1: Install terminfo using the same approach that works manually # Step 1: Install terminfo using the same approach that works manually
# This requires authentication but is quick and reliable # This requires authentication but is quick and reliable
if infocmp -x xterm-ghostty 2>/dev/null | command ssh $argv 'mkdir -p ~/.terminfo/x 2>/dev/null && tic -x -o ~/.terminfo /dev/stdin 2>/dev/null' if infocmp -x xterm-ghostty 2>/dev/null | command ssh $argv 'mkdir -p ~/.terminfo/x 2>/dev/null && tic -x -o ~/.terminfo /dev/stdin 2>/dev/null'
echo "Terminfo installed successfully. Connecting with full Ghostty support..." >&2 echo "Terminfo installed successfully. Connecting with full Ghostty support..." >&2
# Step 2: Connect with xterm-ghostty since we know terminfo is now available # Step 2: Connect with xterm-ghostty since we know terminfo is now available
set -l env_vars set -l env_vars
# Use xterm-ghostty since we just installed it # Use xterm-ghostty since we just installed it
set -a env_vars TERM=xterm-ghostty set -a env_vars TERM=xterm-ghostty
# Propagate Ghostty shell integration environment variables # Propagate Ghostty shell integration environment variables
if set -q GHOSTTY_SHELL_INTEGRATION_NO_CURSOR if set -q GHOSTTY_SHELL_INTEGRATION_NO_CURSOR
set -a env_vars GHOSTTY_SHELL_INTEGRATION_NO_CURSOR=$GHOSTTY_SHELL_INTEGRATION_NO_CURSOR set -a env_vars GHOSTTY_SHELL_INTEGRATION_NO_CURSOR=$GHOSTTY_SHELL_INTEGRATION_NO_CURSOR
@ -165,7 +165,7 @@ function __ghostty_setup --on-event fish_prompt -d "Setup ghostty integration"
if set -q GHOSTTY_SHELL_INTEGRATION_NO_TITLE if set -q GHOSTTY_SHELL_INTEGRATION_NO_TITLE
set -a env_vars GHOSTTY_SHELL_INTEGRATION_NO_TITLE=$GHOSTTY_SHELL_INTEGRATION_NO_TITLE set -a env_vars GHOSTTY_SHELL_INTEGRATION_NO_TITLE=$GHOSTTY_SHELL_INTEGRATION_NO_TITLE
end end
# Normal SSH connection with Ghostty terminfo available # Normal SSH connection with Ghostty terminfo available
env $env_vars ssh $argv env $env_vars ssh $argv
return 0 return 0
@ -173,7 +173,7 @@ function __ghostty_setup --on-event fish_prompt -d "Setup ghostty integration"
echo "Terminfo installation failed. Using basic integration." >&2 echo "Terminfo installation failed. Using basic integration." >&2
end end
end end
# Fallback to basic integration # Fallback to basic integration
_ghostty_ssh_basic $argv _ghostty_ssh_basic $argv
end end

View File

@ -249,8 +249,8 @@ _ghostty_deferred_init() {
# 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
"term_only") "term-only")
_ghostty_ssh_term_only "$@" _ghostty_ssh_term-only "$@"
;; ;;
"basic") "basic")
_ghostty_ssh_basic "$@" _ghostty_ssh_basic "$@"
@ -265,8 +265,8 @@ _ghostty_deferred_init() {
esac esac
} }
# Level: term_only - Just fix TERM compatibility # Level: term-only - Just fix TERM compatibility
_ghostty_ssh_term_only() { _ghostty_ssh_term-only() {
if [[ "$TERM" == "xterm-ghostty" ]]; then if [[ "$TERM" == "xterm-ghostty" ]]; then
TERM=xterm-256color builtin command ssh "$@" TERM=xterm-256color builtin command ssh "$@"
else else