diff --git a/pkg/util/shellutil/shellintegration/bash_bashrc.sh b/pkg/util/shellutil/shellintegration/bash_bashrc.sh index b9c68e6e62..8ec2dc49fb 100644 --- a/pkg/util/shellutil/shellintegration/bash_bashrc.sh +++ b/pkg/util/shellutil/shellintegration/bash_bashrc.sh @@ -75,7 +75,7 @@ _waveterm_si_urlencode() { _waveterm_si_osc7() { _waveterm_si_blocked && return local encoded_pwd=$(_waveterm_si_urlencode "$PWD") - printf '\033]7;file://%s%s\007' "$HOSTNAME" "$encoded_pwd" + printf '\033]7;file://localhost%s\007' "$encoded_pwd" } _waveterm_si_precmd() { diff --git a/pkg/util/shellutil/shellintegration/fish_wavefish.sh b/pkg/util/shellutil/shellintegration/fish_wavefish.sh index d6aa9d5000..f896f015d3 100644 --- a/pkg/util/shellutil/shellintegration/fish_wavefish.sh +++ b/pkg/util/shellutil/shellintegration/fish_wavefish.sh @@ -21,7 +21,7 @@ function _waveterm_si_osc7 _waveterm_si_blocked; and return # Use fish-native URL encoding set -l encoded_pwd (string escape --style=url -- "$PWD") - printf '\033]7;file://%s%s\007' $hostname $encoded_pwd + printf '\033]7;file://localhost%s\007' $encoded_pwd end function _waveterm_si_prompt --on-event fish_prompt diff --git a/pkg/util/shellutil/shellintegration/pwsh_wavepwsh.sh b/pkg/util/shellutil/shellintegration/pwsh_wavepwsh.sh index b24288e305..cc002b57a9 100644 --- a/pkg/util/shellutil/shellintegration/pwsh_wavepwsh.sh +++ b/pkg/util/shellutil/shellintegration/pwsh_wavepwsh.sh @@ -27,17 +27,11 @@ function Global:_waveterm_si_blocked { function Global:_waveterm_si_osc7 { if (_waveterm_si_blocked) { return } - # Get hostname (allow empty for file:/// format) - $hostname = $env:COMPUTERNAME - if (-not $hostname) { - $hostname = $env:HOSTNAME - } - # Percent-encode the raw path as-is (handles UNC, drive letters, etc.) $encoded_pwd = [System.Uri]::EscapeDataString($PWD.Path) # OSC 7 - current directory - Write-Host -NoNewline "`e]7;file://$hostname/$encoded_pwd`a" + Write-Host -NoNewline "`e]7;file://localhost/$encoded_pwd`a" } function Global:_waveterm_si_prompt { diff --git a/pkg/util/shellutil/shellintegration/zsh_zshrc.sh b/pkg/util/shellutil/shellintegration/zsh_zshrc.sh index 5df358bb1c..f24abee181 100644 --- a/pkg/util/shellutil/shellintegration/zsh_zshrc.sh +++ b/pkg/util/shellutil/shellintegration/zsh_zshrc.sh @@ -31,14 +31,14 @@ _waveterm_si_urlencode() { else local s="$1" # Escape % first - s=${s//%/%25} + s=${s//\%/%25} # Common reserved characters in file paths - s=${s// /%20} - s=${s//#/%23} + s=${s//\ /%20} + s=${s//\#/%23} s=${s//\?/%3F} - s=${s//&/%26} - s=${s//;/%3B} - s=${s//+/%2B} + s=${s//\&/%26} + s=${s//\;/%3B} + s=${s//\+/%2B} printf '%s' "$s" fi } @@ -46,7 +46,7 @@ _waveterm_si_urlencode() { _waveterm_si_osc7() { _waveterm_si_blocked && return local encoded_pwd=$(_waveterm_si_urlencode "$PWD") - printf '\033]7;file://%s%s\007' "$HOST" "$encoded_pwd" # OSC 7 - current directory + printf '\033]7;file://localhost%s\007' "$encoded_pwd" # OSC 7 - current directory } _waveterm_si_precmd() {