1
0
mirror of https://github.com/artizirk/dotfiles.git synced 2024-11-14 05:00:59 +02:00
dotfiles/.config/zsh/functions/osc7-pwd.zsh

13 lines
322 B
Bash
Raw Normal View History

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