mirror of
https://github.com/artizirk/dotfiles.git
synced 2025-12-18 15:55:12 +02:00
Configure zsh to emic OSC7 CWD updates to terminal
This commit is contained in:
12
.config/zsh/functions/osc7-pwd.zsh
Normal file
12
.config/zsh/functions/osc7-pwd.zsh
Normal file
@@ -0,0 +1,12 @@
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user