Questions tagged [gnu-screen]

screen (GNU Screen) is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells. Before using this tag, read the "Which site is more appropriate?" section of the tag wiki.

screen (GNU Screen) is used to create virtual terminals, which run by their own when not under direct user control. This is especially useful while working with a remote system, when a disconnect can occur at any moment. In this case, the screen session will continue to execute and you may reattach a running screen later.

Screen also allows you to execute multiple commands in a single terminal without losing control over them.

One additional trick is that a single virtual screen can be used by several users simultaneously, allowing them to guide and observe actions of each other.

Which site is more appropriate?

If you intend to tag your question with this tag, consider if the question is more suitable for other Stack Exchange sites:

1022 questions
101
votes
5 answers

The GNU screen is unresponsive, seems blocked

GNU Screen seems to freeze. Unable to enter user input. I was using GNU screen and when I pressed the screen it became unresponsive. I can execute all the GNU screen commands, but can't enter user input. I don't want to kill this screen as I have…
sirus
  • 1,519
  • 2
  • 12
  • 17
88
votes
5 answers

How to send control+c from a bash script?

I'm starting a number of screens in a bash script, then running django's runserver command in each of them. I'd like to be able to programmatically stop them all as well, which requires me to send Control+c to runserver. How can I send these…
ghickman
  • 5,893
  • 9
  • 42
  • 51
86
votes
9 answers

How can I tell whether I'm in a screen?

When using screen in linux, how can I tell if I'm in a screen or not? I could do exit and I'll exit a screen if I was in one, but if I wasn't, then I'll end up closing my terminal. When doing screen -r, I could see if I have other screens attached,…
user8125
  • 915
  • 2
  • 7
  • 6
82
votes
3 answers

Run a shell script and immediately background it, however keep the ability to inspect its output

How can I run a shell script and immediately background it, however keep the ability to inspect its output any time by tailing /tmp/output.txt. It would be nice if I can foreground the process too later. P.S. It would be really cool if you can also…
77
votes
9 answers

How to copy the GNU Screen copy buffer to the clipboard?

When using GNU Screen we can work with scrollback buffer also known as "copy mode" using the Ctrl+a+[ command. In there we can copy text to the copy buffer by pressing space selecting the text and pressing space again. Is there some way to copy…
Samuel G. P.
  • 3,004
  • 2
  • 29
  • 36
74
votes
11 answers

Kill Attached Screen in Linux

I created a screen "myscreen" in linux and it stopped responding abruptly. I closed the terminal and tried to reopen it. "screen -ls" shows that the screen is Attached. I tried the following commands but nothing responds. screen -r…
Slowcoder
  • 2,060
  • 3
  • 16
  • 21
70
votes
5 answers

How to stop a screen process in linux?

I am running a script on a remote server. I ran the script in screen, however I need to stop it before it completes since I need to update the script. I can easily detach from screen, however, is there a way to kill a screen process?
David
  • 14,205
  • 20
  • 97
  • 144
68
votes
6 answers

Kill all detached screen sessions

When I execute screen -ls, I see the following. How can I kill all the detached sessions? There are screens on: 84918.ttys002.ros-mbp (Detached) 84944.ttys008.ros-mbp (Detached) 84970.ttys013.ros-mbp (Attached) …
Rose Perrone
  • 61,572
  • 58
  • 208
  • 243
60
votes
12 answers

Set screen-title from shellscript

Is it possible to set the Screen Title using a shell script? I thought about something like sending the key commands ctrl+A shift-A Name enter I searched for about an hour on how to emulate keystrokes in an shell script, but didn't find the answer.
Beerweasle
  • 1,009
  • 1
  • 12
  • 16
57
votes
6 answers

Automatically (or more easily) reconnect to a screen session after network interruption

ADDED: This question is now, I believe, subsumed by this one: Using GNU Screen completely transparently and automatically See also this related…
dreeves
  • 26,430
  • 45
  • 154
  • 229
56
votes
8 answers

How can I make GNU Screen start a new window at the CURRENT working directory?

By default, when you create a new window in GNU Screen, it will start in the directory where Screen is invoked. I want to start a new window in GNU Screen at the current working directory of the window I'm currently in. How can I do that?
Rio
  • 1,877
  • 3
  • 25
  • 25
52
votes
3 answers

Strange behavior of vim color inside screen with 256 colors

I was trying to make the syntax highlighting (with 256 colors) of vim work inside screen, which is running inside gterm. It works quite fine in the beginning. What I mean by "in the beginning" is, after I start screen, and enter vim, the colors look…
FJDU
  • 1,425
  • 2
  • 15
  • 21
46
votes
2 answers

How do I get GNU screen to read .bash_profile/.bash_rc changes?

After I make changes in .bash_rc or .bash_profile, when I start GNU screen, it doesn't recognize those changes. I can source ~/.bash_profile and it works for the current screen window I have open, but I have to do that for every screen window I…
Francis Lewis
  • 8,872
  • 9
  • 55
  • 65
43
votes
2 answers

How to search any word in linux 'screen'

I am going screen logs of devstack with following command. screen -x stack I find searching in screens very difficult. Currently I start copy mode with Ctrl A Esc and read all the logs, sometimes it is very irritating to go through all logs while…
Waqas
  • 615
  • 1
  • 8
  • 20
43
votes
1 answer

How to resume screen?

Let's say I have many screens open, and I would like to resume to a particular screen session using 'screen -r ' this is wahat i get when I execute screen -r There are several suitable screens on: 12670.pts-8.b-dev03 (Detached) 23662.pts-9.b-dev03…
Vansh Khurana
  • 657
  • 3
  • 9
  • 10
1
2
3
68 69