gnu-screen

tmux man-page search highlighting

别来无恙 提交于 2019-12-29 16:28:08
问题 When I search in, for example, man ls while in a tmux session, the search strings don't appear highlighted - the page jumps down so that the search string is on the top line of the buffer, as expected, but it's not highlighted. Doing the same thing in the same shell while not in a tmux session results in highlighted search strings. I have no idea where to start looking to solve this. Any hints are appreciated. 回答1: Based on Less Colors For Man Pages by Gen2ly , here is my man page and how to

To have Vim-like K in Screen for MySQL

て烟熏妆下的殇ゞ 提交于 2019-12-29 08:24:07
问题 This question is based on this thread. Problem: to access MySQL's manual when the cursor is at the beginning of the word by Ctrl-A Esc Ctrl-m where m reminds about M ysql. How can you build a Vim-like K in Screen for MySQL's manuals? 回答1: Assuming you've installed the man pages from MySQL's documentation site: Put the following in /path/to/mysql-help.screen : # mysql-help.screen # prevent messages from slowing this down msgminwait 0 # copy term starting at cursor copy stuff " e " # write term

Bash script that will survive disconnection, but not user break

荒凉一梦 提交于 2019-12-25 11:57:27
问题 I want to write a bash script that will continue to run if the user is disconnected, but can be aborted if the user presses Ctrl+C. I can solve the first part of it like this: #!/bin/bash cmd=' #commands here, avoiding single quotes... ' nohup bash -c "$cmd" & tail -f nohup.out But pressing Ctrl+C obviously just kills the tail process, not the main body. Can I have both? Maybe using Screen? 回答1: I want to write a bash script that will continue to run if the user is disconnected, but can be

Python subprocess.popen wrong pid

时间秒杀一切 提交于 2019-12-25 03:21:37
问题 I'm trying to write a program that monitors gameservers in Python. For that, n need to look up whether the process of the gameserver, which is started in a screen session is still running, and for that, i need it's pid, however, i don't get the pid of the screen session, i get a pid that only exists till the popen session is active. The pid of the screen session is one pid higher than the pid popen's .pid() method returns. I know that this could be caused through shell=True, but i'm running

Execute sh file from Java

与世无争的帅哥 提交于 2019-12-25 00:36:38
问题 I am trying to execute an sh file via the following code (CentOS machine btw) Runtime.getRuntime().exec("sh " + file.getPath()); I use this code for windows and it works fine Runtime.getRuntime().exec("cmd /c start " + file.getPath()); Could it be because I'm using Screen in the .sh file? I am also using the java command to start the server so maybe I need to include these? Here are the contents of the sh file #!/bin/sh BINDIR=$(dirname "$(readlink -fn "$0")") cd "$BINDIR" screen -S

using xargs vim with gnu screen

强颜欢笑 提交于 2019-12-24 16:39:03
问题 I've got a weird problem where if i do something like this in a gnu screen window, that window starts responding in weird ways ls *.cpp | xargs vim After I exit from vim, the screen window doesn't echo any command. It even does not echo CR. Any suggestions? 回答1: Piping changes vim's stdin and causes problems. Try this instead (for bash, zsh, etc.): vim $(find . -name "*.cpp") 回答2: How about vim *.cpp ? Maybe for file in *.cpp; do vim "$file"; done could work too. Edit each file and exit. Or

subprocess ssh command fails for some commands but not others (command works in terminal)

孤人 提交于 2019-12-24 01:28:34
问题 As part of a python script, I am hoping to capture the output of a shell command executed via ssh, namely ssh User@999 screen -list If I execute the above command directly in terminal, I get the results I need. However, when executing through subprocess.check_output as below, I get a non-zero exit status 1 error. I am able to execute other commands via ssh and capture the output without problem. Is there something specific about screen -list that does not like being called in this fashion?

Access SSH client IP address, within a screen session

拟墨画扇 提交于 2019-12-23 20:34:20
问题 Accessing the IP address of a connecting SSH client is possible via environment variables (such as SSH_CONNECTION), as described in Find the IP address of the client in an SSH session In a GNU screen session though, those environment variables are defined by whoever started the screen to begin with. Is there any way to also get hold of the SSH connection information, for someone who enters an already-existing screen session later, like from another host? I can't think of a way to determine

Sending input to a screen window from vim

妖精的绣舞 提交于 2019-12-23 04:14:17
问题 I have a vim function set up where I can highlight a line of text and execute in clojure. Here's the function: function! Clojure_execline() let cl = (getline(line("."))) // ... exec 'clojure -e "' . cl . '"' endfunction The problem with this is that it's slow to start and because it spawns a new clojure session every time I run it, I can't call a function I ran previously. Ideally, I'd like for a hidden repl to be running where I could send input from vim and retrieve the output from as well.

“Must be connected to a terminal error” with screen -x command on a Linux Container

99封情书 提交于 2019-12-21 06:23:39
问题 I am using Linux containers with Proxmox 4. When I am connected on an Ubuntu 16.04 container with: pct enter <id> I run a script with screen and try to watch the process running with: screen -x <processname> I got the error: Must be connected to a terminal error When I connect with: ssh -t <user>@<container_ip> It works, I can attach the display to the screen. How can I use screen -x when I am connected with pct enter ? 回答1: I found a solution that works for same case(https://www.svennd.be