diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-19 12:31:17 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-19 12:31:17 -0500 |
| commit | fbe3cd67ac04ec73746fdcda0e5f37145d735235 (patch) | |
| tree | 7acbf050971f157a1579cdabf177850c14af3685 /tests/layout-navigate | |
| parent | 9557006dd2409437a346f66611e6fa2762aa1e63 (diff) | |
| download | archsetup-fbe3cd67ac04ec73746fdcda0e5f37145d735235.tar.gz archsetup-fbe3cd67ac04ec73746fdcda0e5f37145d735235.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 'tests/layout-navigate')
0 files changed, 0 insertions, 0 deletions
