From 35f8df23785a68f53ad86671517d91a5053aca37 Mon Sep 17 00:00:00 2001 From: Robby Russell Date: Tue, 24 Nov 2026 11:43:39 -0800 Subject: [PATCH] fix(termsupport): include the locale codeset in the cwd URL cache key omz_urlencode transcodes from $langinfo[CODESET] to UTF-8 before percent-encoding, so the same $PWD encodes to different bytes under a different locale. Changing LC_ALL/LANG without changing directory kept emitting the URL cached under the old codeset. Co-Authored-By: Claude Opus 5.5 --- lib/termsupport.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index d14b23dce..aa9f978fd 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -147,8 +147,8 @@ esac function omz_termsupport_cwd { setopt localoptions unset # Percent-encode the host and path names. Encoding forks a subshell each, - # so keep the result and only redo it when $HOST or $PWD changed. - local cache_key="$HOST:$PWD:${KONSOLE_PROFILE_NAME:+1}:${KONSOLE_DBUS_SESSION:+1}" + # so keep the result and only redo it when its inputs change. + local cache_key="$HOST:$PWD:${langinfo[CODESET]}:${KONSOLE_PROFILE_NAME:+1}:${KONSOLE_DBUS_SESSION:+1}" if [[ "$_omz_termsupport_cwd_key" != "$cache_key" ]]; then local URL_HOST URL_PATH URL_HOST="$(omz_urlencode -P "$HOST")" || return 1