From 5cb0a93e3ac9dfef4d389f6caa7903de74ff9e7b Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Mon, 19 May 2025 23:29:24 -0400 Subject: [PATCH] AutoYADM commit: 2025-05-19 23:29:24 --- .config/kak/kakrc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.config/kak/kakrc b/.config/kak/kakrc index a992470c..d5fbd66c 100644 --- a/.config/kak/kakrc +++ b/.config/kak/kakrc @@ -110,18 +110,24 @@ define-command -docstring "Create a scratch buffer" scratch %{ } alias global s scratch -# bar experimenting -define-command bar-buflist %{ - eval %sh{ +define-command -hidden bar-buflist %{ + evaluate-commands %sh{ list='' while read buf; do + if [ "$buf" = '*debug*' ]; then + continue + fi index=$(($index + 1)) - # if [ "$buf" = "$kak_bufname" ]; then - cur=$(printf '[%s] %s' "$index" "$buf") + if [ "$buf" = "$kak_bufname" ]; then + cur=$(printf '[%s %s]' "$index" "$buf") + else + cur=$(printf '%s %s' "$index" "$buf") + fi list="$list $cur" done <<< $(printf '%s\n' "$kak_buflist" | tr ' ' '\n') - quoted=$(printf '%q' "$list" | sed -e 's/\\\*/\*/g' -e 's/\\\[/\[/g' -e 's/\\\]/\]/g') - - printf "set-option -add global ui_options terminal_title=%s" "$quoted" + title="$list - $kak_client@[$kak_session]" + printf "set-option -add global ui_options %%{terminal_title=%s}" "$title" } } + +hook global WinDisplay .* bar-buflist