I've been using screen for years now as a way of ensuring that any remote work is safely kept open in after disconnects/crashes. In fact, as a matter of course, I use screens even when working locally.
Recently, my requirements have progressed to the stage that I switched to tmux because of the beauty of:
tmux attach -r
Attaching to my own sessions in readonly mode (-r) means that I don't have to worry about accidentally:
- pasting lines of garbage in IRC
- halting an important compile/deploy process
- typing a password in full view for passersby
Of course the issue is that I have to open a session, C-b + d to detach, and then reopen it with the -r flag to go readonly. And then, when I occasionally want to chime in to an IRC conversation, interrupt a task or anything else, I have to detach again and reconnect normally.
Does anyone know of a way to make a key binding to switch between modes?