--
You received this message because you are subscribed to the Google Groups "iterm2-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to iterm2-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
> Is it possible your ssh session died and the session ended?I'd be surprised if it was ssh dying. For one thing, I've been using iterm2+ssh+tmux for a year or two and the ssh connection is generally stable for days or weeks. It really never dies on its own, only when the network or VPN is interrupted. The only thing that's changed is that I've added -CC to enable the tmux integration. And this happens repeatedly, not just once. Also, note that individual tmux windows seem to go away occasionally - the loss of the entire session from the dashboard probably happens only when the count of windows in the right pane has gone to zero, though I don't have evidence to prove that yet. Last, if I didn't say it before, if I kill iTerm2 and restart it everything is restored. So the tmux session itself has not died, only its apparent connection with iTerm2.> What do you see in the window where you ran tmux -CC?There is no such window. I run the following command from iTerm2 Preferences > Profiles > [profile] > General > Command:ssh -t m...@company.com "tmux -CC attach -t REMOTE -d || tmux -CC new-session -s REMOTE"
> The two best options for navigating among windows are...Thanks. I see that the tmux prefix character is disabled when using the integration, which makes sense if you consider the prefix character a drawback. From https://gitlab.com/gnachman/iterm2/wikis/TmuxIntegration "Some keystroke must be dedicated to tmux to enter its command mode" and "you have to learn tmux commands." are listed as drawbacks, but there are plenty of people who've made their peace with the tmux prefix character and gotten their fingers used to tmux commands. Personally I use Ctrl-L on the theory that I can use the "clear" command to clear the screen and that's worked very well for me. Anyway, what I'm trying to get to is, rather than disabling the prefix char is it possible the tmux integration could handle it and allow things like <prefix>2 to switch to tab #2 and <prefix>n to cycle right?
Side note: this particular pattern happens not to work very well with tmux integration (two -CC's is confusing to iTerm2). Consider using this instead:ssh -t m...@company.com "tmux detach -s REMOTE ; tmux -CC new-session -A -s REMOTE"
Regardless, when you run tmux -CC attach or tmux -CC new-session, there will be a session that shows text like this:** tmux mode started **Command Menu----------------------------esc Detach cleanly.X Force-quit tmux mode.L Toggle logging.C Run tmux command.So my question is what you see there when the windows disappear?
One day I plan to add prefix characters to iTerm2 in general, and then this will be a solved problem. Open Quickly is a step in that direction. But offering a separate interface to tmux that has the same keystrokes is a non-goal of tmux integration. The purpose is to provide a seamless experience. To the extent that people find tmux's particular navigation UX desirable, I'd like to make it generally available in iTerm2, but there hasn't been much demand for that except for folks who are coming to tmux integration from plain-ol-tmux so it hasn't been prioritized very high (compared to other things like support for ligatures, hotkey window improvements, etc.).
On Thursday, June 2, 2016 at 4:26:07 PM UTC-7, George Nachman wrote:Side note: this particular pattern happens not to work very well with tmux integration (two -CC's is confusing to iTerm2). Consider using this instead:ssh -t m...@company.com "tmux detach -s REMOTE ; tmux -CC new-session -A -s REMOTE"OK, I will experiment with this form.Regardless, when you run tmux -CC attach or tmux -CC new-session, there will be a session that shows text like this:** tmux mode started **Command Menu----------------------------esc Detach cleanly.X Force-quit tmux mode.L Toggle logging.C Run tmux command.So my question is what you see there when the windows disappear?After adding ServerAliveInterval=60 to the ssh command I haven't seen the windows disappear yet, so will assume that was the solution (interesting that it doesn't seem to have happened to anyone else). But to answer your question anyway, yes I see a window/tab with that text and it goes (went) away with all the other windows leaving only the empty dashboard.
One day I plan to add prefix characters to iTerm2 in general, and then this will be a solved problem. Open Quickly is a step in that direction. But offering a separate interface to tmux that has the same keystrokes is a non-goal of tmux integration. The purpose is to provide a seamless experience. To the extent that people find tmux's particular navigation UX desirable, I'd like to make it generally available in iTerm2, but there hasn't been much demand for that except for folks who are coming to tmux integration from plain-ol-tmux so it hasn't been prioritized very high (compared to other things like support for ligatures, hotkey window improvements, etc.).That's reasonable. The fact is, after a few days of getting used to it most of the pain points I was experiencing have dissipated. For instance double-clicking on a tab allows it to be renamed, which is easier than Edit > Session etc. Being able to reorder and group tabs with drag and drop is a real boon, and the fact that they automatically renumber is very niceOne thing I still miss from plain-old-tmux is the ability to use <prefix><prefix> to swap to the most recently used window. I used this heavily to swap between edit and debug windows in the same project. There doesn't seem to be a native Mac shortcut for this, which is unfortunate, but otherwise I'm getting increasingly comfortable with the integration.
A couple of minor suggestions:- When the tmux integration is configured to "open tmux windows as tabs in existing window", the dashboard still says "Open in Window" at bottom right. Wouldn't it be better to say "Open in Tab" in that case?
- Say a session has 8 tmux windows. In a new connection none of them are instantiated as iTerm2 windows/tabs and it's necessary to use the dashboard to do so. Previously I was laboriously clicking through each one and using Open in Window to instantiate it 8 times. Now I realize the full set can be selected with cmd-a and instantiated with one click, which is way better, but still: is there a configurable like "instantiate all tmux windows at connect time"?
I guess you have "Prefs>Profiles>Session>Automatically close a session when it ends" turned on, which is why the tmux gateway (the session where you ran tmux -CC) went away without you being able to see what happened.
In iTerm2, control-tab will swap between your current tab and your most-recently-used tab in the same window.
If you have a lot of windows then the dashboard opens instead of the windows. See prefs>general>open dashboard if there are more than X tmux windows. You can increase X if this is what you're doing all the time. It gets slow if you open a huge number of windows at connection time. Maybe the default limit of 10 is too low?