screen (GNU Screen) is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells.

learn more… | top users | synonyms

158
votes
11answers
47k views

Can I nohup/screen an already-started process?

I'm doing some test-runs of long-running data migration scripts, over SSH. Let's say I start running a script around 4 PM; now, 6 PM rolls around, and I'm cursing myself for not doing this all in ...
58
votes
4answers
30k views

Moving an already-running process to Screen

My office job routinely sees me connected to a Linux box via VNC. Sometimes I start a remote job on the console, and realize later that it runs much longer than expected. (Should have started that ...
49
votes
13answers
50k views

How to reconnect to a disconnected ssh session

Is there a way to connect to an ssh session that was disconnected? We are having problems with our network connection to a remote site that we are working on separately; however, in the mean time we ...
48
votes
9answers
33k views

Is it possible to detach a process from its terminal? (Or, “I should have used screen!”) [duplicate]

Possible Duplicate: Can I nohup/screen an already-started process? On Unix (specifically, Linux), I've started a job in a regular ssh->bash session. I'd like to leave work soon, but I now ...
38
votes
3answers
9k views

How to reload screenrc without restarting screen?

After modified screenrc, how to see the changes without restarting screen?
27
votes
4answers
18k views

How can I launch a screen session with a command over ssh on a remote server from my desktop?

I want to be able to launch screen sessions on remote servers from a single ssh command on my desktop. However, screen seems to need a terminal, which is not available when running a command through ...
27
votes
5answers
14k views

Sudo as different user and running screen

Found out today that running screen as a different user that I sudo into won't work! i.e. ssh bob@server # ssh into server as bob sudo su "monitor" - screen (fails) I have a script that ...
21
votes
4answers
16k views

putty and screen and scroll-back buffer [closed]

When I use screen inside a putty session, I can't seem to use the scrollback buffer of putty to look at whatever just scrolled off the screen. Instead, I just see what was happening in the putty ...
16
votes
6answers
10k views

Using ctrl-arrow keys with PuTTY and screen

I searched and couldn't find a solution for this anywhere. I'm using PuTTY from Windows to connect to various servers where I run bash and screen. It seems bash works fine with ctrl-arrow keys to ...
15
votes
3answers
7k views

Can I send some text to the STDIN of an active process running in a screen session?

I have a long-running server process inside a screen session on my Linux server. It's a bit unstable (and sadly not my software so I can't fix that!), so I want to script a nightly restart of the ...
14
votes
2answers
4k views

Why does redirecting 'script' to /dev/null/ allow 'screen' to work while su'ed as another user?

I was su'ed into a user to run a particular long running script. I wanted to use screen but I got the error message "Cannot open your terminal '/dev/pts/4' - please check." So I Googled around and ...
11
votes
4answers
2k views

How to check if I'm in screen session?

is it somehow possible to check if I'm right now in screen session? I need it to determine if hitting ctrl+d would disconnect me from server or just close current screen. Thanks.
11
votes
3answers
8k views

Reattach or create a named screen session? (or persistent screen sessions)

Basically I have a remote screen session, which I wish to automatically reattach to.. Currently I'm doing this by with the following command (as an iTerm bookmark, or an alias) ssh host -t screen -x ...
10
votes
6answers
7k views

How do I ask screen to behave like a standard bash shell?

Just learned about the screen command on linux - it is genius. I love it. However, the actual terminal/prompt in screen looks and behaves differently than my standard bash prompt. That is, the ...
10
votes
3answers
12k views

Set xterm (PuTTY) window title when using screen?

I am trying to get screen to set my xterm title. I have this working outside of screen, but screen keeps whatever title was in place when I started it. Here is my .bashrc: function ...
9
votes
2answers
239 views

Cannot reattach to a screen session after SSH connection was dropped

I have previously reattached to a long-running screen session with screen -dr control. However, sometimes this command will not reattach to the screen and instead hang forever (10+ minutes after which ...
8
votes
2answers
117 views

Is it possible in a script to tell if it is being run from within GNU screen?

We have a long running process on a remote server which is kicked off manually from time to time. Unfortunately internet connections die, kernels panic and a whole host of other challenges can be ...
8
votes
4answers
15k views

Create screen and run command without attaching

I am working on automating a maintenance routine that involves starting and stopping a script that is running in a screen session. My approach is to kill the screen session, and then restart it and ...
8
votes
2answers
3k views

How do you get TERM=screen-256color on CentOS 5.7?

CentOS 6.0 comes with the ability to set its TERM to screen-256color. It doesn't work in CentOS 5.7, though. How can you get CentOS 5.7 to support screen-256color?
7
votes
3answers
2k views

How do I prevent GNU Screen from reseting my prompt?

When I run screen it changes my prompt. How do I prevent this behaviour? For example: $ echo $PS1 \[\e]0;\h:Prod\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ $ screen $ echo $PS1 [\u@\h \W]\$ ...
6
votes
6answers
8k views

Can't get detached screen to resume

I use putty and have an unreliable wireless connection, so I use screen to keep my work going. Often I'll get disconnected, and then I can't reattach my screen. I'll run screen -D -RR and it will just ...
6
votes
3answers
9k views

kill a screen (but not all screens)

I have multiple screens running on an Ubuntu server that are initiated as: screen -dmS screen1 cmd screen -dmS screen2 cmd etc... And I need to kill one screen, but not all of them. What is the ...
6
votes
3answers
6k views

Setting $TERM for gnu screen

So I have screen compiled with 256 colors, running on Konsole in 256 color mode. If start screen, the TERM is set to "screen". If I manually export the TERM to screen-256color everything works ...
6
votes
2answers
401 views

How to know who is conected to my screen and where on the screen he is?

I use screen, and sometimes I'm forced to share it. How I can manage the active connections to my screen? I would like to monitor connections and users connected, where they are and what they do. ...
6
votes
2answers
907 views

Does tmux have all the features that screen has? And those screen is missing?

I'm considering switching from screen to tmux, but I've invested lots of time developing an extensive .screenrc, and I don't want to find after many hours of porting it to tmux that tmux can't do ...
5
votes
3answers
5k views

VMware ESXi display guest screen instead of console

I'm using ESXi 4.1 for my virtualitzation platform, and I would like to display one of the guests screen to the host VGA output. Is this possible? I want to do this because my host machine is plugged ...
5
votes
6answers
4k views

Is there any way to make “screen” session survive reboot?

The question says it all. I am using screen utility and would like to preserve the session when machine reboots. If not possible may be you can recommend other alternatives to screen that would allow ...
5
votes
4answers
4k views

Need a solution to stop students from rotating screen on laptops with intel graphics

We have some students who have figured out how to rotate the screen using either the hotkey combination or right click context menu. It's easy to fix but it's time consuming because no matter how many ...
5
votes
1answer
2k views

.screenrc - multiple regions on launch

I know it's possible, but I can't for the life of me figure out how, to launch screen with one window in split region mode? ie: I have screen set to open multiple windows on launch, but want window 0 ...
5
votes
2answers
1k views

Right aligning text in GNU Screen caption or hardstatusline

I have this in my .screenrc caption always "%{= Kw} [%0c] %-Lw%{= KW}[%50>%n%f* %t]%{= Kw}%+Lw%=| %l | ${FULLHOST}" It normally displays something like this: [01:06] 0$ vim 1$ top 2-$ tail ...
5
votes
3answers
310 views

Can I create and manipulate unix “screens” in a script?

I have a work environment on my Ubuntu laptop in which I want to use three different screens. Eg. in terminal, I usually write screen -S mywork run_server_1 then, ctrl-a c to create a second ...
5
votes
4answers
1k views

GNU Screen and Tmux: tips and tricks

So I am a big fan of the multiplexers like GNU Screen and Tmux, but even using Screen for years now I still recognize that there are many things there I don't know (and I only use Tmux for a couple of ...
4
votes
6answers
530 views

What are the benefits of using screen?

man screen: Screen is a full-screen window manager that multiplexes a physical ter‐ minal between several processes (typically interactive shells). Each virtual terminal provides the ...
4
votes
7answers
2k views

I have a perl script that is supposed to run indefinitely. It's being killed… how do I determine who or what kills it?

I run the perl script in screen (I can log in and check debug output). Nothing in the logic of the script should be capable of killing it quite this dead. I'm one of only two people with access to ...
4
votes
4answers
3k views

GNU screen loses (parts of) command histories

I use GNU screen with 5 different sessions, each of which stores its own command history. But often I don't find a command in the history, although I'm sure I've used it exactly in the session I'm ...
4
votes
2answers
55 views

screen -r spawning new prosses

I'm new to screen and I'm trying to figure out how to detach from a session and reattach later. So far I've tried: $screen C-a z (within screen to detach) $screen -r So far so good but when I C-a z ...
4
votes
5answers
435 views

Allow use of screen without ability to detach sessions

I'm wondering if this is possible. I'd like users to be able to launch screen on some of our hosts for the purpose of multiplexing their terminal login sessions. However, I don't want them to be able ...
4
votes
2answers
739 views

Why can't I attach a screen session

I've got a screen session running which I would like to :quit, but I can't because when I try to re-attach, I get an error saying it can't open my terminal. I'm sure I could kill the daemon or ...
4
votes
1answer
129 views

How to “Open a new window in GNU/Screen” by running a command?

I want to know how to accomplish this: Open a new window in GNU/screen, by running a command. Here's what I want to do: I uses GNU/screen daily. My laptop runs in UTF-8 locale, and I need to ssh to ...
4
votes
2answers
2k views

How to install screen-profiles on debian?

I have a debian server and want to use the nice screen extension "screen-profiles". I think this comes from Ubuntu. Is there a way to get it on debian and how? Thank you
4
votes
2answers
451 views

Start detached screen session

I would like to start screen detached session, but I want to evaluate some bash. It seems screen only supports an executable and binary. I want do do some magic like: screen -d -m script.sh ...
4
votes
2answers
931 views

Can a locked gnu screen session terminal be accessed?

One of the functions of GNU Screen is to lock the screen. The man page says this: lockscreen Lock this display. Call a screenlock program (/local/bin/lck or /usr/bin/lock or a builtin if ...
4
votes
2answers
1k views

Putty + Bash + Screen, up arrow for history not working (Ubuntu 11.10)

I have a fresh install of Ubuntu Server 11.10 that I am logging into SSH via PuTTy. When I am inside screen, I cannot use the up arrow to recall bash history (though this works outside of screen). I ...
3
votes
5answers
4k views

How to scroll back in screen within a ssh session from osx?

Ok, i do the following: Open Terminal.app Open a ssh session to a remote linux server Open a screen session on the server Start a program who breaks with many lines of error reporting... How can i ...
3
votes
3answers
355 views

Is is possible to reattach a telnet connection?

Our network involves a series of dumb text terminals which telnet into a SCO OpenServer 6 server. Occasionally, one of these terminals will crash, forcing the operator to move to a different terminal ...
3
votes
2answers
2k views

How to prevent screen from terminating when command in window terminates

When running 'screen ls' the screen stops with the text [screen is terminating]. I would like screen to keep the session alive and reattach to it to see the output of ls. Of course the real thing is ...
3
votes
4answers
4k views

How do I use crontab to start a screen session?

I want to create a crontab entry so that it starts screen, starts a gameserver and detaches. This is for in case the server is rebooted and I want it to automatically start this for me. 0 0 0 0 0 ...
3
votes
3answers
679 views

How to use cursor keys in vi under screen?

If you run vi/vim in screen, when you press a cursor in insert mode, you get a new line + a character, which is a pain. Configure vim to move around instead.
3
votes
3answers
471 views

How to I use Vim's increment (Control-a) when in a screen session?

Is there a way to re-map Control-a in screen to Alt-a or something else, so I can use Control-A in Vim normally (increments the number under the cursor)?
3
votes
1answer
87 views

customizing terminal ssh shell [closed]

The other day I saw someone connected to an ssh shell with status bars on the bottom (Mac OS X Terminal) of the terminal. It has things such as upload rate, memory usage, time, current username, and ...