From 986e760687a2d34051934d410bec71fa2efc349b Mon Sep 17 00:00:00 2001 From: Igor Soarez Date: Mon, 5 Oct 2026 11:27:00 +0300 Subject: tmuxrdr: tmux-mode plugin The tmux default prefix bindings herdr has no built-in action for, as a herdr plugin built on its CLI and socket: break-pane, swap-pane and rotate-window by pane order (focus behaviour measured on tmux 3.7c), mark/clear-mark, last-window and switch-client -l (from focus events, per session), select-window and move-window by index, paste-buffer -p, display-message in tmux's default format, select-layout -E, kill-pane and kill-window behind tmux's y/n prompts, a command prompt taking tmux's commands, clock-mode, show-messages, and automatic-rename. Also a .gitignore for secrets scoped to tmuxrdr/, leaving herdr's own untouched. --- tmuxrdr/plugin/bin/select-window | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 tmuxrdr/plugin/bin/select-window (limited to 'tmuxrdr/plugin/bin/select-window') diff --git a/tmuxrdr/plugin/bin/select-window b/tmuxrdr/plugin/bin/select-window new file mode 100755 index 00000000..691d7c9f --- /dev/null +++ b/tmuxrdr/plugin/bin/select-window @@ -0,0 +1,22 @@ +#!/bin/sh +# tmux prefix+0 and prefix+' (select-window -t :=N). Herdr numbers tabs by +# their place in the tab bar, from 1 -- like tmux with base-index 1 and +# renumber-windows on -- so N is a position: 0 finds nothing, exactly as +# prefix+0 does under this machine's base-index 1. With no argument it prompts +# for the index, as prefix+' does (run as a popup). +. "$(dirname "$0")/../lib.sh" + +n="${1:-}" +if [ -z "$n" ]; then + printf '(index) ' + IFS= read -r n || exit 0 +fi +[ -n "$n" ] || exit 0 +case "$n" in + *[!0-9]*) fail "can't find window: $n" ;; +esac + +ws="$(pane_info "$(active_pane)" workspace_id)" +tab="$(workspace_tabs "$ws" | sed -n "${n}p" | cut -f1)" +[ "$n" -gt 0 ] && [ -n "$tab" ] || fail "can't find window: $n" +"$H" tab focus "$tab" >/dev/null -- cgit v1.2.3