![]() ![]() ![]() Within that new iTerm2 window, the initial iTerm2 tab represents the single tmux window of that session. After this your iTerm2 window shows the tmux command mode, tmux creates a new session, and iTerm2 immediately creates a new iTerm2 window for that tmux session. In the iTerm2 remote login window, at the command line do: tmux -CC. Open an iTerm2 window to the remote machine via your new profile, by doing: Profiles / Pi. To configure this, go: Preferences / Profiles / + / Command.Command = "ssh pi" Once this is properly configured, you should be able to login just by doing ssh pi (supposing pi is the host name of your remote system).Ĭreate a new iTerm2 profile which, instead of doing a login to your local shell, only calls ssh pi to login to the remote machine. ssh/authorized_keys on your remote machine to configure password-less login to the remote system. Here is what worked for me, with the stable release versions as of, which are iTerm 2.1.4 on OS X 10.11.2 and tmux 1.9 on Raspbian Linux:įirst use. Now you have a native iTerm2 tmux window, which you can close at any time, and reconnect to when needed.įinally, to make life easier we can put this all into a helper function that you can add to your bashrc or zshrc: # tmux+ssh helper function with iterm integration -A makes new-session behave like attach-session if session name already exists.We can expand the command a little to create a named tmux session, create the session if it does not exist, or reconnect if the session already exists: ssh -t 'tmux -CC new -A -s tmssh' The downside of this approach is that you will get a new tmux session each time, so you will not be able to reconnect to view long-running processes (unless you remember to run tmux -CC attach). -t forces pseudo-tty allocation (allows control characters inside SSH).You can combine this with the ssh command to immediately open the native tmux window: ssh -t 'tmux -CC' ![]() This means that you have native scrolling, split screen, and copy-paste available to you. Inside an existing ssh session (assuming you are using iTerm2), you can simply run tmux -CC and a native iTerm2 window will open with tmux integration. ![]()
0 Comments
Leave a Reply. |