Skip to content

Instantly share code, notes, and snippets.

@mystix
Forked from skyline75489/prompt.sh
Created July 14, 2025 02:45
Show Gist options
  • Save mystix/421657713ea15ca408c15398371aa7f1 to your computer and use it in GitHub Desktop.
Save mystix/421657713ea15ca408c15398371aa7f1 to your computer and use it in GitHub Desktop.
Windows Terminal OSC 9;9 for Bash & Zsh in WSL
__wt_osc9_9 () {
_win_path=$(wslpath -m $(pwd))
printf "\033]9;9;%s\033\\" "$_win_path"
}
[ -n "$BASH_VERSION" ] && [ -n "$WT_SESSION" ] && PROMPT_COMMAND="__wt_osc9_9"
[ -n "$ZSH_VERSION" ] && [ -n "$WT_SESSION" ] && precmd_functions+=(__wt_osc9_9)
true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment