fix: trigger initial CWD emission with cd . after OSC 7 hook inject
Some checks failed
Build & Sign Wraith / Build Windows + Sign (push) Failing after 6s

precmd/PROMPT_COMMAND only fire after a command runs. Without cd .
the first OSC 7 never emits and SFTP doesn't know the initial directory.

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

View File

@ -170,7 +170,7 @@ impl SshService {
r#"elif [ -n "$BASH_VERSION" ]; then "#, r#"elif [ -n "$BASH_VERSION" ]; then "#,
r#"PROMPT_COMMAND='printf "\033]7;file://%s%s\033\\\\" "$HOSTNAME" "$PWD"'; "#, r#"PROMPT_COMMAND='printf "\033]7;file://%s%s\033\\\\" "$HOSTNAME" "$PWD"'; "#,
r#"fi; "#, r#"fi; "#,
"stty echo; clear\n" "stty echo; clear; cd .\n"
); );
let h = handle.lock().await; let h = handle.lock().await;
let _ = h.data(channel_id, CryptoVec::from_slice(osc7_hook.as_bytes())).await; let _ = h.data(channel_id, CryptoVec::from_slice(osc7_hook.as_bytes())).await;