diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-05-27 11:20:10 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-05-27 11:20:10 +0200 |
commit | 6861ccd62fb8b15b842b9181bc46e2d07fe24b0f (patch) | |
tree | b618684fc9c201b4756ca505b4749f553e2c4cf3 | |
parent | 182d39bed877d90abcc87de6dfd5375289e1d317 (diff) |
added chpwd hook
-rw-r--r-- | config/essentials/zsh/.zshrc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index b2cda54..d5d5465 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -87,6 +87,16 @@ set_wt () { print -Pn "\e]0;%n@%m on %~\a" } add-zsh-hook -Uz precmd set_wt +function osc7 { + local LC_ALL=C + export LC_ALL + + setopt localoptions extendedglob + input=( ${(s::)PWD} ) + uri=${(j::)input/(#b)([^A-Za-z0-9_.\!~*\'\(\)-\/])/%${(l:2::0:)$(([##16]#match))}} + print -n "\e]7;file://${HOSTNAME}${uri}\e\\" +} +add-zsh-hook -Uz chpwd osc7 # prompt |