I already have a ~/.tmux.conf file that works fine for me and is shared across multiple Linux servers. Now I would like to start using tmux on my work Windows machine for local stuff. On that front I installed cygwin, configured mintty and pulled my tmux config. Now I'm fiddling with the options to set it up in such a way as to avoid having to press the prefix-key twice when interacting with the remote server or to avoid having two almost identical status bars on top of each other.

My first idea was to create a special .tmux.conf.remote file, use source-file to import my standard tmux configuration, then continue by listing this special session's options and creating an alias that creates/attaches to this named session and loads the special remote config, something like tmux new-session -A -s remote \; source-file ~/.tmux.conf.remote.

Unfortunately, this has some limitations. It seems I cannot create session-specific key bindings. And window-options affect either only the current window or all windows across all sessions, but not all windows inside one specific session.

Can anyone suggest a better solution? Basically, I would like to interact with an existing tmux session on my server (haven't found a way to connect directly to a remote session! That would have been the best solution!). I would like to avoid having to open more than one mintty window. I don't want to be using a different shortcut to pass the prefix to the remote session (when then rather the other way around, to use a different prefix in this special session and this is already working). Any thoughts or hacks are appreciated :-)

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.