aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-19 12:31:17 -0500
committerCraig Jennings <c@cjennings.net>2026-05-19 12:31:17 -0500
commit924fec1f00e7ef5e497575488701e8c9eb2606f0 (patch)
tree9c0df313352ab01bd608fd408871ef7de418a39c /scripts
parent5d8d9df7d1b95c1a6a7bf25ddf57652c86f110b3 (diff)
downloadarchsetup-924fec1f00e7ef5e497575488701e8c9eb2606f0.tar.gz
archsetup-924fec1f00e7ef5e497575488701e8c9eb2606f0.zip
feat(tmux-util): add ls subcommand
tmux-util ls is an opinionated replacement for `tmux ls` with columns for state (attached/detached), name, idle time (humanized), window count, and the current pane's cwd (tilde-fied if it sits under $HOME). The cwd query goes through `tmux display -p -t <session> '#{pane_current_path}'`, which returns the cwd of the active pane of the active window. That's close enough to "what the session is about" for a one-line summary. Idle calculation reads `date +%s` by default and accepts an override via the TMUX_UTIL_NOW env var so tests can pin "now" to a known epoch. 12 new tests cover Normal cases (attached / detached, multiple sessions) and Boundary cases (no sessions, idle exactly at minute / hour / day boundaries, $HOME tilde). One existing dispatch test got reworked because the original stub target (`ls`) is no longer unimplemented. Total suite is 26 tests, all green. The fake-tmux harness picked up two things along the way: real format-string parsing for `list-sessions -F` and a new handler for `display -p`. The state file format extended to include activity epoch, window count, and cwd, with sensible defaults for older 3-tuple test inputs so the reap tests keep passing untouched.
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions