3
votes
2answers
47 views

screenrc subshell for every window

.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' ...
3
votes
1answer
56 views

Init script leaves thousands of defunct processes

My problem is that I have an init script that is generating thousands of defunct bash processes. My goal is to have a program called "fr24feed" in its own screen session on boot. After looking at ...
0
votes
1answer
103 views

Screen in bash script

I am using a bash script and I need to create a screen, execute a specific command with a memory limit and detach the screen. I have been trying something similar: #!/bin/bash for i in 1 2 3 4 5 6 7 ...
0
votes
1answer
238 views

Automatically save bash command history in screen session [duplicate]

I connect to a screen session. After doing some stuff I detach it. Then in history | tail I only see screen -r and previous commands and not the commands run in screen session. Basically history shows ...
0
votes
0answers
35 views

Why is Compass running on screen 1 printing its output onto screen 0?

I'm using 2 screen windows for this. screen window 0 is mostly used for git screen window 1 is used exclusively for running compass in watch mode. Now, whether I redirect all compass (run with the ...
1
vote
2answers
183 views

How do I kill all screens?

I accidentally created over 1000 screens. How do I kill them all with one command? (Or a few)
2
votes
1answer
213 views

search text on the terminal output

I am running an application with command $ grails run-app which prints log in terminal like below. What I want is search a particular text (say user authorities) in this log so that I can verify ...
3
votes
1answer
157 views

Tmux: equivalent command to screen -d -m -S session_name

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?
2
votes
1answer
98 views

My bash prompt is not working in `screen`

On RedHat, screen resets my bash prompt. I set PS1=\u@\h:\w in ~/.bashrc and ~/.bash_profile. I added shell -$SHELL as well to ~/.screenrc. But, when I open a brand new terminal window, the prompt ...
2
votes
1answer
116 views

Screen - inherit current window's environment

In GNU Screen, how can I create a new window whose shell inherits the environment of the shell in the current window? The usual Ctrl+A C doesn't seem to do this.
2
votes
1answer
71 views

bash - inherit directory stack in children

If, in my newly created bash, I do: pushd foo pushd bar dirs -l -v I will get something like 0 bar 1 foo 2 old_dir If I then do bash dirs -l -v I get only 0 bar The same thing happens ...
3
votes
1answer
234 views

Opening multiple split windows with GNU screen with single bash script

I would like to create a bash script to automatically open a screen window with 4 sessions running predetermined commands. I'd like to open htop and slurm on the top two frames, squidview in the ...
6
votes
3answers
506 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 ...
1
vote
1answer
260 views

Cron automated bash script to run run 1 bash script then another, plus integrity check

So I have a custom in-house app developed by a 3rd party. When the app is running, I can verify it is running with the "screen -ls" command. As long as screens are running for rails and freeswitch ...
0
votes
0answers
21 views

Sending commands to a deattached screen [duplicate]

I am trying to send commands into a screen with what I thought should be a simple script. I am using it for a minecraft server. The script is as follows... #!/bin/bash echo "Creating screen" screen ...
2
votes
1answer
249 views

Screen escape dollar sign

I'm trying to run a command using screen which contains the dollar sign, but the dollar sign does not get through. screen -d -m echo \$ > test.txt test.txt just ends up being an empty file...
0
votes
1answer
260 views

Resume bash session in new TMUX or SCREEN? [duplicate]

Sometimes I'll start doing something fast. I've got something to do, and I need to get it done now. Then of course i realize that I need to do something else to help me finish what I started, so I ...
2
votes
2answers
147 views

Share background jobs between shells

I use Screen with a lot (more than 10) of local Bash sessions inside. I send some processes (like vi file) to the background and switch between sessions very often and sometimes it's very annoying to ...
3
votes
3answers
514 views

How to attach gnu screen without knowing tty number

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: ...
8
votes
1answer
1k 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 ...
2
votes
2answers
1k views

Attach to existing screen session, but new window

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 ...
3
votes
1answer
274 views

How to set up `screen` to modify the window title and xterm-window title?

I'd like to have my current $PS1 prompt (\u@\h:\w$(__git_ps1 "(%s)")\$ plus some coloring) to be also used as screen's window title (in the hardline) and as the xterm window title. How can this be ...
5
votes
3answers
1k 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 ...
0
votes
1answer
397 views

Setting LS_COLORS and in a GNU Screen

Is there a way to set a GNU Screen LS_COLORS to that of the default non-screen terminal window? Is there .screenrc or .screen_profile, I don't understand what happens when a GNU Screen is ...
5
votes
2answers
2k views

Screen status bar to display current directory for zsh/bash shell

I use GNU screen a lot with zsh as my shell. It would be a nice feature (I think) to be able to display the current directory name (not the full path) as the tab title. I can do that with CTRL+A ...
5
votes
2answers
309 views

How to do block selection in `screen`

In vim, there's a CtrlV to do block selection. How can I do it in screen?
7
votes
1answer
532 views

Screen cuts off beginning of long command when accessed through bash history

I'm using the default versions of bash and screen in OS X Lion. When I'm in a screen session and I scroll back through the bash history and I come to a command that is long enough to wrap. I might ...
3
votes
1answer
2k views

Showing GNU screen session name and window title in shell prompt

Is there a way to present the GNU Screen session name and window title in the prompt of the shell (let us say, the Bash prompt defined by PS1)?
3
votes
1answer
704 views

How to run streamripper and mplayer in a split-screen X terminal, via a single script

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 ...
9
votes
2answers
5k views

How to get the output inside `screen` out to a script?

I have a screen instance running (a lot more actually, but only one that matters), and I would need to execute some code inside the screen, and get the result out to my script. The first part is ...
8
votes
4answers
976 views

Can I easily search my history across many screen windows?

My current screen session has 12 open windows on it. It's been running for weeks... I know I executed an ImageMagick convert command in one of these 12 screen windows sometime last week... is there ...
5
votes
2answers
4k views

Connect to byobu screen session and execute command?

In a script I am building I'm experimenting with how to automate as much as possible. One of the more interesting challenges is to connect to a byobu screen session and execute a command. So I ...