Live data from Hacker News

Getting Started With Screen

jamescarl.us

1–7 of 7 posts

Re: Getting Started With Screen

#4
post #2

I like to use 'screen -rd' because it detaches any existing sessions before connecting.

Of course something like "exec /usr/bin/screen -xRR" in your .bash_profile or whatever does roughly the opposite, which is also cool, because you can attach multiple devices to the same open screen session simultaneously.

I believe if its in .bash_profile you want it in a "if [ -n "$SSH_TTY"]; then stanza, it was something about scp or running commands in a ssh commandline would misbehave. One of those things you set up in you dotfiles in the 90s or whatever and forget why you did it.

Re: Getting Started With Screen

#5
post #2

I like to use 'screen -rd' because it detaches any existing sessions before connecting.

Cool thanks for the tip. I'll add it to the post do you have a link to a site you'd like me to add?

Thanks for that, but currently don't have anything released yet!

Re: Getting Started With Screen

#6
post #4
post #2

I like to use 'screen -rd' because it detaches any existing sessions before connecting.

Of course something like "exec /usr/bin/screen -xRR" in your .bash_profile or whatever does roughly the opposite, which is also cool, because you can attach multiple devices to the same open screen session simultaneously. I believe if its in .bash_profile you want it in a "if [ -n "$SSH_TTY"]; then stanza, it was something about scp or running commands in a ssh commandline would misbehave. One of those things you set…

Thanks that's interesting, I'll have to try that. I'm going to add this to the post too did you have a link you want me to add?

Re: Getting Started With Screen

#7
post #4

Earlier quoted context omitted.

Of course something like "exec /usr/bin/screen -xRR" in your .bash_profile or whatever does roughly the opposite, which is also cool, because you can attach multiple devices to the same open screen session simultaneously. I believe if its in .bash_profile you want it in a "if [ -n "$SSH_TTY"]; then stanza, it was something about scp or running commands in a ssh commandline would misbehave. One of those things you set…

Thanks that's interesting, I'll have to try that. I'm going to add this to the post too did you have a link you want me to add?

check the manpage search for options xRR it'll show up.

-x attaches to a non-detached session aka multi-display mode, stereotypical pair programming / tutorial / support use.

-RR reattach and if necessary detach (overridden by -x above) or create it (as happens on first login after a reboot) and use youngest session if multiple sessions somehow accidentally get opened.