gnu-screen

Executing screen command from Java

别来无恙 提交于 2019-12-11 15:11:55
问题 I am using the following code to execute an SH file in Linux Runtime.getRuntime().exec(new String[] { "/bin/sh", "-c", file.getPath() }); This code works however I can't use the screen command in the SH file when executing it from Java, I get this error Must be connected to a terminal. So is it possible to "connect" java to a terminal? I would like to be able to also view this screen when I connect via SSH so I think it has to be connected to the terminal that is shown when you SSH into the

Modifying a running script and having it reload without killing it (php)

拈花ヽ惹草 提交于 2019-12-11 08:05:49
问题 I have a gameserver running on Debian where players can edit an (already-running) php script via web to modify the game. However, once changes are made to the script and saved, the affects of the changes only happen once the script is killed and rebooted (I have to do this manually in terminal). Without giving shell access to users, how can the script know to reload a new version of itself once changes have been made? The script is running in a GNU Screen. Although my overall knowledge on GNU

start screen detached in a vagrant box with ssh, how?

拟墨画扇 提交于 2019-12-11 07:16:14
问题 Im stuck: I have a Vagrant box with a server, when i logging with vagrant ssh, and launch my script to start the server in a detached screen session, is ok: vagrant ssh screen -d -m -S sesionServer bash run_server.sh i can see my screen session active with screen -list and the server is running OK. but i need launch all this in a single command, im trying to execute: vagrant ssh -c 'screen -d -m -L -S test1 bash run_server.sh' but I only have a "connection to 127.0.0.1 closed. How can i

Creating new windows that run programs in screen

和自甴很熟 提交于 2019-12-11 06:38:52
问题 My .screenrc has some initialization code that opens some windows. It's neat. What I want to do, while running screen is simply , with one command open a new screen window that is running a program. It SHOULD be: screen -t 'CADMIN' sudo cherokee-admin -b This actually works, except that it also runs my .screenrc and opens up all of my windows in a nested screen. FAIL. I know I could use ^c ( to create a new window ) ^cA ( to title it ) sudo cherokee-admin -b and get the same effect, but I'd

To ignore linenumber's selection in Less inside Screen

孤街醉人 提交于 2019-12-11 06:38:28
问题 I would like to develop a selection-tool for Screen which ignores the leading spaces and numbers in selection. Problems What is the code which affects selection-tool C-a Esc in Screen? To make an algorithm which ignores the linenumbers and the space at the beginning from the selection: alt text http://files.getdropbox.com/u/175564/%20selection-less.png The following Perl-regex seems to match the beginning of the line {5}[1-9]{1-4} {8} # not tested The selection tool apparently works by

GNU Screen: files to numbered buffers?

倖福魔咒の 提交于 2019-12-11 05:56:44
问题 I unefficiently use "^a + ESC SPACE -- SPACE" and "^a + ]". 1. How can I copy a big file to GNU Screen buffer like ^a + : cat big_file > new_buffer ^a + : new_buffer ] 2. How can specify the number for each buffer like ^a + : cat big_file 2> new_buffer_number_2 ^a + 2] 回答1: Maybe you want :readbuf ? ^A :readbuf /path/to/file ^A ] I haven't used 'buffers' in GNU Screen (never knew they existed), but I'm guessing :readreg is the buffer-y version of :readbuf : ^A :readreg x /path/to/file ^A

Python subprocess not executing properly

末鹿安然 提交于 2019-12-11 02:46:11
问题 I am having problems outputting a command to a running screen. Using the following code: import subprocess subprocess.call(["screen", "-S jcmp", "-X stuff", "'kick Jman100'`echo -ne '\015'`"]) returns the following: Use: screen [-opts] [cmd [args]] or: screen -r [host.tty] Options: -a Force all capabilities into each window's termcap. -A -[r|R] Adapt all windows to the new display width & height. -c file Read configuration file instead of '.screenrc'. -d (-r) Detach the elsewhere running

Git autocomplete in screen on mac os

冷暖自知 提交于 2019-12-10 16:52:55
问题 I've using git on mac and I have configured autocompletion as written at http://www.codethatmatters.com/2010/01/git-autocomplete-in-mac-os-x/ It works fine when I do it in pure terminal. But I prefer to use gnu screen program when working in terminal. And in screen when I press tab noting happen. Maybe someone knows how to fix it. 回答1: I don't use screen but I think it will probably work if you put the source ~/git-completion.bash statement in your ~/.bashrc instead of your ~/.bash_profile. I

GNU Screen running a bash init script

浪尽此生 提交于 2019-12-10 13:48:38
问题 I'm sure there is an answer to this in the manual to screen, but I can't find it! I want the bash shell spawned by GNU screen to source in a file in addition to the .bashrc that it already runs. I can't put a call to the file in .bashrc because on our site .bashrc files get regenerated automatically on login. Any ideas? EDIT: I created this little script (screen_bash.sh): bash --rcfile ~/.screen_bashrc Then added shell $HOME/screen_bash.sh To my .screenrc The ~/.screen_bashrc file was <my

GNU screen command not showing status bar

蹲街弑〆低调 提交于 2019-12-10 11:24:17
问题 I am new to GNU screen command. I created .screenrc file in my home directory and added below two lines(source) to display the status bar. caption always caption string "%{= bW}%3n %{y}%t %{-}%= %{m}%H%?%{-} -- %{c}%l%?%{-} -- %D %M %d %{y}%c" but I am not seeing the status bar(after entering into screen mode). When I run source .screenrc , I am getting error "-bash: caption: command not found" . What am I missing here? 回答1: Problem was that, I already started screen and then added the file