fix(tmux): pick per-instance ports and restore pane cleanup

This commit is contained in:
alex
2026-03-11 12:36:45 +00:00
parent 00335c86ae
commit 5aae551edd
3 changed files with 16 additions and 25 deletions

View File

@@ -1,7 +1,9 @@
function c --wraps=opencode --description 'opencode (auto-starts tmux for visual subagent panes)'
set -l port (python -c 'import socket; s=socket.socket(); s.bind(("127.0.0.1", 0)); print(s.getsockname()[1]); s.close()')
if not set -q TMUX
tmux new-session opencode $argv
tmux new-session opencode --port $port $argv
else
opencode $argv
opencode --port $port $argv
end
end

View File

@@ -1,7 +1,9 @@
function cc --wraps='opencode --continue' --description 'opencode --continue (auto-starts tmux for visual subagent panes)'
set -l port (python -c 'import socket; s=socket.socket(); s.bind(("127.0.0.1", 0)); print(s.getsockname()[1]); s.close()')
if not set -q TMUX
tmux new-session opencode --continue $argv
tmux new-session opencode --port $port --continue $argv
else
opencode --continue $argv
opencode --port $port --continue $argv
end
end