date
int64
1,220B
1,719B
question_description
stringlengths
28
29.9k
accepted_answer
stringlengths
12
26.4k
question_title
stringlengths
14
159
1,448,250,142,000
I've noticed that when running screen the process identified with it actually shows up in capitals. Linux Debian Wheezy. Here an example with me ssh'in into a machine, running screen -S test and then running top there. me@host:~$ ps x PID TTY STAT TIME COMMAND 4177 ? S 0:00 sshd: me@pts/0 4178 p...
The developers chose to do this to simplify killing stray screen processes. Refer to the source repository: the change was made between versions 2.3 (February 25, 1991) and 3.1 (September 9, 1991), which includes these comments from CHANGES: when the socket has been removed, send a SIGCHLD to the poor SCREEN process...
screen process in capitals
1,448,250,142,000
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 talking about: On the left you have byobu connected to wreckcreations with no color. On the right you have Putty connected...
It could be many things. Please provide the output of: echo $TERM echo $LS_COLORS typeset -p LS_COLORS alias ls tput setaf 1 | od -c echo "$(tput setaf 1)red$(tput sgr0)" Expected results: xterm (optional, see below) no=00:... (or similar, should not be empty) declare -x LS_COLORS="no=00:..." (ditto) alias ls='ls --c...
Nested ssh session inside screen has no color
1,448,250,142,000
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 screen on this window, but if I do that I'll have problems with key binding. Is there any solution?
You can pass commands from one screen sessions to it's sub-screen session with Ctrl+a a (it send Ctrl+a to the sub-screen) For example: To detach the sub-screen: Ctrl+a a-d Go to the next screen: Ctrl+a a-n Go to the previous screen Ctrl+a a-p
Is it possible to merge two screen sessions chained?
1,448,250,142,000
I have a game server running on Centos 7 via screen. I can confirm that the game server is running, I can connect to it with the client, and ps faux gives me this output: steam 10111 0.0 0.0 127904 3028 ? Ss Jul09 0:00 SCREEN steam 10112 0.0 0.0 115444 3548 pts/2 Ss Jul09 0:00 \_ /bin/ba...
This sounds like your screen socket files got deleted out from under screen. You can trigger screen to recreate them like so by send the SIGCHLD signal to them using the kill command: $ kill -CHLD 30860 $ ls /var/run/screen/S-username/ 30860.pts-4.localhost Where the PID, 30860, is the PID of screen. There are additi...
Screen active but no sockets in /var/run/screen
1,448,250,142,000
I am using screen to communicate with arduino over serial port, i start screen like this: screen /dev/ttyACM0 115200 then I try to send a command but every key I press on the keyboard get sent straight away, how to make it wait until I press Enter key before sending input to arduino? Here's my serial device /dev/tty...
I don’t work with Arduino devices, so I can’t be of specific help, but in lack of other answers I can try and give you some general hints (for the UNIX/Linux side) as to how address your particular problem. Unfortunately there’s no setting you can give to your serial port to make it send data in lines. That is a respo...
How to send input text (in screen) to serial port, a line at a time (not character at a time)?
1,448,250,142,000
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 the text in the caption, when the pane is active? I use these settings right now: hardstatus alwayslastline "%{= G}%{g}...
I looked at the STRING ESCAPES section of the screen man page and found what you may be after. The ? escape is like an if statement and the : escape is like an else statement. The F escape is true when that window has the focus. So the if-then-else statement for the if active then, else would look like this (padding...
GNU screen split: how to show active pane in caption
1,448,250,142,000
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%?%{r}(%{W}%n*%f %t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]' I did not create this theme, I don't re...
With the exception of the red brackets around the highlighted window, this is the closest approximation that I can easily configure in tmux 1.5: # default statusbar colors set -g status-fg white set -g status-bg default # default window title colors set-window-option -g window-status-fg white set-window-option -g win...
Convert gnu screen status line to tmux status line
1,448,250,142,000
So I have 2 terminals open in front of me; /dev/pts/1 - 'the controller' /dev/pts/2 - 'the receiver' I am currently using ttyecho to execute commands in /pts2 from /pts1. I can list the screens - ttyecho -n /dev/pts/2 screen -ls fine from /pts1 and see the results in /pts2. I can attach to a screen ttyecho -n /de...
You can do $ screen -ls This will list all the screen sessions like this. There are screens on: 8365.pts-6.vm2 (Attached) 7317.pts-1.vm2 (Attached) 2 Sockets in /var/run/screen/S-root. Then you can detach any screen session with the help of screen id. For eg: $ screen -d 8365 [8365.pts-6.vm2 de...
How to remotely detach a screen from another terminal
1,448,250,142,000
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 can I re-ssh back. Is there a way to kill this ssh using some shortcut? Or is there a way to make ssh try to reconnect...
Try the following , ~. Disconnect. ~^Z Background ssh. ~# List forwarded connections. ~& Background ssh at logout when waiting for forwarded connection / X11 sessions to terminate. ~? Display a list of escape characters. ~B Send a BREAK to the remote system (only useful for SSH proto...
Kill disconnected SSH session running in `screen`
1,448,250,142,000
I want to have a script running in screen at startup. This doesn't work: @reboot pi screen -d -m /home/pi/db_update.py however running this manually as user pi works: screen -d -m /home/pi/db_update.py Any idea on what I am missing?
Instead of adding @reboot pi ... to /etc/crontab you should run crontab -e as user pi and add: @reboot /usr/bin/screen -d -m /home/pi/db_update.py Make sure to use the full path to screen (just to be sure, it works without it), and that the /home/pi is not on an encrypted filesystem (been there, done that). The comma...
Running `screen` through a @reboot cron job
1,448,250,142,000
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 be terminated right after logout. But that's a strange effect: all that > my.log 2>&1 & does is redirect stderr to stdout... Why > my.log ...
Normally if you put something in the background it will continue to run even after its parent shell exits. In fact, I can create a test case like this: /bin/sh -c 'while true; do echo hi; sleep 5; done' & and then exit the shell and using ps I can see it's still running, forever, until I kill it. There is one differ...
Why `> my.log 2>&1 &` causes the job to sustain log out?
1,448,250,142,000
I have a raspberry pi on which I'm running some services. I need to be able to ssh into the machine and monitor those services. Currently, what I do is I log in, run screen, then create three windows and in each window run the script that runs the relevant service. Two of these are actually running as root (one monito...
As @DavidDai mentions in his comment, it would be best to run these as system services (e.g. by creating systemd service files or sysvinit startup scripts for them). That can be easier said than done, though. It is possible to keep doing it with screen. You just need to create a config file for screen, and use scree...
Setting up a screen session on system startup
1,448,250,142,000
I want to somehow generate a comprehensive "menu" of all possible ways to set up the GNU-screen "command characters" for a standard, off-the-shelf "US keyboard" and a specific terminal emulator, say xfce4-terminal. I imagine that this universe of possibilities would decompose into three lists: list A: all the possibl...
To understand the answer to this question, you need to have some understanding of how keyboard input is processed. I refer you to How do keyboard input and text output work? for background. In this answer, I'm going to explain the relevant part in a different way, but I'll assume some general familiarity given by my e...
How to make a comprehensive set of possibilities for defining GNU-screen "command characters"?
1,448,250,142,000
In bash I can hit Ctrl + a and go to first of the command line. But in screen Ctrl + a does not do this. How do I go to first of command line in screen?
You can press Ctrl+a followed by a to go to the beginning of the line. The a sends a Ctrl+a to the terminal.
How do I go to beginning of command line when I am inside the screen?
1,448,250,142,000
I'm seeing some slightly odd behaviour when using GNU Screen 4.00.03 on a Red Hat Enterprise Linux 6.4 system. If I connect without Screen, looking at the logs I can see each line is terminated with CRLF (0x0D 0x0A), exactly as expected. If I connect and run Screen, lines with two or more characters are terminated wit...
That's an optimisation done by screen. When you type echo<Cr> in screen. Because of the local echo and the icrnl and onlcr settings of the pseudo terminal device in the screen window, the \r\n sequence is sent to master side (to screen). screen implements a terminal emulator where \r is meant to bring the cursor to th...
Line endings when using GNU Screen
1,448,250,142,000
screen's man page mentions a "Multi display mode" at one place: -x Attach to a not detached screen session. (Multi display mode). It's the only place where "Multi display mode" is mentioned. What is it? Is understanding "Multi display mode" important for any other screen's options or commands?
Using screen -x allows you to connect to a session that it currently attached, without forcing it to detach. For example, if you do this in two separate xterms, you will see input and output of both instances simultaneously. This is useful when logging in from several locations; it avoids having to reattach once you g...
What is screen's "Multi display mode"?
1,448,250,142,000
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 key and then, after that, when I pressed C-] I would get this is an example as an output. Is it even possible?
You could do something like: screen_send_to_copy_mode() ( tmp=$(mktemp) || exit cat > "$tmp" && screen -X readbuf "$tmp" ret=$? (sleep 2; rm -f -- "$tmp")& exit "$ret" ) echo 'this is an example' | screen_send_to_copy_mode
How to send command output to GNU Screen's copy mode buffer
1,448,250,142,000
Scrollability of text in some terminals: | tty | xterm | urxvt | guake | terminator screen | Y | Y | Y | Y | Y tmux | N | N | Y | N | N I notice in this answer that scrolling doesn't work when using tmux. But I can scroll in urxvt. How can I have that behaviour in other te...
Add set -g terminal-overrides "xterm*:smcup@:rmcup@" to your tmux config and restart tmux. If you are not using a terminal matching 'xterm*' you'll have to change it of course.
Scrollability of text when using tmux?
1,448,250,142,000
I would like to send a command to a screen session and if possible get the output. My attempt at sending a command to a screen session is as I found on this website and lots of others, but it doesn't seem to work: root@server [~]# screen -X "script -a -c 'ls -l' /tmp/command.log" && cat /tmp/command.log cat: /tmp/comm...
First, read sending text input to a detached screen. You do need -p to direct the input to the right window. Also, the command won't be executed until you stuff a newline (CR or LF, the interactive shell running inside screen accepts both). That's: screen -p 0 -X stuff "script -a -c 'ls -l' /tmp/command.log$(printf \\...
Trouble sending command to detached Screen session
1,448,250,142,000
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 work, although I have tried several others: description "Run the bungeecord jar" start on (local-filesystems and ne...
Problem solved, I switched from using upstart to using cron. It was much more simple and everything works great now. For anyone reading this that might be curious as to how I did it, I made a simple shell script: #!/bin/bash java -Xms256M -Xmx256M -jar /home/ridog/BungeeCord/BungeeCord.jar And set it to run on start...
How do I start a screen session using an upstart job with a non privileged user?
1,448,250,142,000
When attaching to the same tmux sessions from multiple computers using ssh and tmux attach, my screen looks like: ------------------------- $> |........ |........ |........ |........ |........ -----------------........ ..........................
Probably the width/height (colums/rows) of the "original" terminal form which you launched te tmux session is lower than that of the terminal you're attacching from. Personally I don't use tmux, but that happens to me with screen when I launch from a 80x25 terminal and then I attach from another terminal with 80x50 co...
Tmux viewport caused by multiple concurrent sessions
1,448,250,142,000
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?
screen is running dash or other shell which doesn't recognize those bash-specific prompt escapes inside PS1. Either set the SHELL environment variable to /bin/bash before starting screen, run it as screen -s /bin/bash or set the following in your ~/.screenrc: shell /bin/bash The ~/.screenrc command has precedence ove...
Using GNU screen, I get raw prompt with backslashes
1,448,250,142,000
I'd like to get Terminfo for my terminal (rxvt-unicode) working, so that when I ssh from Linux to macOS, the Home/End and other keys work properly. Usually, to accomplish this with a Linux remote host, I use a script like the following: ssh "$1" 'mkdir -p ~/.terminfo/r' for f in /usr/share/terminfo/r/rxvt-unicode{,-25...
ncurses uses 2-characters for filesystems (such as MacOS and OS/2) where filenames are case-preserving / case-insensitive. That is documented in the NEWS file. Apple, by the way, provides an old version of ncurses (5.7) which is still new enough for this feature. Portable applications should not rely upon any partic...
Why isn't screen on macOS picking up my ~/.terminfo?
1,448,250,142,000
Let's say we have opened more than 10 screens in the screen program. How to switch to a screen using Ctrl+A, n where n > 9?
There are three ways to do it CTRL + A + " will give you a graphical list of your windows that you can scroll around in. CTRL + A + ' will give you a prompt to type a screen number. CTRL + A + n (or p) will take you next window, let us say you are on window 9 and if you press this, it will take you to next (or previ...
How to switch to a screen with two digit index in screen command?
1,448,250,142,000
So here's what happened: I ssh to the server with a normal user I run sudo -i I run screen Then I accidentally locked the screen session. to unlock it, it asks for root's password not the password of the normal user. The problem is I don't know the password of root. What can I do in this case?
You can attach to the session from "another terminal" (including another ssh connection). That lets you recover anything that was in progress. You can always kill the screen session as you started it, by using sudo to kill the parent process of the screen session (the one named "screen"). The feature only is useful i...
GNU screen locked, how to unlock?
1,448,250,142,000
I'm looking at replacing screen with tmux, currently I use this screen command: screen -d -m -S session_name /root/script Is there an equivalent command for tmux that will do the same thing?
The new-session command with the -d option is similar to the -d -m option in screen. The -s option corresponds to the -S option in screen. Note that -d and -s are options to the new-session command rather than to tmux itself. tmux new-session -d -s session_name '/root/script'
Tmux: equivalent command to screen -d -m -S session_name
1,448,250,142,000
Running a command in a screen and detaching is quite simple. screen -S test -d -m echo "output of command that runs forever" However I would also like to pipe all the output to a file for logging, how can run the following in a screen and detach. echo "output of command that runs forever" &> output.log Edit: Just t...
screen -dmS workspace; screen -S workspace -X stuff $'ps aux > output-x\n' I first create a detached session with the -d switch, I called my session workspace. I then send my command to the same session with -X stuff, I am using $'', but you could also use double quotes, but have to do a control M instead of a \n, ...
How to run a program in a screen, redirect all output to a file and detach
1,448,250,142,000
How do i get screen to execute/load .zprofile when starting a new window?
Put shell -zsh in your .screenrc, which will tell screen to start zsh as a login shell, which will in turn cause zsh to source ~/.zprofile .
How do i get screen to execute/load .zprofile when starting a new window?
1,448,250,142,000
Possible Duplicate: Shell: how to go to the beginning of line when you are inside a screen? Normally to get to the beginning of a line in a terminal the command is Ctrl+a. While using GNU screen the Ctrl+a is the escape sequence to enter a screen command. Is there a default way to move to the beginning of a line...
The sequence to send a literal C-a is explained in the man page: C-a a (meta) Send the command character (C-a) to window. See escape command. so you should use C-a a. So, if you have a screen inside the other (for example screen + ssh + screen) you should use that prescr...
Move to the beginning of a line in screen [duplicate]
1,448,250,142,000
Background I use virtualenv to switch between environments "1.0" and "2.0". I use screen to manage terminals. When I work on one environment I want all new screen windows to start with this environment. Question Can bash instruct screen to set environment variable on new shell instances, so I could make an alias simil...
If I understand correctly, your problem is you cannot find a way to use a shell alias to interact with screen directly. Instead, you can send commands to a running screen using -X, including setenv of course, e.g.: $ screen -list There are screens on: 25216.pts-45.antiriad (Attached) $ screen -S 25216 -X set...
How to set `screen` environment variable from bash?
1,448,250,142,000
I added the following line to my .screenrc script such that I can use my mouse to scroll up and down in the terminal when the output is too large and long. However, when I try to source .screenrc script. It complains that termcapinfo command not found. termcapinfo xterm ti@:te@ I have no idea what went wrong ? Why i...
You should not source it. The file .screenrc is read and interpreted by screen at start up. Moreover please note that termcapinfo xterm ti@:te@ will work only if your terminal set $TERM variable to xterm. In other case termcapinfo xterm*|rxvt*|kterm*|Eterm* ti@:te@ is probably more universal solution. There is also p...
Terminal: termcapinfo command not found
1,316,014,897,000
I used to leave my byobu sessions detached on a server. I want to lock the session to prevent other users (root account) accessing my session. Is this possible?
GNU screen (one backend that byobu can use, along with tmux) has the lockscreen functionality. Have a look at the man page to see what it does. The default binding is C-a C-x. With regard to your trying to lock root out, it's rather pointless. What you can try is to find a locking program that let you set a password a...
Lock a byobu session with password?
1,316,014,897,000
I'm using an aws ubuntu instance. I would like to create an alias/function to run some shortcuts, for example to activate a python virtual environnement in a screen. I've made this function for example: # Alias for jupyter notebook function start_jupyter() { cd my_path/lab_workspace/ # 1. cd into my workspace ...
The reason the function stopped is that you spawn an interactive screen session. You might want to do this instead: screen -dmS jupyter_lab jupyter lab This will create a detached screen session named jupyter_lab and execute the command there. As per the screen --help info: -dmS name Start as daemon: Screen sessi...
Execute bash function to run screen
1,316,014,897,000
I am having trouble with screen. It keeps terminating every time I try to console into my routers. eric@pop-os:~$ screen /dev/ttyUSB0 [screen is terminating] eric@pop-os:~$ screen /dev/ttyUSB0 [screen is terminating] It only works as root or superuser.
Does your user account eric have the permission to use /dev/ttyUSB0? To find out, please run ls -l /dev/ttyUSB0. The output might look like this: $ ls -l /dev/ttyUSB0 crw-rw----+ 1 root dialout 166, 0 Jul 9 08:55 /dev/ttyUSB0 The characters at the left-most column are the file type and permissions information: The...
Screen keeps terminating when trying to console in to routers
1,316,014,897,000
I'm looking for a way to drop the mouse, forever and always. I got to a very comfortable point, where I don't use it for regular text editing, however, something's bothering me. When I work with the shell and I want to copy some prev output, I need to highlight + copy using the mouse. That sucks. I know about screen ...
From within a Screen window, run screen -X hardcopy -h s vim s rm s hardcopy -h dumps the scrollback into a temporary file which you can then open in Vim if you like. If you script this you should use a proper temporary file name: #!/bin/sh scrollback_file=$(mktemp) screen -X hardcopy -h "$scrollback_file" vim -c 'ca...
Is there a way to open screen's terminal scrollback buffer in vim?
1,316,014,897,000
This is my current .screenrc files which is mostly copied from the link in the code #First iteration 2014-09-06, not quite sure of stuff to add # got a fancy hardstatus line noted below hardstatus on hardstatus alwayslastline # hardstatus string "%w" # blagged this hardstatus like from https://bbs.archlinux.org/viewt...
You can check this or better you can check man page for screen which is a good reference and says: backtick id lifespan autorefresh cmd args... backtick id Program the backtick command with the numerical id id. The output of such a command is used for substitution of the "%`" string escape. The specified lifespan is...
How can I add the session name to my screen status display?
1,316,014,897,000
While using GNU Screen in copy mode, I sometimes want to abort in the middle and go back to the prompt. What command will exactly achieve that ?
I think you want to use the Esc key. At least, that is what I use to get out of copy mode in screen. There are many alternative strategies as well, including hitting q, or hitting the Return key twice.
Abort copy mode in Screen
1,316,014,897,000
With GNU screen (version 4), why is it that the following runs perfectly fine: $ screen -S some-name But if I try having a slash (/) in the session name, it gives me an error about multiuser support. $ screen -S some/name Must run suid root for multiuser support. If I try setting the session name from within the scr...
The purpose of assigning a name to a screen session with -S is so you can operate on that session (for example with screen -r ...) by specifying its name. Looking at the man page under the -r option: -r [pid.tty.host] -r sessionowner/[pid.tty.host] resumes a detached screen session. No other options (except co...
Valid screen session names
1,316,014,897,000
I'd like to export the content of a detached screen under linux. I tried those command: screen -x 2>&1 > temp screen -x > temp 2>&1 screen -x > temp But it's not working, It keeps reattaching to a session instead of exporting it in the "temp" file. Screen version: 4.00.03jw4 What do I do wrong?
You probably want to do something like: screen -p 0 -X hardcopy this generates a file hardcopy.0 with the content of the screen session. The argument to -p determines which session. The files are dumped in screens current working directory or to the directory set set with the hardcopydir command. Check the screen con...
Export content of screen daemon to file
1,316,014,897,000
I recently needed to copy X amount of lines from a file, that I opened in vim and then paste them to another file opened in a different screen session (and different server). So on screen #1 I ran in vim: :15,20y and on screen #2 I tried to use p to paste the lines, but I couldn't because the register was empty (to be...
You can use the copy/paste functionnality of the screen command: First off, you select the text to be copied on screen #1: C-a esc With the command above, you're in window edit mode and this allows you to copy text from the current window and its history into the paste buffer. You move arround with the arrows and sel...
Is it possible to copy data from one screen session to another?
1,316,014,897,000
I have a script that runs a series of scripts numbered 001,002,003,004... etc down to 041 right now, will be more in the future - and these scripts them selves use some cursor control to print a progress bar and other status information and get the width and height of the terminal from tput cols and tput lines respect...
The following will let you customize the number of lines and cols tput returns export LINES=1000 export COLUMNS=1000
How to set Cols and Lines for a Subprocess
1,316,014,897,000
What's the difference between screen -S <sessionname> and screen -t <name>? It seems that both assign a name to the newly created screen, which can be reattached using this name.
-t <name> sets the default title for newly created shells in your screen session. If you invoke screen -t MyShell then type Ctrl+a c Ctrl+a c Ctrl+a w, you will see them at the bottom of your terminal: 0$ MyShell 1-$ MyShell 2*$ MyShell You can change each title of shells by typing Ctrl+a A. -S <sessionname> set...
screen: ‘-S sessionname’ vs. ‘-t name’
1,316,014,897,000
.screenrc: shell -${SHELL} caption always "%n(%t) %= %{b}@%H[%l] : %{r}%c:%s" termcapinfo xterm ti@:te@ termcap xterm 'AF=\E[3%dm:AB=\E[4%dm' terminfo xterm 'AF=\E[3%p1%dm:AB=\E[4%p1%dm' startup_message off screen -t server 0 rails s screen -t spork 1 bundle exec spork screen -t dev_log tail -f ./log/test.log Press...
I decided to create another related question How to keep Bash running after command execution? to just forget about big picture and focus on the main problem. Worked as intended and finally there were presented 3 ways to achieve the goal: workaround which was not bad portable (POSIX) simple and I choose to use 3rd o...
screenrc subshell for every window
1,316,014,897,000
I use GNU screen to run pine mail reader. I use external aspell to do spellchecking for the e-mails I sent. The problem is that when aspell finishes, pine restores the old content of the terminal, but the color is all wrong. The font becomes white instead of black, which looks very bad on the the gray background. Afte...
I think I have resolved it. phunehehe was right about trying to change the terminal type. However, "TERM=xterm-256color screen" does not work because the TERM variable only tells screen what kind of terminal screen is run in. It does not tell screen to emulate that particular terminal. So, the solution was to include ...
GNU screen color and pine
1,316,014,897,000
I have a couple of questions regarding screen: When I type screen -r, I get the following: There are several suitable screens on: 25154.tracks (Detached) 29278.mywork (Detached) 29138.mywork (Detached) 30915.mywork (Detached) 20065.mywork (Detached) Type "screen [-d] -r [pid.]tty.hos...
Here's a script that should work for you. #!/bin/bash function chooser { echo echo "I found the following screen sessions: " echo pcount=0 # # find the session dir # sessdir=$( screen -ls | egrep 'Socket' | awk '{print $NF}' | sed -e 's/\.$//' ) # # enumerate existing sess...
Screen: Resuming most recent screen? Making selection easier?
1,316,014,897,000
Protecting a GNU screen session with a password is good security. However, how does one remove the password if you need to share a session with a colleague? I tried the following to clear it and got locked out (I ought to have tested it before detaching, but...): ctrl+a :password clear So, what exactly is the passwo...
From man screen: password [crypted_pw] Present a crypted password in your ".screenrc" file and screen will ask for it, whenever someone attempts to resume a detached. This is useful if you have privileged programs running under screen and you want to protect your session from reattach attempts by anoth...
GNU Screen - any way to remove password when detached?
1,316,014,897,000
I want to run streamripper in its own X Terminal (window), then split the terminal horizontally, and then run mplayer in the lower half. This is simple enough to do manually, but getting a script to do it eludes me. start a new terminal window run streamripper http://radio.net:8000 -r 8000 split the terminal windo...
Although some terminal programs have support for splitting, you won't be able to access this functionality from the shell which is running in a different layer and doesn't have access to the software displaying it. What you can do is use a terminal multiplexer such as GNU Screen or tmux that allow you to run multiple ...
How to run streamripper and mplayer in a split-screen X terminal, via a single script
1,316,014,897,000
I use screen to connect to devices via RS232 with a USB-serial dongle. Currently, I use this command to invoke screen (where 115200 is my baud-rate): screen /dev/ttyUSB0 115200 Usually, I have more than one device (/dev/ttyUSB0 and /dev/ttyUSB1). Sometimes their baud-rate differs. Currently, I open a new terminal emu...
Once you've launched screen, you can use its internal screen command to attach windows to additional terminal devices. Type C-a: to get the prompt, then use screen /dev/ttyUSB1 ###### where ###### is this device's baud-rate. You can also put these commands in your .screenrc to attach the devices automatically when yo...
Multiplex different TTYs with a single instance of screen
1,316,014,897,000
I have a virtual server, and a graphic application (an electron browser, actually) is running on it. I actually run the command launching it with this script: #!/usr/bin/env bash set -e # Start Xvfb Xvfb -ac -screen scrn 1280x800x24 :9.0 & export DISPLAY=:9.0 exec "$@" It's running even while I'm not connected to s...
You can start a VNC server on an existing X server by using x11vnc. However, if you anticipate the need to do this, you may want to use Xvnc instead of Xvfb.
Access GUI of an already running application through SSH
1,316,014,897,000
I am using screen utility for couple of years. I just simply love it. In cloud machines I do have multiple screens as I work with a team. I want to log every commands that have been run in every sessions. Suppose there are three screens ex. A,B and C. I want to get A's all sessions commands and so on. It would be real...
Set the deflog configuration parameter (in ~/.screenrc), then screen windows will be logged automatically. See info -f screen --index-search=deflog for details
How can I do logging of every screen sessions
1,316,014,897,000
I'm running Slackware GNU/Linux 14.2, which doesn't start an X server by default. On a whim, I tried running startx inside a screen session and got the warning /usr/libexec/Xorg.wrap: Only console users are allowed to run the X server xinit: giving up xinit: unable to connect to X server: Connection refused xinit: ser...
Running startx only makes sense if you are in front of the computer. Testing for console ownership is one way to determine this. As you have found out, it can be fooled by operating in a screen session. In that case, no X for you.
Can't run `startx` from inside screen session
1,316,014,897,000
I use screen with a simple status line. If I what to scroll, I use Ctrl+a ESC to enter the copy mode and then I can scroll using the keyboard. This works great also with multiple buffers and splits. My question is: How can I configure screen to use the mouse wheel to scroll? Note 1: Using the mouse wheel I can scroll ...
screen does not know about the wheel-mouse. It only knows about keys (including escape-sequences) sent by the terminal and its keyboard: screen knows about mouse-clicks (its source-code mentions only "left mouse-click"). You can read the source-code (display.c) to see that it does no more than that (this, in partic...
Scrolling with mouse wheel inside screen
1,316,014,897,000
Screen uses the shortcut CtrlA to activate. I find that this interferes with the Bash command for jumping to the start of the line, and the VIM command for incrementing an integer. Certainly I could just remap it, but I am interested to know how other screen users deal with the situation. I don't think that I use Ctr...
Using CtrlQ is probably not a good idea unless you remap the start terminal key, for example, to CtrlX: stty start '^X' This is the complement of the stop character (CtrlS), which suspends output to the terminal from the OS. Myself, I've been using CtrlZ for over twenty years. I don't often suspend things since I ca...
Replacement shortcuts for `screen` [closed]
1,316,014,897,000
I'm managing with some boards like Arduino/UDOO etc. but I always face an annoying problem with minicom or screen. If i type a long command, for example: sudo /sbin/wpa_supplicant -s -B -P /run/wpa_supplicant.wlan0.pid -i wlan0 -D nl80211 -c /etc/wpa_supplicant.conf it reaches the end of terminal window, instead of ...
You need to manually execute stty cols ... rows ... and/or export LINES and COLUMNS to set the remote side's belief about the size to the terminal's actual size. Unfortunately there's no way this could be set automatically over a serial line.
Screen/Minicom multiline problem [duplicate]
1,316,014,897,000
xterm: $ echo $TERM xterm-256color $ stty -a speed 38400 baud; rows 52; columns 91; line = 0; intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; -parenb -parodd -cms...
The reason is that in your xterm, ^H is the erase character, and tmux apparently translates the erase character to the corresponding control character (^?) for the terminal it emulates, so that erasing works as expected in cooked mode (for instance, what happens when you just type cat). The translation is needed in ca...
Why pressing Ctrl-h in xterm + tmux sends "^?"?
1,316,014,897,000
I'm running the sleep command in terminal using screen and in detached mode. Once the screen immediately returns, I'm running ps command to verify the sleep is running. $ screen -d -m 'sleep 2m' [raj@localhost ~]$ ps PID TTY TIME CMD 22795 pts/0 00:00:00 bash 22869 pts/0 00:00:00 ps But the command did...
This was confusing to me initially as well. I then re-read the local screen man page for the SYNOPSIS -- the online man page does not give a synopsis) -- and noticed that it said: screen [ -options ] [ cmd [ args ] ] ... which led me to believe that it wanted to see the cmd and args as independent arguments. Since ...
sleep command using screen command is not displayed in ps
1,316,014,897,000
Whenever I use ssh-agent for passwordless logins it doesn't work across different logins and screen sessions, even if they are concurrent. I suspect it uses some shell variables that don't work across different sessions. Is there some way to configure it or get it to use some kind of variables that can be present on a...
I use keychain to manage my ssh-agent environment variables, and it deals with making sure only one agent is running at a time. From my .bashrc on appropriate machines: # is this an interactive shell? if [[ $- == *i* ]]; then # set up ssh key server if [[ -x /usr/bin/keychain ]]; then eval $(keychain ...
Is there a way to maintain ssh-agent connectivity in different screens?
1,316,014,897,000
I was unable to resume my screen session this morning, even after I killed the old screen -r session. svtbuild@dvm-2:~/rfs$ screen -r 17757.pts-0.dvm-2 There is a screen on: 17757.pts-0.dvm-2 (11/27/2012 04:49:19 PM) (Attached) There is no screen to be resumed matching 17757.pts-0.dvm-2. After waiting for a ...
From the screen manpage: screen -D -R Attach here and now. In detail this means: If a session is running, then reattach. If necessary detach and logout remotely first. If it was not running create it and notify the user. As mentioned for the options -D -RR, unless you know the status of your session(s), you should ch...
GNU screen: how to resume my screen session reliably?
1,316,014,897,000
I found: GNU Screen window rename nuisance However, none of the answers there solve my problem and my situation is slightly different from the linked question. I work in a large infrastructure where I might log into any of hundreds of hosts in a given day. I don't have the authority to manage the default PROMPT_COM...
The bug report I posted was answered almost immediately with a comment that this feature was added in a newer version of screen: Since v.4.5.0 there is defdynamictitle [on|off] for global setting and dynamictitle [on|off] for per window settings.
Turn off GNU screen dynamic window titling for entire screen session
1,316,014,897,000
I'm using screen terminal multiplexer. For some reason a dashed line appears on the 10th row. ... [ec2-user@ip-172-31-1-24 var]$ ls account db games lib lock mail opt run tmp yp cache empty kerberos local log nis preserve spool www [ec2-user@ip-172-31-1-24 var]$ --------------------...
I'd like to present another answer that might help other users who come across this: On GNU Screen by default, the dashed line means something else than what @slm said. His answer was covering tmux. For screen splitting (CTRL + A + S) in screen, the line is made out of solid full block characters. (█) The dashed line ...
what does the dashed line on a `screen` multiplexed terminal?
1,316,014,897,000
I want to SSH into a server, start a screen session, cd into path/to/my/script/, and run test.sh there. As a starter, I tried ssh [email protected] screen -dm bash -c 'cd path/to/my/script/; pwd > ~/output.txt' and expected to see path/to/my/script/ in output.txt, but I see my home directory there. This means the ...
The short answer: add some extra quotes around the command, like this: ssh [email protected] "screen -dm bash -c 'cd path/to/my/script/; pwd > ~/output.txt'" To see what's going on, you can specify the -v option to ssh to obtain some debug information. In this case, you'll see a line like the following for the origi...
SSH into server, start screen session, change directory?
1,316,014,897,000
After starting multiple gnu screen sessions with screen -S name1 screen -S name2 I would like to selectively attach to them. If I do screen -D -R name1 it will not attach but instead print: There are several suitable screens on: 6799.name1 (08.02.2013 15:47:23) (Detached) 3661.name2 (08.02....
The only reliable solution I found was the brute force method outlined in the question. To connect to an existing screen with name $exefile on remote $host via ssh, or to create a new one if it does not exist, one may use (in a bash shell): ssh -t $host " echo \"done.\" && echo \"itentifying screen ...\" && ...
How to attach gnu screen without knowing tty number
1,316,014,897,000
So I have a screen session running on one terminal/machine I would like to write a script that would attach to that screen session on another machine, but to a new window in that screen. Does anyone know how I can do this? I feel like it might have somethig to do with screen -x (session name) -p (window number)...if ...
Here is the answer: https://stackoverflow.com/questions/10599769/attach-to-screen-session-with-creating-a-new-screen-window I was looking for the same thing
Attach to existing screen session, but new window
1,316,014,897,000
Is it normal, that when I am logged in as root, and the used su user, I can't access that users screen sessions? In this case, screen complains about it not having permissions on /dev/pts/x. I assume that it can't control the terminal which was opened as root in the way it needs: am I right?
In general, you can change the ownership of /dev/pts/x to the user that you su to, as root, before you actually su. That way, the user that you su to will have access to attach the screen to your origin terminal. # chown someuser /dev/pts/x # su - someuser $ screen -dr somescreen If this is something you want to make...
GNU Screen does not work when su'ing from root to a normal user
1,316,014,897,000
I'm using GNU screen and I want to save input from stdin into a register to slowpaste it later. I tried a workaround with a temp file (which I can read into a register with readreg afterwards) and to use cat: :eval "exec | sh -c 'cat >/tmp/screentempfile'" However, if I press CTRLD to send EOF to cat, it doesn't arri...
That should rather be: :exec ... sh -c 'cat > ~/.screen-paste' You need stdin of cat to be coming from screen, hence the first .. The command shouldn't output anything, so the two other fds don't matter much, though it makes sense for them to go to screen as well, hence the two other .s.
In GNU screen, how to read from stdin and save into a register?
1,500,100,452,000
I often have to login into Linux devboards with known fixed usernames and password via the serial port. The normal commands are: screen /dev/ttyS0 115200 and then inside screen the session looks like: <enter> somehost login: root<enter> Password: root<enter> user@host# How to automate this login procedure so I don't...
You can help to debug expect by adding option -d. In your example you would see that you are doing "...send "\r"..." which is evaluated by the shell as ...send r... because \r is on its own outside the doublequotes. Try changing that to send \"\r\" as in the other cases. You also need to put a similar carriage-return...
How to send keystrokes before interactive shell to automate Linux serial port login with GNU screen?
1,500,100,452,000
The "screen" window manager allows specifying the desired size of the scrollback buffer. E.g. when starting a new session: (source) ‘-h num’ Set the history scrollback buffer to be num lines high. Equivalent to the defscrollback command (see Copy). Or when already inside a screen session with these commands...
I'm not sure where to find it documented, but digging into the source a bit gives some clues. When you pass in -h it sets the histheight (see screen.c). In main it parses -h as follows: case 'h': if (--argc == 0) exit_with_usage(myname, NULL, NULL); nwin_options.histheight = atoi(*++argv); if (nw...
maximum scrollback size of "screen" window manager
1,500,100,452,000
login to Server1 and run screen SSH to Server2 and connect to an existing screen session Realise ^A commands are procesed by Server1's screen only Is it possible to control Server2's screen in this situation? Even if only to detatch from it. The only thing I could see to do was tell Server1's screen to kill its wind...
Yes, it is possible. One of the commands you can send Screen with its metacharacter (^A) is a literal ^A, which is done with the ^A-a (ctrl-A, lowercase a) sequence. On the help screen (^A-?), you will see one key defined as meta. So, in short, to send a command to a screen within a screen (e. g. to disconnect the n...
Send commands to screen within screen
1,500,100,452,000
Question How do I find out the default directory of a window in GNU screen? NB: I’m not looking for the current directory of the process running in the window. Background I have created a hardcopy of my scrollback buffer without giving an absolute path. Now I don’t know where to find the created file. I don’t remeber ...
The easiest is probably to just make a new window, it will start in the directory where screen was started by default. Alternatives include looking at the process' cwd (e.g. /proc/<pid>/cwd, but this requires root as screen is setuid) Note that you can change that directory with C-a :chdir <path> later
How to Find out a GNU Screen Window’s Default Directory?
1,500,100,452,000
My ssh connection is unreliable, so I've been studiously using screen and detaching every time I start a long-running process. The screen part I know is necessary, but is the detaching as well? Thanks.
You do not have to disconnect, if the connection gets interrupted you can use screen -dr to reattach to a already running screen session that wasn't properly disconnected from first. Simply list out the screen sessions using screen -ls: $ screen -ls There is a screen on: 10266.somesession (Attached) 1 Socket in ...
Does the screen need to be detached to keep the process running after disconnection
1,500,100,452,000
Let us say I run screen -R myscreen. Then, I run commands on myscreen that are bigger than my monitor size so I end up loosing the visibility of the first commands I run. Then, I do Ctrl+d to leave the screen. Now I want to see all the commands I ran in myscreen. How would I do that? How would I see all the histor...
Screen maintains its own scroll back buffer. You can access it like so: Ctrl+a+Esc You can then use the arrow keys to move up and down through this scroll back buffer. When done hit Esc again to get out of it.
see all commands/logs of screen in linux
1,500,100,452,000
I am connecting to an embedded Linux board using screen over a serial link and trying to change the terminal type, as the default vt100 is pretty restrictive in terms of colours and scrolling etc. The screen manual suggests the configuration option termcapinfo but using that doesn't fix the issue. On the host machine,...
It's the remote machine that sets $TERM to vt100, because it cannot know what terminal emulator your connecting with. vt100 is a safe value as the majority of modern terminals and terminal emulators (including screen) are compatible. To tell the applications over there what your terminal actually is, you have to set $...
Change terminal type for screen over a serial connection
1,500,100,452,000
I often use only two applications, terminal and web browser. I like the tmux application which enables to split a terminal window into more regions. I noticed that I can open lynx in another region and have a browser and terminal displayed at the same time. But command-line browsers aren't very nice for viewing web pa...
The job of splitting the screen into regions is normally devoted to the window manager. Many window managers have facilities to quickly set up or recall a window arrangement. If you find that you divide your screen between unobscured windows often, you may want to switch to a tiling window manager. Choosing a tiling W...
Terminal and web browser combination
1,500,100,452,000
I auto start gnu screen when I ssh into one on my own servers. When I am done, I have to d to detach. Then exit to quit ssh. This means that when I ssh into the server again at some point in time, I can continue where I left off. Can I create a alias (for instance) that will (from within screen) detach and drop ssh?
Starting screen when logging in on the remote host (executed on your local machine): ssh -t user@host screen In the screen session, on the remote host, to detach and log out (which would end the SSH session unless you are using a persistent connection using a control socket (i.e. using the ControlMaster setting with ...
alias to detach screen when I exit (and kill ssh)
1,500,100,452,000
I have recently started using screen in order to be able to split my terminal vertically and horizontally. However, it does not clear the terminal automatically. For example, when I open a file using vim and then I close it, the screen fills the terminal with the content of file. Is there a way to fix it and make it l...
You're probably thinking of the alternate screen feature, which allows full-screen applications such as htop to display in a different view, and on completion returning to the normal view (without the application showing). That is the altscreen setting in your .screenrc, described in the manual: Command: altscreen s...
How to force `screen` to clear the terminal after commands like `htop`
1,500,100,452,000
Whenever I try to start a screen-session as a non-root-user I get "No more PTYs." as a response. Same command in the same directory as root works properly. I tried the solution from this post but it won´t change anything: $ ls /dev/pts $ cat /proc/sys/kernel/pty/nr 0 $ cat /proc/sys/kernel/pty/max 4096 Even unmoun...
Very likely you cannot make screen use the BSD pseudo terminals because it is compiled to use a specific style of pseudo terminal (never both). There are two main flavors with variations: a function (such as openpty) provides the names for the master and slave devices the program searches through a list of master/sl...
"No more PTYs" when starting screen as non root-user
1,500,100,452,000
How can I derive the character sequence that represents a certain keystroke in screen? I mean, what bind takes as input. For instance, 's' represents the obvious keystroke on the 's' key. 'S' represents 'shift+s'. But the representation of other more complex combinations are unclear to me and the scheme that is follow...
There is no scheme, screen, like any terminal application, doesn't deal with keystrokes, but with characters or sequences of characters which it reads from a terminal device. It's the terminal (or terminal emulator like xterm) that transforms a keystroke into a character or sequence of characters which it sends over a...
What is the scheme for textual representation of keystrokes in screen?
1,500,100,452,000
I'd like to write some scripts that would open multiple terminal panes in a single window, much like tmux or screen. I personally am well versed in tmux, and have used it for years, but other developers on our team don't want to know anything about it or other screen multiplexers. To this end, I'd like to write scrip...
I think it is safe to say that this can't be done purely with bash alone. You will either need a higher programming language like perl/python, or to control an instance of tmux with a script. Here's a quick review of the technology involved: In order to run a program in the terminal environment that it expects, you ...
How to write scripts that create multiple terminal panes, like tmux?
1,500,100,452,000
I use run my programm under gnu-screen with enabled logging to a file (log on / logfile options in .screenrc). But after some time the log file became too big. Is there some way to limit size of a log file?
Unless you want real-time control over the size of the log, you can use logrotate with cron to accomplish this. Assuming you want to rotate screenlog.log in your /home/username/ directory, you would create something like this configuration file: screenlog-rotate.conf: /home/username/screenlog.log { size 100k } then...
How to limit screen's log file size
1,500,100,452,000
Overview I use Screen as an add-on to the Linux console so that I can have multiple screens and can run my server while doing additional tasks simultaneously. Issue The console output seems to be cut off if it gets beyond 25 lines, which is extremely irritating when an error is being thrown. Example As you can see i...
screen by default will use sizes which were current when screen was started. You can use ctrl-a F to resize to current terminal size. You can also use ctrl-a [ and arrow keys to scroll back in history.
How to stop Linux console output from being truncated when using Screen?
1,500,100,452,000
In screen there is a kill command, which kills the current window. This command can be sent even to a detached screen session by running: screen -S SessionName -X kill This works to kill the current window only. To kill any other window, it appears the only way is to first switch to that window and then kill it. The...
You can try -p to select the window, numbered from 0, eg screen -S SessionName -p 1 -X kill
Select screen in detached screen session [duplicate]
1,500,100,452,000
I use the screen command on several servers, where I monitor several log files. I arrange the log files to my preferences with several splits and by naming the regions. Sometimes the server gets rebooted or I have to log out from the screen session for various reasons, and it is tedious to set the this up manually eve...
use ~/.screenrc on the server. example: split screen -t top top focus screen -t shell where: split — splits current window/region horizontally focus — switch to next region screen -t name [command] — set name for current window/region and run command
Screen: can I execute commands and split the window when starting screen?
1,500,100,452,000
tmux I followed Getting 256 colors to work in tmux: I have alias tmux='TERM=xterm-256color tmux' in ~/.bashrc and also set-option -g default-terminal "screen-256color" in ~/.tmux.conf In konsole: $ echo $TERM xterm In tmux: $ echo $TERM screen-256color Still colors doesn't work in tmux: boris@vasilisa:~$ PROMPT_GR...
Well as you quite correctly guessed setf is not correct capability for setting foreground color in context of xterm-256color(screen-256color) terminfo entry. You should use setaf (set foreground color using ANSI escape). $ echo $TERM screen-256color $ infocmp -1 | grep setf $ infocmp -1 | grep setaf setaf=\E[%?%p...
Getting 256 colors to work in terminal multiplexer
1,500,100,452,000
I made a script that runs fine manually, but can't get it to run with the description in How to start a script file on boot?. I have run update-rc.d -f minecraft.start defaults This is what my /etc/init.d/minecraft.start is like #!/bin/bash case "$1" in start) screen -S minecraft.start /home/phirephoenix/minecra...
I didn't remember screen having a daemon mode, apparently it does. Change the screen line for the following: screen -dmS minecraft.start /home/phirephoenix/minecraft/bukkitserver/start_server.sh The new parameter -dmS "Start as daemon: Screen session in detached mode.", which is the combination of -d -m and the -S th...
Make screen start as Daemon for a Minecraft server
1,500,100,452,000
I got a brain smashing problem with Fedora 16 and my serial port. I use the serial to monitor an STB on which I'm developping. The STB runs on Linux and when booted, I launch the program I'm working on through the serial interface. Now, my program outputs lots of traces when I'm debugging, and I get loads of buffer ov...
According to the Fedora 16 documentation /etc/rc.serial is responsible for setting up the serial lines. Has anything changed here between your 15 and 16 install? Setting "low latency" and "rx/tx_trigger" (if possible) might help. I remember that the 16550A has a 15-byte-input-buffer. Somehow you can set at which fill-...
Buffer overrun on Fedora 16 serial
1,500,100,452,000
Using debian unstable with Gnome 3 but I think this has always happened. If I log out and then log back in again it seems the X session is restarted or in some way changed. In any case, when I start a terminal in the second session and re attach the screen, it's no longer possible to start X apps. (message is 'Cannot ...
I suppose that you have some problem with xauthorization. Please check if the value of XAUTHORITY environment variable changes each time you start a new X session. If it is true, you have to update this variable in each shell you have inside screen, because their environ contains still the value it has the time you st...
'Cannot open display' on restored GNU screen session
1,500,100,452,000
I am connecting to a serial port using screen: screen /dev/cu.usbserial-A703XAOG. The device on the other end sends only a carriage return to separate lines. Screen only starts at the beginning of the line when receiving a carriage return, and does not go down a line, and thus overwrites the last line of output with t...
Something that seemed to work for me was to manipulate the pseudo-tty that screen has by sending it the newline mode escape sequence you found, and also giving it an stty command to convert the carriage return to a newline. Use ps a to find the pty: 16947 pts/4 Ss+ 0:00 screen -S myscreen /dev/ttyS0 and then g...
How can I make screen go down a line AND start at the beginning when receiving only CR from a serial device?
1,500,100,452,000
Which software provides /usr/bin/lock or /local/bin/lck ? The manual says that GNU Screen will call a screenlock program. But I don't have them in my system. Also my $LOCKPRG is empty. So is there any standard Linux software which I can install that provides lock facility for GNU Screen ?
My edition of screen on Debian (package version 4.1.0~20120320) has lock functionality built-in; hitting C-a x locks the entire environment (so that not even detach with C-a d is permitted). The Debian version of the man page for screen writes, "Call a screenlock program (/local/bin/lck or /usr/bin/lock or a builtin i...
What software is lock or lck
1,404,212,370,000
I am not quite sure if there is any subtle or wide differences between screen and xterm. I have used screen before and had it being described as kind of like a multiplexer and have tried xterm a few times. Can anyone explain the differences between the two as well as the pros and cons to them both?
you don't see actual terminals all that often anymore, but for instance the Linux text consoles on (CTRL +) ALT + F1 through F6 are considered terminals. xterm is a terminal emulator for systems running the x-window system and a graphical user interface. It provides only a single terminal, typically running a single p...
How are "xterm" and "screen" related?
1,404,212,370,000
Scenario; I have SSH'ed to a machine, opened a new screen session, and fired off a script. Some days later I SSH back to that machine, re-attach the screen session and look at the output that has been generated, however; I can't scroll back through the output. From what I can see, screen stores one "screens worth" of...
Screen does keep a log of past output lines; it's called the “scrollback history buffer” in the Screen documentation. To navigate through the scrollback, press C-a ESC (copy). You can use the arrow and PgUp/PgDn keys to navigate, as well as other keys to search and copy text. Press ESC to exit scrollback/copy mode. By...
Leave remote command running storing output
1,404,212,370,000
I have a really old console application that I want to make a bit more resilient. The program is used this way: the user uses a custom terminal emulator to connect to a remote machine through ssh the user starts a shell script the shell script might start a long-running progress database process. Obviously, sometim...
Add term at386 to your .screenrc in order to override TERM. If this doesn't help, try dtach instead of Screen (which doesn't do any terminal emulation itself).
How to prevent a program from dying when its ssh session dies?
1,404,212,370,000
I'm not sure whether this is regarding a vim command or a screen command, although I think it's the latter. I use vim under screen all the time, and every once in a while will hit a key combo that freezes the virtual terminal I'm using. I can see everything, and I can still issue screen commands on that terminal, but ...
The accepted answer talks about flow control for the terminal you are running GNU Screen in. This would not result in the behaviour you are describing since you wouldn't be able to flip to and use your other Screen-terminals. The behavior you are describing sounds like you turned flow control on within GNU Screen its...
How do I un-freeze my vim session under screen
1,404,212,370,000
My ubuntu VM does not run cron jobs with a TTY (not even when I log in and run the command from the user's env). Because of this, cron can't run tmux or screen, preventing programs (specifically rtorrent in this case) to be run in the background in a simple and attachable way. What is the best approach to running a pr...
If you use the -d option with tmux new, it won't attach to or require a tty. From man tmux: new-session [-AdDEP] [-c start-directory] [-F format] [-n window-name] [-s session-name] [-t group-name] [-x width] [-y height] [shell-command] (alias: new) Create a new session with name ...
What is the best way to attach to a cron program without TTY
1,404,212,370,000
What's the best way to run a command inside a screen session such that its parent shell can be accessed? I want to be able to restart it from within the same screen session. The best I've managed to come up with is the following: $ cat mr-t.sh #!/bin/bash top exec /bin/bash and then: screen -e'^\\\' -S top-in-scre...
Since asking this question, I've adopted a different but much more effective solution: use tmux. Start a new named, detached session: $ tmux new -d -s top Send a command to its zeroth window. $ tmux send-keys -t top:0 "top" C-m C-m is equivalent to hitting return. Often it's what you want; sometimes you'll want to l...
How to run a command inside screen such that you can get back to the command's parent shell?
1,404,212,370,000
How can I disable the key combination Ctrl+C on GNU-screen? Actually I would have to get used to it, but I press Ctrl+C rather than Ctrl+A+D out of habit.
Now I've found the answer myself. The instructions defscrollback 30000 bindkey "^C" echo 'Blocked. Please use [Ctrl]+[A] + [Ctrl]+[Enter] + [Y]' bindkey "^D" echo 'Blocked. Please use [Ctrl]+[A] + [Ctrl]+[Enter] + [Y]' bind "^M" quit in the file ~/.screenrc lead to the fact that C-c only executes the echo command, t...
Disable Ctrl+C in GNU screen?
1,404,212,370,000
Whenever I create a new window in gnu screen I usually give it a name which persists between disconnects, but I notice that with oh-my-zsh distribution of zsh the title gets reset when I run a command in the window. Basically it gets reset to (x* ~) where x is the window number. Not only that when I run a command in r...
It can be disabled in .zshrc by uncommenting the line: # Uncomment the following line to disable auto-setting terminal title. # DISABLE_AUTO_TITLE="true" It is applied in the functions omz_termsupport_precmd and omz_termsupport_preexec, which are in ~/.oh-my-zsh/lib/termsupport.zsh
How can I stop zsh (oh-my-zsh) from resetting screen window titles?
1,404,212,370,000
I started an fsck locally from tty1 on my Linux server and it seems to take forever. Would I have thought about this before or known I would have run a screen fsck. Is there any way to monitor tty1 via SSH or see the output from the fsck process running? I don't need to interact, just see how it's going.
If tty1 is the first virtual console on a Linux system, you can view its contents via /dev/vcs1: cat /dev/vcs1 (as root). (Thanks to Sato Katsura for pointing out that this is Linux-specific!)
Monitor/spy on tty1 or see the output from tty1 via SSH? [duplicate]
1,404,212,370,000
Is there a risk of losing files during compression if process dies? I'm gzipping big files using wildcard, but accidentally running it without screen or nohup. Is there a risk to lose source files if I cancel gzip compression during creating archive? Gzip version: gzip 1.3.5 (2002-09-30) Please let me know, I'm afrai...
No there is no chance of losing during compression. Only when the file is complete processed is the source deleted (that is, if you don't specify -k or --keep, in which case the source is not deleted at all).
gzip - is there a risk to lose files during compression if process dead?
1,404,212,370,000
Is it possible to load multiple configuration files in Gnu screen? I tried multiple -c options, in vain. The basic idea is to keep my default ~/.screenrc loaded, and add a custom session configuration above it.
What I do is that I have a common screenrc file and I include it from custom session files. For example I have ~/.config/screen/gnus.screenrc containing sessionname gnus source common.screenrc chdir / screen -t gnus emacs -nw -f gnus And I run scr gnus to open this session, where scr is a script that arranges to eit...
Gnu screen : load multiple configuration files
1,404,212,370,000
I have created a long running screen session with many windows and the C-a A command to rename a window is not working. What is the text command for renaming a window? I have tried :caption string windowname but it doesn't work. Is that the right command or am I missing something?
That is the title command, e.g,. :title bad-window In the manual: title [windowtitle] Set the name of the current window to windowtitle. If no name is specified, screen prompts for one. This command was known as aka in previous releases. If the shortcut is not working, of course, the long name may not work either.
What is the text command for naming a window in gnu-screen?