fix: more portable OSC 7 hook — BEL terminator, %20 space encoding
Some checks failed
Build & Sign Wraith / Build Windows + Sign (push) Failing after 7s

Switched to printf '\e]7;file://localhost/%s\a' with sed space encoding.
BEL (\a) terminator is more universally supported than ST (\e\\).
Shared __wraith_osc7 function avoids duplicating the printf across
bash/zsh branches.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vantz Stockwell 2026-03-25 01:20:06 -04:00
parent 0251614732
commit 8565f11c11

View File

@ -165,11 +165,9 @@ impl SshService {
{
let osc7_hook = concat!(
" stty -echo; ",
r#"if [ -n "$ZSH_VERSION" ]; then "#,
r#"precmd() { printf '\033]7;file://%s%s\033\\' "$HOST" "$PWD"; }; "#,
r#"elif [ -n "$BASH_VERSION" ]; then "#,
r#"PROMPT_COMMAND='printf "\033]7;file://%s%s\033\\\\" "$HOSTNAME" "$PWD"'; "#,
r#"fi; "#,
r#"__wraith_osc7() { printf '\e]7;file://localhost/%s\a' \"$(pwd | sed 's/ /%20/g')\"; }; "#,
r#"if [ -n "$ZSH_VERSION" ]; then precmd() { __wraith_osc7; }; "#,
r#"elif [ -n "$BASH_VERSION" ]; then PROMPT_COMMAND='__wraith_osc7'; fi; "#,
"stty echo; clear; cd .\n"
);
let h = handle.lock().await;