From cc95668f6dce90fc24639f222990fb5070b17d9a Mon Sep 17 00:00:00 2001 From: Asmir A Date: Tue, 4 Feb 2025 14:31:09 +0100 Subject: [PATCH] home/zsh: export pwd using osc7 --- home/zsh.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/home/zsh.nix b/home/zsh.nix index c2c438d..64fb97b 100644 --- a/home/zsh.nix +++ b/home/zsh.nix @@ -92,6 +92,18 @@ 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)" zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'