mirror of
https://github.com/artizirk/dotfiles.git
synced 2024-12-22 11:30:15 +02:00
Configure zsh to emic OSC7 CWD updates to terminal
This commit is contained in:
parent
9359a4a193
commit
fe30aae0ba
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
|
||||
|
4
.zshrc
4
.zshrc
@ -53,6 +53,10 @@ zstyle ':prompt:grml:right:setup' use-rprompt false
|
||||
# https://unix.stackexchange.com/a/302710
|
||||
#set +o prompt_cr +o prompt_sp
|
||||
|
||||
# Tell to the terminal about our current working directory
|
||||
# NB: turns out that alacritty snopps that info from /proc/PID/cwd
|
||||
xsource ~/.config/zsh/functions/osc7-pwd.zsh
|
||||
|
||||
# enable OSC 133 shell prompt start/end reporting
|
||||
# so that the terminal can scroll jump between prompts
|
||||
xsource ~/.config/zsh/functions/semantic-prompt.zsh
|
||||
|
Loading…
Reference in New Issue
Block a user