gnu-screen

gnu screen: can you automatically name a window after the last invoked program?

寵の児 提交于 2020-01-22 12:33:05
问题 Is there a way to automatically have each window change its name to the name of the last program you ran from that window? This would be more convenient than having to rename the windows manually. 回答1: Yes, you can use shelltitle to do this. Assuming you use bash, the following should work. Add this to your .screenrc : shelltitle "$ |bash" where the "$ " should match whatever is at the end of your prompt string ($PS1) and "bash" is the default title. Then add a null title escape sequence to

Run commands in screen after creating one per bash

跟風遠走 提交于 2020-01-17 05:54:34
问题 I have the following bash file which should create a screen, go to a directory and then start a node script: screen -S shared // 1 cd /home/nodejsapp // 2 node start.js app.js // 3 The problem is, after executing 1, I indeed see the screen 'shared', but 2 & 3 will execute on the previous terminal, not on the screen 'shared'. How can I achieve that commands 2 and 3 will be executed on the current screen? 回答1: You may create a detached screen and then send commands to it. For example: screen -d

Script to start command in byobu tab

痴心易碎 提交于 2020-01-14 03:33:08
问题 I have used screen to start a server process, to witch I can later attach if needed and deatach again to carry on with other things. It worked fine but I have found byobu recently and I really love it. I want to use the same kind of scripts to run the server but instead of a screen sesson I would like to attach it to a byobu tab. I'm using byobu-tmux (because it looks better). How could I do it? My original scripts (they both do more, but these are the relevant parts): # Startup screen -a

Using screen in bash script

丶灬走出姿态 提交于 2020-01-13 12:52:53
问题 I'm running a game server on a remote server where I use a detached screen instance to leave it running. I'm now creating a script that can be used to shut down the server, back up all the vital files and start it up again, however I'm having a few difficulties with dealing with the screen. I assumed that I could just switch into the detached screen in the script (after the server had already been shut down) by calling screen -r in the script. But that doesn't seem to work because if I run

Using screen in bash script

て烟熏妆下的殇ゞ 提交于 2020-01-13 12:52:22
问题 I'm running a game server on a remote server where I use a detached screen instance to leave it running. I'm now creating a script that can be used to shut down the server, back up all the vital files and start it up again, however I'm having a few difficulties with dealing with the screen. I assumed that I could just switch into the detached screen in the script (after the server had already been shut down) by calling screen -r in the script. But that doesn't seem to work because if I run

Spawn a screen session from launch daemon

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-13 11:52:31
问题 I've written a launchd .plist which should attach a debugger to the WindowServer when it launches. The main part of the script looks like screen -D -m -S "WindowServer Debugger" \ gdb \ -x $GDBSCRIPT \ /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/WindowServer \ $WSPID This starts a detached screen session in which gdb is attached to WindowServer. However, this seems to trigger an error condition in launchd under

Spawn a screen session from launch daemon

橙三吉。 提交于 2020-01-13 11:52:30
问题 I've written a launchd .plist which should attach a debugger to the WindowServer when it launches. The main part of the script looks like screen -D -m -S "WindowServer Debugger" \ gdb \ -x $GDBSCRIPT \ /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/WindowServer \ $WSPID This starts a detached screen session in which gdb is attached to WindowServer. However, this seems to trigger an error condition in launchd under

Spawn a screen session from launch daemon

ε祈祈猫儿з 提交于 2020-01-13 11:52:14
问题 I've written a launchd .plist which should attach a debugger to the WindowServer when it launches. The main part of the script looks like screen -D -m -S "WindowServer Debugger" \ gdb \ -x $GDBSCRIPT \ /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/Resources/WindowServer \ $WSPID This starts a detached screen session in which gdb is attached to WindowServer. However, this seems to trigger an error condition in launchd under

keep the same conda env after entering screen

走远了吗. 提交于 2020-01-05 04:13:09
问题 I have tried the following at the end of my .screenrc conda activate ${CONDA_DEFAULT_ENV} in my bash terminal, I typed: conda activate atwork3 echo ${CONDA_DEFAULT_ENV} > atwork3 screen -S test > # starts screen OK but comes with env base echo ${CONDA_DEFAULT_ENV} > base I read that you cannot put bad commands in the .screenrc or the full file gets ignored which is probably what happens to me here I also tried things from how-to-open-tabs-windows-in-gnu-screen-execute-commands-within-each-one

Is it possible to name the 'screen' logfile from the -L flag?

て烟熏妆下的殇ゞ 提交于 2019-12-31 18:46:51
问题 Upon running Screen with the -L flag, a file called 'screenlog.0' is created and all output written to it (which is great), but I will be running several Screen sessions and I need to identify the logs with a unique number. Is it possible to change the log file name? 回答1: You can edit your .screenrc file and add something like this: logfile /tmp/myownlog It is also answered at Specifying a log name for screen output without relying on .screenrc . 回答2: Probably the easiest way is to use the