gnu-screen

Git branch name in prompt

给你一囗甜甜゛ 提交于 2019-12-06 21:10:54
问题 I am able to show the git branch name in the shell prompt. But whenever I am using screen I am getting bash: parse_git_branch: command not found and git branch is not shown. Please help me get this in the screen sessions also. I have following in my .bash_profile. parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/ } export PS1="[\W\$(parse_git_branch)]$ " I don't have .git-completion.bash System specs: OS: OSX 10.8.4 Terminal & iTerm2 Screen version: 4.00

Get pid of command ran by screen

馋奶兔 提交于 2019-12-06 16:36:54
I'm developing a Minecraft (Bukkit) server manager. It's porpuse is only to start it, stop it, back it up and check if it is running. The last one causes the problem. If I do like this to get the pid of the server: subprocess.Popen(["screen", "-dmS", "minecraft-server", "serverstart.sh"]) I get the pid of the screen command, not the startup-script. However it seems like the pid is always one underneath the pid of the startup-script, but I suppose this isn't relaiable. How can I get the pid of the java process? EDIT: I tried this, but ps returns with exit code 1 and no child pid. I think this

GNU screen: how to clear scrollback and screen at once

穿精又带淫゛_ 提交于 2019-12-06 15:27:47
I'm looking for a way to clear both the scrollback and the visible screen at once in GNU screen. At the moment I use two separate bindings: C-a, C (which is the default one for clearing the visible text) bind _ eval "scrollback 0" "scrollback 15000" (which clears the scrollback) Can someone point me to how I can do both in one? Turns out you can just do: bind _ eval "clear" "scrollback 0" "scrollback 15000" Note that the order seems to matter: it doesn't seem to work every time if you have the "clear" at the end (it always clears the screen, but not always the scrollback). 来源: https:/

Bind more than one command to single key in screen?

纵然是瞬间 提交于 2019-12-06 12:35:25
how can i bind more than one command to a single key in gnu-screen? I want to combine the two mappings bind c copy bind b eval "writebuf" "exec sh -c 'xsel --clipboard < /tmp/screen-exchange'" to a single one-key mapping. How can this be done? Does anyone know a good tutorial on this advanced configuration/scripting stuff for gnu-screen? Thanks in advance, Chris Pass each command as a separate argument to eval , e.g., eval "echo foo" "echo bar" . In your given scenario, I would think that just adding copy after eval would do what you want. I use bind \# eval focus "resize 130" for example to

GNU screen command not showing status bar

Deadly 提交于 2019-12-06 10:52:22
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? Amaresh Narayanan Problem was that, I already started screen and then added the file .screenrc in my home directory, but active screens are not recognizing the .screenrc file

replacing ssh+screen+editor with emacs

对着背影说爱祢 提交于 2019-12-06 06:51:19
问题 My goal is to remotely write code. So far, I have been using ssh + screen + an editor (e.g. vim). I understand using a local emacs (or vim), one can edit remote files. But once the local emacs is closed and I want to reopen it (or open it using another computer), I would need to reopen all the buffers again. Is there a way to set up a emacs server on the remote machine and I could simply access it using a local emacs client? Which essentially simulate the screen behavior. 回答1: I think you

fish shell - Showing the current command in the window title of screen

久未见 提交于 2019-12-06 03:51:02
问题 I want the current command to be shown in the title of screen (or tmux). I tried following settings but it doesn't work. How can I make it work? .screenrc shelltitle "$ |fish" shell /usr/local/bin/fish .config/fish/config.fish set -x PS1 '\033k\033\\[\u@\h \W]\$ ' 回答1: For fish version 2.1.0 you only have to edit ~/.config/fish/functions/fish_title.fish function fish_title hostname end For version 1.23.1 this doesn't seem to work. If the directories do not exist, first create them: mkdir -p ~

Shell GNU-Screen -X Stuff problems

那年仲夏 提交于 2019-12-05 21:15:22
问题 OPTIONS="java -Xms1024M -Xmx1024M -jar craftbukkit.jar" PROCESS=server01 screen -dmS $PROCESS $OPTIONS nogui # Starting the application screen -x $PROCESS -X stuff `printf "stop\r"` # Closing the application screen -x $PROCESS # Attaching to the terminal of the application The application works fine at the start, however I get problems with stuff 'printf "stop/r"' It seems not to work when I just start up, wait some time and then try to stop it with the command above. But the strange thing is

Using screen in bash script

偶尔善良 提交于 2019-12-05 18:19:07
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 the script from outside screen it just launches the server in that session. screen -r cd ~/servers

Can you make vi “advance” the screen when opened?

天大地大妈咪最大 提交于 2019-12-05 18:00:41
I often work in vi, suspend vi, run something on the cli, and then fg back into vi to work on the results. For instance, fixing errors that showed up when I ran the cli command. However, when I fg vi, vi "wipes" the current terminal buffer and I can't see the "last screenful" of terminal output in the scrollback buffer. Is there some setting in vi (or screen, I use screen) which would help me here? I have searched google for a long time with no answers. I also realize that there are other workflows that solve this problem, but they aren't perfect (run from inside vi means no shell completion,