Change (or disable) tmux prefix in session basis

tmux

Solution

I answer myself:

It is as easy as not specifying the `-g` modifier in the `set prefix` command.

For example, in my case that my usual prefix is tab key, to use regular Ctrl+b prefix in the current session:

[tab]:set prefix C-b

Problem

I am wondering if there is a way to temporary change tmux prefix depending on the active session. I manage multiple sessions with tmux to work in different tasks or projects in my local desktop. But I sometimes need to work on remote systems where it is also useful to open multiple panes, windows or even distinct sessions. Opening a remote tmux session inside my local tmux works fine, but I need to press the prefix key twice (I have a map to send itself on double press) every time I want to issue a (remote) tmux command. This is very annoying because most times I end up sending it to my local tmux unintentionally. If I could change local prefix only for a given session (or, at least, while that session is active) it would be wonderful. Temporary disabling it also could be enought because I can define an alternate prefix to use it only when my primary one is disabled. Any suggestion will be welcomed.

Original source

Related problems