Questions tagged [gnu-screen]

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.

Filter by
Sorted by
Tagged with
8
votes
3answers
4k 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 ...
8
votes
2answers
13k views

Find out screen id

I want to start a program with SSH using PHP, which works fine, but now I want to kill the screen with PHP, but the only thing I know is the name of the screen. How do I find out the screen ID (...
8
votes
2answers
6k views

Byobu/screen constantly freezes in Putty

For a while now I've been using Byobu to manage screen sessions for me. However I've run into a strange issue: The session keeps locking. By locking I mean that I can't type anything, and only if I ...
8
votes
1answer
2k views

Running several commands in a screen-split

I have a few long running commands that I would like to run together in the same screen (same tab in the terminal app). My current setup is like this: tmux new-session -d 'cmd1' tmux split-window '...
8
votes
2answers
14k views

How can I start a 'screen' session as non-root user

Is there a way I can open a new 'screen' session on my RHEL box as a non-root user? When I try to open a new screen using the 'screen' command as a non-root user, it fails and I get the following ...
8
votes
1answer
5k views

Can screen add nl (new-line) for each (carriage-return)

Edited: I have data acquisition hardware that sends out serial data via UART into FTDI (serial to USB) device. The FTDI is plugged into USB port and its port name is /dev/ttyUSB0. This device ...
8
votes
1answer
1k 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 ...
8
votes
1answer
690 views

Have screen indicate there is a bell/alert with entire status bar

I am wondering if anyone knows a way to have the entire status bar in screen change when there is a bell alert inside a screen session. Internally at my company we use jabber, and being that I work ...
8
votes
1answer
2k 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 navigation/status/date/...
8
votes
1answer
3k views

dynamically generated logfile in screenrc shown in hardstatus

I want to use a combination of the date and time at startup as filename for GNU screen's logfile. In screenrc, if I put logfile '~/log/screen_%H_%m%d%Y_%0c-%t.%n' I get a dynamically generated file, ...
7
votes
4answers
21k views

Keeping a process running on server even SSH is closed [duplicate]

I am running long program on server, which is basically Jar file of java program. I want to keep this program running even if SSH terminal is closed, how I can keep this program running on server?
7
votes
3answers
15k views

How can I save the output of a detached screen with script?

I have a Python script test.py that only contains: print('hi'). I want to run it in a screen so that the output of the screen is saved by script. I use the following command to run test.py in a ...
7
votes
3answers
13k views

ssh from screen leads to unknown terminal error

I'm trying to make an ssh connection (via lsh) from one Ubuntu host to another from within screen. If I try to run mc right after that I get the following error: Unknown terminal: screen-256color-s ...
7
votes
3answers
8k views

Increase buffer size while running screen

I use screen as my window manager through putty. Screen has been great, but I need a way to increase my buffer when I run commands. I have no buffer when I scroll up, no std out is saved beyond my ...
7
votes
1answer
9k views

How does 'screen' impact environment variables?

I noticed a difference in 'env' before and after a 'screen' call, is there any additional clarity on what gets called (for setting environment variables)? I couldn't see any clear explanation from ...
7
votes
1answer
4k views

Problems with automatically starting screen on SSH login

I'm looking at http://taint.org/wk/RemoteLoginAutoScreen to setup my server so it autostarts a screen session when I login via SSH. I have added the following to my .bashrc: # Auto-screen invocation....
7
votes
3answers
1k views

systemd service that needs .ssh/id_dsa password

I have a systemctl service that starts a process smd-loop in a screen session. This process requires acces to remote SSH sources (for syncing purposes) and thus needs to be able to access my id_dsa ...
7
votes
2answers
5k 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"', ...
7
votes
1answer
516 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 ...
7
votes
1answer
1k views

Identify in which screen instance a process is running

A process listening on port 8113 (Solr) is not responding. I've found its PID via netstat but the server has about two dozen Solr process running in various screen sessions. 3607.foobar-client2 (12/...
7
votes
1answer
18k views

How to access screen created by other users?

I login as root and can not see the screen created by other others using screen -ls. I think the root user could have way to access those screen, but I can't find useful options of screen: Use: ...
7
votes
1answer
26k views

Linux - Sending a command to a screen through a shell script? [duplicate]

I'm trying to figure out how to make a script that will be able to send commands to a screen that will execute within whatever the screen is doing. Is this possible, and if so, how is it done? I've ...
7
votes
1answer
900 views

Is it possible to merge two screen sessions chained?

Let us imagine I have only one terminal. To overcome this trouble I use screen, so happy! However, I need to connect to another computer over ssh, to prevent to open several connections I want to run ...
7
votes
1answer
7k views

What's the difference between a screen being attached and detached?

[blah]$ screen -ls There are screens on: 16517.pts-0.blah (01/28/2012 01:55:32 PM) (Detached) 4345.pts-1.blah (01/27/2012 11:22:48 AM) (Attached) 2 Sockets in /...
7
votes
2answers
467 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 ...
7
votes
1answer
4k 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
659 views

GNU screen split: how to show active pane in caption

I am using GNU screen with a horizontal split, but it is not always easy to decide which pane is active (e.g. when using a program like top in one of the panes). Is it possible to change the color of ...
7
votes
2answers
2k views

GNU Screen makes Vim ESC key slow

Screen makes my ESC key wait for more commands I believe, and if it does not get those commands, it sends it to my terminal session (which I am running VIM in). ESC is used a lot in VIM and ...
7
votes
1answer
177 views

How do I use the “screen” command if I don't know what the ps or tty the program came from?

I am making a python program that launches on bootup. I would like it so that I can interact with that program via the "screen" command. Then, if I need to talk to the program via a different tty, ssh,...
7
votes
2answers
676 views

Execute a process in the current pane, redirecting stdio to/from the pane

GNU Screen has a command called exec that will launch a subprocess and optionally let you do things with its file descriptors, including tying them in your window. I frequently use :exec !! sx -b /tmp/...
6
votes
1answer
5k views

How to scroll inside a screen session of an ssh connection?

I ssh-connect an ubuntu server from an ubuntu client machine. And resume my screen session by running screen -d -r name. I'm not able to scroll inside the screen session. I created my screen session ...
6
votes
4answers
10k views

Killing multiple GNU screen sessions with the same name

Sometimes my script bugs out and multiple screen sessions with the same name get created. Is there a way to kill all of these with this name in one command? Rx:/scripts# screen -S haydoz-script -X ...
6
votes
2answers
5k views

Kill disconnected SSH session running in `screen`

I'm always forgetting to logoff when ssh-ing somewhere. After I reopen my notebook, a screen window with this running ssh is unresponsive. I have to create another window, $ killall ssh, and only then ...
6
votes
2answers
8k views

run two commands in screen detached

I am trying to download a file with wget but in background and inside a screen that detaches ... My initial command was: wget http://www.example.com/file.zip -O temp/file.zip; mv temp/file.zip ...
6
votes
2answers
10k views

Log output of GNU screen in real time?

I'm trying to get the output of a GNU Screen to a log file in real time. I've tried using tee, but that appears to not work with screen. The log function for screen will not work for this as it is not ...
6
votes
3answers
4k 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 ...
6
votes
1answer
1k views

Blink tmux instead of sound

Today I finally decided to reinstall OS on my home server from CentOS 5 to CentOS 7. Along with that, I decided to try tmux instead of screen that I was using for ages. I was able to reconfigure its ...
6
votes
2answers
549 views

How to send command output to GNU Screen's copy mode buffer

Is there a way to send the output of a command to a GNU Screen's copy mode buffer. I'd like to type something like this: $ echo 'this is an example' | screen_send_to_copy_mode or, maybe C-a Some ...
6
votes
1answer
7k views

Corrupted gnu-screen session not displaying UTF-8 correctly

(Edited to clarify the role of Emacs in the problem with the display.) My current gnu-screen session has gotten corrupted somehow, and Emacs fails to display UTF-8 characters properly. I've ...
6
votes
1answer
2k views

Make screen work like a terminal (scrolling + alternate screen) [duplicate]

I would like to use screen (from GNOME Terminal, via ssh) like I use GNOME Terminal without screen, or as close as possible to that. Specifically: In GNOME Terminal, I can scroll back using the mouse ...
6
votes
2answers
393 views

launching screen clears x11 clipboard

Every time I launch screen(1), it clears my X11 clipboard. This is incredibly frustrating. I assume there's some default setting I can disable? I haven't been able to find it yet. Using gnome ...
6
votes
2answers
191 views

How can I use the output of a command without using the mouse?

Imagine you issued a find command and now you want to use one line of the resulting output as an argument. $ find .. fileA fileB $ vi <CURSOR> # now do what to achive: $ vi fileB ...
6
votes
1answer
2k views

screen & xterm: how to select text with the mouse in one only pane when window is divided vertically

Interestingly enough, this has also been a tmux issue for some: http://daemonforums.org/showthread.php?t=7311 But currently I am sticking to screen, and I'd like to know how I can make screen "behave"...
6
votes
3answers
5k views

How do I start a screen session using an upstart job with a non privileged user?

I am trying to create an Upstart job that starts a new screen session on boot, in which I would like to automatically start a java executable. Here is the .conf file I am currently trying to get to ...
6
votes
2answers
1k views

How to write a shell script to run multiple command in different screen sessions?

My goal is to write a zsh script in order to create multiple screen sessions and run separate commands on each of them. I would also like to check at the beginning of my script if there are any ...
5
votes
8answers
2k views

awk or sed command to match regex at specific line, exit true if success, false otherwise

I need to determine if a file contains a certain regex at a certain line and to return true (exit 0) if found, and otherwise false. Maybe I'm overthinking this, but my attempts proved a tad unwieldy. ...
5
votes
4answers
6k views

Cannot execute command at GNU screen startup

I want to do something similar to what's written here without using zsh (I use bash), but if I try to start screen with screen 'cd /home/cataldo/Programs' I get the following error: Cannot exec '...
5
votes
3answers
2k views

Starting screen without welcome screen

Running screen I see this: How can I start screen directly, without this welcome screen?
5
votes
1answer
589 views

Using GNU screen, I get raw prompt with backslashes

When I use the screen program, the prompt doesn't get interpreted and is just the following: \u@\h:\w$ How can I correct this?
5
votes
2answers
3k 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}][%= %{=kw}%?%-Lw%?%...