aboutsummaryrefslogtreecommitdiff
path: root/tests/layout-navigate
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-19 13:01:19 -0500
committerCraig Jennings <c@cjennings.net>2026-05-19 13:01:19 -0500
commitb4cd792f847e9513fd4e9bac4ee26b492dbdadc3 (patch)
tree6ffe4e7cf660a677399ba11a4542dc2de47cd8c8 /tests/layout-navigate
parentfbe3cd67ac04ec73746fdcda0e5f37145d735235 (diff)
downloadarchsetup-b4cd792f847e9513fd4e9bac4ee26b492dbdadc3.tar.gz
archsetup-b4cd792f847e9513fd4e9bac4ee26b492dbdadc3.zip
feat(tmux-util): add go subcommand (attach-or-create)
tmux-util go <name> attaches to a session named <name> if it exists, creates it otherwise. Behavior depends on whether the caller is already inside tmux: - Outside tmux: `tmux attach-session -t <name>` (existing) or `tmux new-session -s <name> -c $PWD` (new). - Inside tmux (TMUX env set): `tmux switch-client -t <name>` (existing) or `tmux new-session -d -s <name> -c $PWD` followed by `switch-client` (new). Attaching from inside tmux would nest sessions and break the outer view, so the inside path uses switch-client instead. The existence check uses `tmux has-session -t =<name>` with the leading `=` to force exact-match. Without it, tmux does prefix matching, which would let `go foo` resolve to a session named `foobar`. I added 6 new tests covering both inside/outside-tmux paths, both create/attach paths, plus error handling for missing or empty name arguments. fake-tmux picked up handlers for new-session (mutates state), attach-session and switch-client (record-only), and the `=`-prefix form of has-session. Total suite: 32 tests, all green.
Diffstat (limited to 'tests/layout-navigate')
0 files changed, 0 insertions, 0 deletions