Multiple windows accessing same terminal prompt

1

There are numerous tools for using numerous terminal prompts from a single window, like gnu screen---but I'm wondering about the opposite. I'd like to access the same prompt from different windows. In particular, I'm using NoMachine to run a virtual desktop where there is a particular tty I'd like to access from a normal SSH session. Is there a way to attach to the same tty session from the SSH session?

DilithiumMatrix

Posted 2016-12-18T17:28:42.420

Reputation: 477

Answers

1

You can use either screen or tmux to attach to the same (remote) tty from multiple other source (client) locations.

But you might be asking how to make either screen or tmux gain control of an existing tty. I don't know how to do that, but you could re-parent an existing process (perhaps even a shell) to a tty that is owned by screen or tmux using reptyr. See one of multiple references on use of reptyr: here orhere. Others exist, I'm sure.

crimson-egret

Posted 2016-12-18T17:28:42.420

Reputation: 1 900

Kind of wondering if screen would interfere with any VI(M) shortcuts, but probably not on a basic setup – polynomial_donut – 2019-06-11T19:55:26.000

Generally not, except where the screen shortcuts overlap with any VIM key-sequences. By default, screen uses the prefix-key Ctrl-a to enter the screen command system, which messes up some things that use emacs-style key-bindings. I have in my .screenrc a line to change the prefix to Ctrl-j --- escape ^Jj – crimson-egret – 2019-06-12T19:14:55.990