Is there a tmux faster way to go read just?

I've been making use of screen for several years currently as a means of making certain that any kind of remote job is securely maintained open in after disconnects/crashes. Actually, as an issue of training course, I make use of displays also when functioning in your area.

Lately, my needs have actually proceeded to the phase that I switched over to tmux as a result of the elegance of:

tmux attach -r

Attaching to my very own sessions in readonly setting (- r) suggests that I do not need to bother with mistakenly:

  • pasting lines of waste in IRC
  • stopping a vital compile/deploy procedure
  • keying a password completely sight for passersby

Of training course the concern is that I need to open a session, C - b+d to detach, and afterwards resume it with the - r flag to go readonly. And afterwards, when I periodically intend to chip in to an IRC discussion, disturb a job or anything else, I need to detach once more and also reconnect generally.

Does any person recognize of a means to make a key binding to switch over in between settings?

2019-05-18 23:27:27
Source Share
Answers: 1

Not according to the man page, which just calls out the attach -r alternative to enable read - just setting.

Additionally, in the source code, just the adhering to line in cmd-attach-session.c establishes the read just flag. The remainder of the code checks whether this flag is set, yet does not transform its value. So once more, it resembles you run out good luck unless you can make (or demand) a code adjustment:

    if (cmd_check_flag(data->chflags, 'r'))
        ctx->cmdclient->flags |= CLIENT_READONLY;
2019-05-21 09:36:48