Last active
September 22, 2020 02:34
-
-
Save skyline75489/b95a03f9967dbce25ac439fb19cdbd56 to your computer and use it in GitHub Desktop.
Windows Terminal OSC 7 for Git Bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__wt_osc7 () { | |
_win_path="$(cygpath -m $(pwd))" | |
printf "\033]7;file://%s/%s\033\\" "$HOSTNAME" "$_win_path" | |
} | |
[ -n "$BASH_VERSION" ] && [ -n "$WT_SESSION" ] && PROMPT_COMMAND="__wt_osc7" |
Also, might need to append to PROMPT_COMMAND
(if possible) or slurp it in, since there's already a default, at least in my env (I don't recall changing it) of history -a
.
Edit: Hmm. That's in my ~/.bashrc, so perhaps it is something I enabled years ago. Sorry.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-w
produces backslashes. Try-m
which produces forward-slashes instead, but is otherwise the same.Also, you can use
cygpath
even outside/[c-z]/
, it'll determine the actual Windows working directory for the Cygwin path. So I don't think this needs the "MSYS Path" leg of theif
.What I ended up with is the single-line version: