Skip to content

Instantly share code, notes, and snippets.

@skyline75489
Last active December 18, 2022 08:44
Show Gist options
  • Save skyline75489/d655aede4c729eff178a1c0bfd10f622 to your computer and use it in GitHub Desktop.
Save skyline75489/d655aede4c729eff178a1c0bfd10f622 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
@jackblk
Copy link

jackblk commented Jun 9, 2021

It works!

One line for who's using ZSH:

wget -qO- https://gist.githubusercontent.com/skyline75489/d655aede4c729eff178a1c0bfd10f622/raw/prompt.sh >> ~/.zshrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment