4 ms·
> mkfifo hello; script -f hello > This command will allow you to share your terminal session in real time. Using `script` for this seems nice for when you don
by jolmg 6y ago
> mkfifo hello; script -f hello
> This command will allow you to share your terminal session in real time.
Using `script` for this seems nice for when you don't want them to be able to control the same computer. Like person foo on their computer would
nc -l 9000
then you could
script -f >(nc foo 9000)
to show them your session. One could also add some encryption to the pipe.
If both controlling the same computer is not a problem or is even desired, then it's probably simplest to just share a tmux session. One runs `tmux` and the other `tmux a`.
- ansible 6y agoNeat trick with the named pipe and the script command. Note that visual editors (and anything else like ls that are aware of the terminal size) will not work well unless all terminal windows are the exact same size. And type, obviously.
- jolmg 6y agoAnd even then there might be issues. emacs' line numbers don't update correctly for one. At least for vim and htop, having a larger terminal window doesn't seem to be a problem as far as I can see.
- spurgu 6y ago> One runs `tmux` and the other `tmux a`. Here's how to do this with screen instead of tmux. Terminal 1: screen -mS hello # create screen named "hello" Terminal 2: screen -x hello # attach to shared screen
- jolmg 6y agoJust Terminal 1: screen Terminal 2: screen -x seems to be enough, too.
- spurgu 6y agoYes, but it gets confusing if you already have previous screens running (-x opens the right one if you only have one) so I provided a more "foolproof" version. I always use named screens since it's quicker and more organized than typing `screen -ls` before every time and then making a decision on whether or not to name the new one (I still think it's better to name the first one in any case in the vast majority of (my) cases).