Question

I want to use GNU screen in such a way that the user doesn't know it's there. It's to help ensure that a text based management application that I'm writing can only be used by a single user at a time. To guard against against users locking everyone else out by running the application and going, leaving it running when going on holiday, I want to be able to detach their session and allow another user to attach to it.

So my questions is:

  • Can I set the escape key in .screenrc to null, so that the user can't access any of screen's functionality themselves?
Was it helpful?

Solution

It looks like the following in .screenrc does the trick:

escape ''

This does not set the escape character to ', but disables the escape mechanism entirely.

OTHER TIPS

Maybe just set the escape character in .screenrc to an obscure character from the ASCII table which cannot by typed on a keyboard. I think the character 176 would be an example (or try any other one outside the normal range):

escape ^°°

Just put it in your .screenrc file, and your users won't be able to access any screen functionality:

perl -e 'print "escape ^", chr(176), chr(176), "\n"' >> .screenrc

Preventing the user from using the functionality of Screen is bad form (unless you have a shared login which runs your application).

Instead, make your application deal with the use case you've shown by autologout, warning new connecting users and giving them the option to boot the other user, handling multiple users, etc.

instead of using screen, consider using detachtty/attachtty

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top