I would like to persist a tmux session (via integration) for my hotkey window.
This would be useful when upgrading iTerm2, as environments in hotkey tabs would persist through iTerm restart.
Just think of the possibilities when running in conjunction with something like tmuxinator... htop tab, some standard mosh targets, so on an so forth all from a login item...
This would also require the tmux -CC session to not open a new window.
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
I think you missed the core feature here... I want tmux integration for my hotkey window, not just for session restoration. I generally run a tmux session there, but I would like all the benefits of tmux integration (tabs representing windows, panes working seamlessly).
Right now you can't even drag and drop a iTerm2+tmux tab into the the hotkey window. Perhaps there is a work around in which I can create my own hotkey profile?
I see...so if tmux -CC opened tmux tabs in the same window (and maybe hid the originating tab) then I think that would do what you need. That's something I want to do very much but I haven't figured out exactly what to do with the session that started it all.
Whats the status on this? The only way I interact with iTerm is by first accessing the window with the hot key. But cant get tmux integration to work via the hot key window. Any workaround?
I'm willing to add this to the 3.1 milestone but the key question is how to best bind a hotkey to a particular session. Ideally it would be persistent, which implies modifying your .tmux.conf file. To rein in complexity, the hotkey should not be bound to a particular tmux window, but to the session itself. When you press the hotkey, the frontmost window in that session should be ordered in.
I propose this workflow:
Add a menu item Shell > tmux > Session Hotkey
When you select it, you can set or change the hotkey for this session
The window for this includes some text like this:
Add the following line to .tmux.conf to make this setting permanent:
set -g @hotkeys session1=0x0010-0x0041,session2=0x0011=0x005e
@alexisvincent Weird, that works for me. Would you mind filing a new issue (iterm2.com/bugs and create a debuglog and attach your prefs file as described in the bug template? Thanks.
I am currently trying to follow the results in this PR and I have been semi successful. What I have done so far:
Set up hotkey window (works fine)
Configured tmux iterm2 integration to open the tmux windows within the current windows using native tabs
Run tmux -CC attach in my hotkey window
This leaves me with multiple issues:
as soon as I run tmux -CC attach the hotkey window does not seem to use the full screen width anymore, on the left side there is a small space between the edge of the screen and the terminal window which I don't usually see and on the right side the size of the window is correct, although iTerm only seems to allocate a portion of the space to actual terminals and leaves the rest white(?); this seems to only apply to the tmux tabs though, the tab running tmux -CC attach seems to use the full width.
There seem to be multiple clients with different dimensions attached to tmux although I am only running tmux -CC attach in the hotkey window and nowhere else.
Due to the fact that I open tmux in the same window the window numbers are off, with the tmux -CC attach tabs using the first number, there does not seem to be a way to hide it. Do you think there is a workaround here or something I can do to mitigate it?
There does not seem to be a way to send a command to a specific window/tab of tmux? I'd like to re-distribute the panes evenly, which in tmux I can do using :select-layout even-horizontal, but I don't see a way to do this in iterm2 tmux?
On the other hand I have to say the scrolling, copy paste, tabs, panes and so on integration is amazing, since I have found out that this is possible, I really don't want to live without it anymore! So any help would be appreciated!
I am currently running iTerm2 Build 3.0.10 and tmux 2.2 (from homebrew) on the macOS Sierra GM.
Looking forward to any ideas or inputs. If I can supply anything, like logs, config files or similar, please let me know!
Okay, I take some of that back, there seem to have been some abandoned clients running somewhere and by killing them I managed to fix some of the issues. I am still seeing the following issues though:
a small border on the right side, which for some tabs is wider and for some narrower
I am unable to use my original tmux shortcut to run commands and so son
the tmux -CC attach tab that I am unable to get rid of
The small border is there because the content can't fill the window completely due to limitations of how tmux works.
Regarding tmux shortcuts, one of the goals of the tmux integration is to use iTerm2's keyboard shortcuts rather than tmux's, so they are not supported.
Regarding the tab you can't get rid of, can you provide a debug log where you try to get rid of it but it doesn't go away? Instructions on creating a debug log are here: https://iterm2.com/debuglog