screen (GNU Screen) is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells). For computer monitors, see the tag [monitors].

learn more… | top users | synonyms (1)

113
votes
10answers
23k views

tmux vs. GNU Screen

Browsing through questions I found about tmux (I normally used GNU Screen). My question is what are pros and cons of each of them. Especially I couldn't find much about tmux.
64
votes
4answers
18k views

Moving tmux window to pane

How do I move an existing window into a pane in another window in tmux when I have multiple windows, and vice versa? I'm coming from screen, where I can switch to the pane and then switch windows ...
60
votes
8answers
21k views

How can I disown a running process and associate it to a new screen shell?

I have a running program on a SSH shell. I want to pause it and be able to unpause its execution when I come back. One way I thought of doing that was to transfer its ownership to a screen shell, ...
60
votes
6answers
18k views

Keep SSH Sessions running after disconnection

I sometimes have long running processes that I want to kick off before going home, so I create a SSH session to the server to start the process, but then I want to close my laptop and go home and ...
58
votes
6answers
54k views

How to split the terminal into more than one “view”?

From vi, if you issue the command :sp, the screen splits into two "views", allowing you to edit more than one file from the same terminal. Along those same lines, is there a way to have multiple ...
43
votes
2answers
8k views

How do you detach the 2nd screen from within another screen?

I've accidentally attached to a 2nd GNU screen session from within an existing screen session and cannot detach or issue commands to the inner screen. I remember figuring out how to do that before but ...
22
votes
4answers
5k views

Can mouse wheel scrolling work in a /usr/bin/screen session?

Is there any way to use the mouse wheel to scroll through the output of a screen session? I can use the keypad scroll through previous output in screen after pressing ctrl+a [. Is it possible to do ...
19
votes
4answers
5k views

How can you change the GNU screen status line based on hostname?

I have a shared home directory that is automounted via NFS on all the UNIX servers I log in to. I would like to have a single .screenrc that (for example) puts the hostname in the hardstatus line in a ...
19
votes
3answers
6k views

Is there an equivalent of GNU Screen's “log” command in tmux?

I make heavy use of screen's "log" command to log the output of a session to a file, when I am making changes in a given environment. I searched through tmux's man page, but couldn't find an ...
18
votes
1answer
22k views

How to recover a 'lost' screen session?

Somehow I managed to close a screen window without screen 'noticing' it, so the session is still flagged as attached. This prevents me from re-attaching to this session. What can I do? ...
17
votes
3answers
4k views

Shell: how to go to the beginning of line when you are inside a screen?

I am inside a screen (screen -Ra). I have a long command, and I am at the end. Instead of keeping the left arrow, how can you go to the beginning of the line? CTRL-A works when I am in a normal ...
17
votes
3answers
1k views

Is it secure to leave a root shell running in detached screen session?

I'm curious about the security of leaving a root shell running inside a detached screen session. I typically never do this. Aside from the potential of my non-root user account being compromised ...
16
votes
4answers
5k views

Save complete GNU screen session state

Is it possible to persist the "state" of a GNU screen window (or just a standard shell) so that I can reload everything after a reboot: The number of opened shells The name of each shell The current ...
15
votes
1answer
4k views

GNU Screen: new window name change

I can change the name of a window with Ctrl-a Shift-a. Instead of editing several window names by hand, is there a way to have them automatically named after the current directory?
13
votes
8answers
564 views

Suggested setup for an ultra-lightweight text-based programming environment in linux

I am looking for suggestions for a setup for my particular needs. I haven't done much linux since college and want to get back into it as a hobby. I have some not-too-powerful hardware (512 MB ram, ...
12
votes
1answer
1k views

How do you make tmux count windows starting with 1 instead of 0?

I was able to make GNU Screen start counting windows with the number 1 instead of the default 0 with this code in my .screenrc: # Get rid of screen 0 bind c screen 1 bind ^c screen 1 bind 0 select 10 ...
11
votes
8answers
973 views

Is screen useful?

When I need to open different processes or terminals that I need to check, I just open a new tab in my terminal and use different workspaces in my machine to keep everything organized. I do some web ...
10
votes
2answers
10k views

How can I switch between ttys without using screen?

So lets say you boot up your linux install all the way to the desktop. You start up a gnome-terminal/konsole/whatever so you have a tty to enter commands to. Now lets say I SSH into that same ...
9
votes
4answers
17k views

How to split window vertically in GNU Screen?

I saw some body split their window to 2x2, I just want to know how to do that? I know the 'split' command in Screen can only split the window horizontally.
9
votes
2answers
4k views

How do I cycle through panes inside a window in tmux like in screen?

I thought Tmux - move window to pane was the same question but it doesn't seem to be. Coming from using GNU screen regularly, I'm looking for tmux to do the same things. On of the things I do ...
9
votes
2answers
5k views

How to get the output inside `screen` out to a script?

I have a screen instance running (a lot more actually, but only one that matters), and I would need to execute some code inside the screen, and get the result out to my script. The first part is ...
9
votes
2answers
639 views

Prevent GNU Screen from closing

Is there any way to make GNU Screen not close if I end all its subprocesses? Ideally, it would create a new window running a shell if I accidentally closed the last window.
9
votes
2answers
965 views

Clearing GNU Screen after full-screen application

When working at a normal xterm (not sure about a "real" terminal), when a full-screen program such as man or vim is closed, it disappears, leaving your screen so you can see your prompt, and previous ...
9
votes
1answer
474 views

Redirect linux console on boot

Is it possible on boot to redirect the console output to a screen session? The server has no monitor attached, and I'd like to be able to see the primary console output. I've seen other posts about ...
8
votes
2answers
2k views

GNU Screen for X11 Forwarding

I'm using X11 forwarding over ssh to run Linux apps on my Windows box, and when the network drops the lose everything that was running. Is there anything similar to screen for X11?
8
votes
4answers
977 views

Can I easily search my history across many screen windows?

My current screen session has 12 open windows on it. It's been running for weeks... I know I executed an ImageMagick convert command in one of these 12 screen windows sometime last week... is there ...
8
votes
1answer
3k views

Sending input to a screen session from outside

My scenario is this: I have a screen session running in a remote location. Inside this screen is a consoled-based program. When run without screen, this program starts in the terminal and accepts ...
8
votes
1answer
260 views

Can a program detect it is running in a detached screen?

I am running an interactive curses program in a screen session on quite weak hardware. Most of the time, the screen is detached. Is there a way for this program to detect this situation, and basically ...
8
votes
1answer
1k views

screen + vim — Any way to automatically set screen window name to open vim filename?

I have a pretty nice screen rc file that shows me the open screen windows almost like tabs at the bottom of the terminal. Currently the windows are named according to my prompt which is not so useful. ...
8
votes
1answer
723 views

Why am I getting 'Name collision between …' errors and how can I fix them?

Every time I try to launch vim or emacs or even top (I think it's actually any command that uses ncurses) in a unix terminal (on a cluster computer over ssh), I get a a continuous stream of 'Name ...
8
votes
1answer
1k views

How can I change screen's hardstatus color based on the logged in user?

I haven't edited/created a .screenrc file in a while, but this is what I'm currently using: # Turn off the screen startup message startup_message off # Define format of bottom ...
7
votes
3answers
7k views

sending text input to a detached screen

I'm trying to run a minecraft server on my unRAID server. The server will run in the shell, and then sit there waiting for input. To stop it, I need to type 'stop' and press enter, and then it'll ...
7
votes
3answers
1k views

Does a terminal multiplexer have any benefit when used with a tiling window manager?

Both terminal multiplexers (screen, tmux) and keyboard-driven tiling window managers (ratpoison, dwm, xmonad) provide similar functionality. Is there any benefit in using both at the same time? What ...
7
votes
2answers
615 views

how to output text to both screen and file inside a shell script?

Currently I have a shell script which logs messages to a log file like this: log_file="/some/dir/log_file.log" echo "some text" >> $log_file do_some_command echo "more text" >> $log_file ...
7
votes
2answers
2k views

Force title on GNU screen

By default, the title of a screen session is the name of the last command entered, which is fine for me, but in some cases I'd like to change it. I know the command Ctrl-A A, but it only changes the ...
7
votes
1answer
1k views

GNU screen: move between regions

I've started splitting window in GNU screen into different regions - rather than switching between windows. Anyway, having split a window into 4 regions (2x2) it takes 3 C-a <Tab> to return ...
7
votes
1answer
2k views

Nested ssh session inside screen has no color

I am attempting to keep a nested ssh session inside of a byobu/screen window, which I also connect to over SSH with Putty on Windows. However the nested SSH session has no color. Here's what I'm ...
7
votes
1answer
382 views

Display screen caption on the first line of the terminal

When I start a new terminal, the prompt is on the first line. After working for a while (or running a command which produces some output), the prompt is on the last line. There it'll stay during the ...
7
votes
1answer
533 views

Screen cuts off beginning of long command when accessed through bash history

I'm using the default versions of bash and screen in OS X Lion. When I'm in a screen session and I scroll back through the bash history and I come to a command that is long enough to wrap. I might ...
6
votes
5answers
2k views

How to effectively use screen and SSH?

I'd like to configure SSH and screen such that a login will always reattach to a screen session. Ideally, that session would not quit but detach when I press C-d. How can this be achieved? And what ...
6
votes
3answers
2k views

Attach multiple times to a single screen session

I've been using screen -dRaA -S x to open up a single session between different workstations as I move about. Handy. Is it possible to connect multiple times to a single session, though, without ...
6
votes
4answers
3k views

Is there a tmux equivalent of “screen -D -R”

I would like to know if there is a way to get tmux to behave like screen -D -R so I could say, have the command as a default command in Putty. These screen switches would force detach of an existing ...
6
votes
3answers
3k views

nohup vs. Screen

In the past, I've used nohup to run big background jobs, but I've noticed that a lot of people use Screen in this context. Does Screen provide some kind of functional advantage that I am unaware of, ...
6
votes
1answer
1k views

How do I highlight a search result in tmux?

When I search a terminal window in tmux, it sets the cursor the keyword search, but doesn't highlight the matching word. Screen used to do this, and it was much easier to visually find a match. ...
6
votes
2answers
2k views

How to make screen -R attach to the youngest detached session?

I'm using screen on debian lenny, and I would like to use the -R option. From man screen: -R attempts to resume the youngest (in terms of creation time) detached screen session it ...
6
votes
3answers
506 views

How to tell if terminal session is running within screen

When running a bash script, I would like to be able to tell if it is running within a screen. Is this possible? I want this so that .bashrc can set the colour of the command prompt depending on ...
6
votes
1answer
2k views

Force GNU screen to reflow to current terminal width on reattach?

I would like to force GNU screen to reflow to the existing terminal width when I reattach a session. It seems to me this worked properly before I upgraded a machine to CentOS 6, but I cannot figure ...
6
votes
1answer
686 views

Is there a way to show previous messages in screen?

When I use screen I can only see the current data on the terminal (commands, messages, etc.). Is there a way, apart from printing anything I want to a file, to see the previous messages (the same ...
6
votes
2answers
2k views

Why is screen seemingly doing nothing with commands passed with -X?

I've been trying to set up an automated backup system for a minecraft server, and I'm having trouble with screen, specifically when using 'screen -r sessionname -X "/var/minecraft/somebatchfile"', ...
6
votes
1answer
304 views

Screen, remote login failure, and disappearing text

When in a screen session via ssh, if I attempt to connect to another host via scp or ssh and the auth fails, any subsequent text I type in the terminal will not be displayed, however it is being ...