add M-b hotkey to toggle manual unread bell on tmux windows

This commit is contained in:
David Chen 2026-02-05 12:23:16 -08:00
parent a97e3a5e20
commit 4a5044a949
3 changed files with 18 additions and 0 deletions

View file

@ -69,6 +69,15 @@ fi
get_session_icon() {
local sid="$1"
# Check for manual @unread on any window in this session
local unread_win
unread_win=$(tmux list-windows -t "$sid" -F '#{@unread}' 2>/dev/null | grep -m1 '^1$' || true)
if [[ -n "$unread_win" ]]; then
printf '🔔'
return
fi
[[ -z "$tracker_state" ]] && return
local result
result=$(echo "$tracker_state" | jq -r --arg sid "$sid" '

View file

@ -4,6 +4,13 @@ set -euo pipefail
window_id="$1"
[[ -z "$window_id" ]] && exit 0
# Check manual @unread flag
unread=$(tmux show -wv -t "$window_id" @unread 2>/dev/null || true)
if [[ "$unread" == "1" ]]; then
printf '🔔'
exit 0
fi
CACHE_FILE="/tmp/tmux-tracker-cache.json"
[[ ! -f "$CACHE_FILE" ]] && exit 0