Skip to main content
Welcome guest. | Register | Login | Post

screen!

12 replies [Last post]
tbuitenh's picture
Offline
Joined: 2005-12-21

I just learned the basics of screen. Nice tool... The easiest explanation is that it's a terminal emulator inside your terminal, so you can manage multiple terminal sessions without logging in multiple times or opening a new xterms. If I understood correctly, you can also detach from a screen session, log out, log back in and reattach.

One really neat trick is to put this in your .xinitirc:
Terminal --geometry=128x48+62+46 -x screen -x &
(other terminal emulators might need different options, you might need to configure your font size, and maybe your console has a different size than 128x48)
The Terminal will be attached to your existing screen session, so it will show the output of startx (and everything else you were doing on the console).

By the way, Terminal needs some configuration changes to work properly with screen. Open the configuration, go to advanced. Set Backspace to control-h and delete to escape sequence.

I think we need a commandline forum next to the desktop and gui forum.

libervisco's picture
Offline
Joined: 2006-05-04

Sounds interesting. I should give it a try.

"tbuitenh" wrote:

I think we need a commandline forum next to the desktop and gui forum.

Not a bad idea. I'm still rather hesitant from adding new forums until we have much more activity to fill them up. We already have quite a few, but if others agree it will be added.

For now, everything that doesn't fit any other existing forum can be put in Misc forum. When new forums are open to cover yet uncovered topics those topics can be moved to a new forum. Smiling

In other words, it will be added, from soon to eventually, depending on needs and activity. Eye

[/offtopic]

free-zombie's picture
Offline
Joined: 2006-03-08

i have found screen to be much more efficient (and beautiful Eye ) than tabs...

supermike's picture
Offline
Joined: 2006-02-17

Screen can be handy, but I'm confused about getting used to it. Anyone want to write a howto for noobs?

tbuitenh's picture
Offline
Joined: 2005-12-21

The material is accumulated as we speak, cause I'm posting all the tricks I learn to another thread on this forum: here

basics of the basics:

all commands start with control-a, followed by another key (so don't try pressing all three of them at the same time).

Quick switch between two terminals: control-a control-a (or hold control and hit a twice)
Menu with all terminals: control-a "
Give terminal a name: control-a A
Create a new terminal: control-a c
Close a terminal: [close other programs] control-d (actually just closing the shell)
Kill a terminal: control-a k (usually not needed)
exit screen: just close all terminals
Watch a terminal for activity: control-a M
Watch a terminal for 30 seconds silence (like the end of a compilation): control-a _
Split screen (might confuse some programs): control-a S
Switch between terminals on the split screen: control-a tab
(a common sequence is control-a S control-a tab control-a c)
Back to single screen: control-a Q
(if you find an empty screen after doing this, hit control-a control-a. It's because you went back to single screen mode while in a closed terminal. It's more convenient to go back to single screen before closing a terminal if you want to do both)
Scrollback & copy: control-a [ (then use arrow keys and spacebar to make a selection)
Paste: control-a ]
Help: control-a ?
More help: control-a c man screen

Offline
Joined: 2005-12-20

How fast is screen, can you use it as a WM?

Andif you need X to run it, it would be a bit like ratpoision with a mouse right?

a thing's picture
Offline
Joined: 2005-12-20

You don't need X to run screen. It's like ratpoisin without X.

tbuitenh's picture
Offline
Joined: 2005-12-21

no X, no mouse.
And the speed... compared to what? It appears just as fast as a bare console.

AndrewB's picture
Offline
Joined: 2005-12-18
"tbuitenh" wrote:

no X, no mouse.
And the speed... compared to what? It appears just as fast as a bare console.

You can use the mouse, but you need gpm for that

Ant it is very fast, sure it is like console tho.
Personally i love just using a console Laughing

dylunio's picture
Offline
Joined: 2005-12-20

I've found screen very useful over ssh, since I can ssh into another box, start screen, start doing something like emergeing and then detach the screen, disconnect ssh and then ssh in again a few hours later and use screen -r to see how the emerge went.

dylunio

tbuitenh's picture
Offline
Joined: 2005-12-21
"AndrewB" wrote:
"tbuitenh" wrote:

no X, no mouse.
And the speed... compared to what? It appears just as fast as a bare console.

You can use the mouse, but you need gpm for that

Yeah, you can use gpm to copy text around, but this is a feature of gpm not of screen. Screen is mouse agnostic.

supermike's picture
Offline
Joined: 2006-02-17
Sharing Screen Between Users

How do you share a screen between two users?

I ssh as 'supermike' to 'queen1' server and then su to root.
My buddy ssh's as 'dimas' to 'queen1' server and his 'dimas' account is in the 'sys' group.
He typed 'screen' and then did CTRL+A and pressed the ':' character to get a prompt. He typed these commands:

multiuser on
acladd root

I then tried to attach to his screen by doing:

screen -ls

to see a list of screen IDs and then

screen -r dimas/

However, when I do 'screen -ls', I see a message that there's no sockets in /var/run/screens

tbuitenh's picture
Offline
Joined: 2005-12-21
I haven't figured it out

I haven't figured it out yet, but I did find out screen doesn't like to be combined with su. To some commands it gives different error messages, and when you try to create a session it refuses... oh wait now I tried again to rep