Hacker News new | past | comments | ask | show | jobs | submit login

    > you could just add a "/bin/screen -DR; exit" to your 
    > remote .bashrc and the screen integration would be 
    > completely invisible after the initial instantiation.
The problem is making all of those initial instantiations every time my connection is interrupted.



You only make the initial instantiation once.

- SSH to remote

- on remote, run "screen"

- get disconnected from remote

- SSH to remote, .bashrc runs "screen -DR" and you resume from where you left off

You only have to create the initial screen session once, and it persists until you explicitly shut it down or restart the remote machine.


Huh. I certainly don't remember step 4 from my time of using screen. Is it a new feature or an option I didn't know about or something?

And what happens if I want to have two terminal tabs on my end logged into the same remote machine? (Which is basically 100% of the time for me.) It seems like that would be a case where mosh would be much smoother...

(Disclaimer: Once upon a time I used screen, but I stopped ages ago. mosh is intriguing, but as long as I'm working from home just plain vanilla ssh is all I really need...)


The ability to detach and re-attach to screen has been there since day one... that's probably one of the largest reasons most people use it. Terminal software these days can handle multiple sessions just fine - the benefit is being able to detach and re-attach.

Multiple terminals in one session was more critical back when we were using dumb terminals and whatnot - where you couldn't multiplex locally.


Just so it's clear, I meant specifically the '.bashrc runs "screen -DR"' part, ie automatically going back into the screen rather than needing to explicitly run screen -DR like I used to. (I don't seem to be able to edit my original comment at the moment.)


That's not something screen-specific. You can put whatever you want into .bashrc and it will be automatically run each time you open a new shell. pseudonym just suggested you could use it to automatically run a screen command.


The detach/reattach functionality has always been a part of screen. It's called "multiplexing" (whence tmux gets its name).


> what happens if I want to have two terminal tabs on my end logged into the same remote machine

Don't do that. Open a new window in your screen instead.

Then start giving windows descriptive names. Then start giving them automatic names. Marvel at most fast you've gotten using the window selector (with type-ahead-find).


> And what happens if I want to have two terminal tabs on my end logged into the same remote machine? (Which is basically 100% of the time for me.) It seems like that would be a case where mosh would be much smoother...

You can use 'screen -x' to attach multiple times to the same session.


With mosh, I don't have to SSH to remote after I'm disconnected. That's what I was referring to.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: