diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-19 01:45:01 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-19 01:45:01 -0500 |
| commit | 68569726f4ca1e550a3e4e288a8f861703cdeb8e (patch) | |
| tree | 52eb471219c3b8f920fb74d1e52329e2297e3fa6 /claude-templates | |
| parent | 9d804cdb4cdb14787e928a1d45c3f2023d739e41 (diff) | |
| download | rulesets-68569726f4ca1e550a3e4e288a8f861703cdeb8e.tar.gz rulesets-68569726f4ca1e550a3e4e288a8f861703cdeb8e.zip | |
fix(ai): explicit end-of-session placement for new windows
tmux's default new-window placement chooses the lowest free index, which can land between existing windows when the session's window indexes have gaps. The -a flag plus the :{end} target makes it explicit: insert after the existing last window, every time.
The change only touches create_window. The two tmux new-session sites (single_mode and multi_mode first window) create fresh sessions; the first window's position is whatever base-index dictates, and there's nothing to append after.
Diffstat (limited to 'claude-templates')
| -rwxr-xr-x | claude-templates/bin/ai | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/claude-templates/bin/ai b/claude-templates/bin/ai index a167174..63dc2e9 100755 --- a/claude-templates/bin/ai +++ b/claude-templates/bin/ai @@ -63,7 +63,7 @@ attach_session() { # Create a window in the ai session, launch claude, return window id. create_window() { local dir="$1" name="$2" wid instructions - wid=$(tmux new-window -t "$SESSION" -n "$name" -c "$dir" -P -F '#{window_id}') + wid=$(tmux new-window -a -t "$SESSION:{end}" -n "$name" -c "$dir" -P -F '#{window_id}') sleep 0.1 instructions=$(build_instructions "$name") tmux send-keys -t "$wid" "$CLAUDE_CMD \"$instructions\"" Enter |
