159e378cbb
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
25 lines
501 B
Bash
25 lines
501 B
Bash
function osc7-pwd() {
|
|
emulate -L zsh # also sets localoptions for us
|
|
setopt extendedglob
|
|
local LC_ALL=C
|
|
printf '\e]7;file://%s%s\e\' $HOST ${PWD//(#m)([^@-Za-z&-;_~])/%${(l:2::0:)$(([##16]#MATCH))}}
|
|
}
|
|
|
|
function chpwd-osc7-pwd() {
|
|
(( ZSH_SUBSHELL )) || osc7-pwd
|
|
}
|
|
add-zsh-hook -Uz chpwd chpwd-osc7-pwd
|
|
|
|
precmd() {
|
|
print -Pn "\e]133;A\e\\"
|
|
}
|
|
|
|
function precmd {
|
|
if ! builtin zle; then
|
|
print -n "\e]133;D\e\\"
|
|
fi
|
|
}
|
|
|
|
function preexec {
|
|
print -n "\e]133;C\e\\"
|
|
}
|