From 8565f11c11f3e83e5722b5182c22e0f1c7cf2fd0 Mon Sep 17 00:00:00 2001 From: Vantz Stockwell Date: Wed, 25 Mar 2026 01:20:06 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20more=20portable=20OSC=207=20hook=20?= =?UTF-8?q?=E2=80=94=20BEL=20terminator,=20%20=20space=20encoding?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- src-tauri/src/ssh/session.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src-tauri/src/ssh/session.rs b/src-tauri/src/ssh/session.rs index 35d43c7..5db31dc 100644 --- a/src-tauri/src/ssh/session.rs +++ b/src-tauri/src/ssh/session.rs @@ -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;