home/zsh: export pwd using osc7

This commit is contained in:
Asmir A 2025-02-04 14:31:09 +01:00
parent 9f1d4c2bfe
commit cc95668f6d
Signed by: asmir
GPG Key ID: 020C42B7A9ABA3E2

View File

@ -92,6 +92,18 @@
ls; ls;
} }
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
eval "$(direnv hook zsh)" eval "$(direnv hook zsh)"
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'