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].
84
votes
9answers
13k 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.
45
votes
4answers
10k views
Tmux - move window to pane
How do I move an existing window into a pane in another window in tmux when I have multiple windows? And vise versa?
I'm coming from screen, where I can switch to the pane and then switch windows ...
43
votes
6answers
10k 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 ...
34
votes
6answers
24k 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 ...
33
votes
6answers
10k 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, ...
30
votes
2answers
4k 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 ...
17
votes
4answers
3k 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 ...
16
votes
3answers
744 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 ...
15
votes
4answers
3k 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 ...
15
votes
3answers
4k 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 ...
13
votes
8answers
470 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, ...
13
votes
1answer
3k 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?
12
votes
4answers
3k 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 ...
11
votes
8answers
891 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 ...
9
votes
2answers
2k 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 ...
9
votes
2answers
399 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
1answer
300 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
828 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 ...
8
votes
1answer
7k 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?
...
8
votes
1answer
454 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 ...
7
votes
2answers
5k 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 ...
7
votes
4answers
761 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 ...
7
votes
1answer
2k 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 ...
7
votes
1answer
121 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 ...
7
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. ...
7
votes
1answer
353 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
2answers
2k 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 ...
6
votes
1answer
363 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
1k 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 ...
6
votes
1answer
225 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 ...
6
votes
1answer
3k views
How do i bind to Shift+arrow in tmux?
I'm looking at tmux from screen, and have hit a bump while configuring the (highly configurable!) tmux key bindings.
Problem is, in my .screenrc i have
bindkey ^[[d prev
bindkey ^[[c next
bindkey ...
6
votes
2answers
194 views
Concatenate two screen sessions
Because of some server issues I ended up with two screen sessions, each with a few windows. I have long-running tasks in both sessions and don’t want to abort one of them just to get rid of one of the ...
6
votes
1answer
194 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 ...
6
votes
1answer
1k 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 ...
6
votes
1answer
341 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 ...
5
votes
3answers
666 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 ...
5
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?
5
votes
3answers
1k 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, ...
5
votes
2answers
1k 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 ...
5
votes
1answer
407 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
...
5
votes
3answers
662 views
Why `> my.log 2>&1 &` causes the job to sustain log out?
I use
myscript > my.log 2>&1 &
to run a script and collect it's output - so that when I logout - the script will still be running. It I were to start it with myscript & - it will ...
5
votes
2answers
1k 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"', ...
5
votes
2answers
2k views
Connect to byobu screen session and execute command?
In a script I am building I'm experimenting with how to automate as much as possible. One of the more interesting challenges is to connect to a byobu screen session and execute a command.
So I ...
5
votes
2answers
8k views
Increasing Screen Size/Resolution on a VirtualBox Instance of Centos
I have VirtualBox instance of Centos 5. The screen size is quite small (800*600) and I'd like to increase it to 1280*1080. Under the Gnome preferences for "Screen Resolution" I only get the option for ...
5
votes
1answer
839 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 ...
5
votes
2answers
270 views
emacs colors based on $TERM environment variable
I want to know if it is possible to make emacs, when running in a gnu screen or tmux session, use the same colors as when TERM=xterm. In a gnu screen or tmux session, TERM=screen and emacs uses a ...
4
votes
3answers
7k 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.
4
votes
4answers
1k 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 ...
4
votes
3answers
1k 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 ...
4
votes
2answers
1k views
Convert gnu screen status line to tmux status line
I am using the following screen status line, configured in my screenrc:
I configured it using the following line:
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= ...