4
I've found using iTerm2 and tmux -CC
to be quite helpful tying the existing iTerm UI with tmux windows & panes.
I'm trying to figure out how to automatically attach to an existing session at iTerm launch (with the Send text at start:
profile setting) or create a new one if it doesn't exist.
I've seen several people suggest something like the following:
tmux attach -t base || tmux new -s base
but adding the -CC flag results in some strange behavior / doesn't work. I get the following error on first launch:
A tmux protocol error occurred.
Reason: %begin with empty command queue
and the shell (client?) has the following output:
> tmux -CC attach -t base || tmux -CC new -s base
** tmux mode started **
Command Menu
----------------------------
esc Detach cleanly.
X Force-quit tmux mode.
L Toggle logging.
C Run tmux command.
Detached
** tmux mode started **
Command Menu
----------------------------
esc Detach cleanly.
X Force-quit tmux mode.
L Toggle logging.
C Run tmux command.
Detached
%output %0 \015\015\033M\033[0m\033[23m\033[24m\033[J\033[36m@\033[32mgloesch\033[m\017 \033[1m\033[34m~\033[m\017 \015\012> \033[K\033[68C\033[31m<system>\033[m\017 \033[m\017\033[77D
%begin 1444229906 14 1
%end 1444229906 14 1
%exit
A second window is created during this process but then ends up being closed once everything finishes.