fix(tmux): sanitize tds session names (#14109)

This commit is contained in:
Peat Bakke
2026-09-19 08:20:54 +02:00
committed by GitHub
parent e7852049a5
commit 157eb033f2
+5
View File
@@ -178,6 +178,11 @@ alias tmux=_zsh_tmux_plugin_run
function _tmux_directory_session() {
# current directory without leading path
local dir=${PWD##*/}
# tmux target syntax treats '.' and ':' as separators, a leading '$', '@' or '%'
# as an id and a leading '=' as an exact-match prefix, so a session named after
# such a directory can't be found on reattach
dir=${dir//[.:]/_}
dir=${dir/#[\$@%=]/_}
# md5 hash for the full working directory path
local md5=$(printf '%s' "$PWD" | md5sum | cut -d ' ' -f 1)
# human friendly unique session name for this directory