#!/bin/sh # tmux prefix+m (select-pane -m) toggles the mark on the current pane; prefix+M # (select-pane -M) clears it. tmux shows the mark as a highlighted border, # which herdr cannot draw, so marking says so in a toast instead. Used by # `swap-pane marked` (the : prompt's swap-pane with no target). . "$(dirname "$0")/../lib.sh" f="$(state_dir)/marked" case "${1:-toggle}" in toggle) p="$(active_pane)" if [ "$(cat "$f" 2>/dev/null || true)" = "$p" ]; then rm -f "$f" say "pane $(pane_index "$p") unmarked" else printf '%s\n' "$p" >"$f" say "pane $(pane_index "$p") marked" fi ;; clear) rm -f "$f" ;; esac