gnu-screen

Reading gnu-screen logs with vim

隐身守侯 提交于 2021-02-05 08:14:49
问题 Recently I've discovered a wonderful terminal multiplexing tool called gnu-screen. I'm satisfied with it completely. But I've encountered one inconvenience I'd like to improve. 'C-a H' command makes screen log everything to a log file called named 'screenlog.*'. But encodes control characters in a weird way. For example if you open the log file with 'less' you might see some cryptic characters and the log file is unreadable. You have to run 'less -r' or 'less --raw-control-chars' which helps

Command history in mysql client only showing last line of multiline query

旧时模样 提交于 2020-12-01 07:24:58
问题 I'm using Mysql's command-line client in Screen/Tmux, from Bash in OSX's Terminal.app. When using arrow-up to re-display a previously run query that spanned more than on line, AND when the cursor is on the very last line of the Terminal, the command in mysql's command history gets 'truncated', or cut off. This never happens when I use the same tools on my Ubuntu workstation Here's a visual representation of what happens: Typing some query; nothing wrong here. +--------------------------------

Command history in mysql client only showing last line of multiline query

情到浓时终转凉″ 提交于 2020-12-01 07:24:06
问题 I'm using Mysql's command-line client in Screen/Tmux, from Bash in OSX's Terminal.app. When using arrow-up to re-display a previously run query that spanned more than on line, AND when the cursor is on the very last line of the Terminal, the command in mysql's command history gets 'truncated', or cut off. This never happens when I use the same tools on my Ubuntu workstation Here's a visual representation of what happens: Typing some query; nothing wrong here. +--------------------------------

Run screen and command crontab

ぃ、小莉子 提交于 2020-08-05 10:11:11
问题 I'm trying to add a new crontab that open a screen window and execute php command inside this window. What I'm trying: sudo crontab -e 10 0 * * * * screen -d -m php /var/www/script.php This doesn't create a screen, but, if I remove after -m, creates normal. This code returns that I have to run on a terminal 10 0 * * * * screen -d How can I do this? It's possible? Thanks. Edit Figured out. What I had to do is send some commands to attached screen, like this: screen -S sessionname -X stuff

How can I start a remote service using Terraform provisioning?

寵の児 提交于 2020-06-24 07:21:53
问题 I want my Terraform config to provision a server and start the service at the end by invoking a command and keep running it. I tried using nohup and screen using remote-exec: nohup: provisioner "remote-exec" { inline = "nohup sudo command &" } screen: provisioner "remote-exec" { inline = "screen -d -m sudo command" } I check if the commands are running by logging in manually. But they do not keep a process running. These commands do work if I try them manually and invoking them with ssh also

how do you script gnu screen from within a screen session to open new windows and run commands in them?

让人想犯罪 __ 提交于 2020-03-21 05:17:09
问题 From within a screen session, I'd like to run a shell script that opens a few new screen windows in the same session and start running some programs in them. I need a script like this: screen -t newWindow [switch to newWindow and execute a command] screen -t newWindow2 [switch to newWindow2 and execute a command] I don't know how to accomplish the effect I describe in the brackets. Any clues? Please note that this is not a script I'll be running to start a screen session. I need this script

How to preserve emacs colors from regular terminal to gnu screen

早过忘川 提交于 2020-02-01 00:48:52
问题 I'm using OSX snow leopard, for the record. When I use emacs straight from terminal, I have a color set (e.g. for c/c++) that I'm very happy with---green on black, red comments, colored key words... etc etc. Some of this is set in my 'terminal preferences', and some is in my ~/.emacs file (see below). When I run emacs from screen, the basic color-scheme is the same (green on black), but the coloring is different (e.g. comment characters are red, but not the entire comments) -- and really

How to preserve emacs colors from regular terminal to gnu screen

≯℡__Kan透↙ 提交于 2020-02-01 00:47:13
问题 I'm using OSX snow leopard, for the record. When I use emacs straight from terminal, I have a color set (e.g. for c/c++) that I'm very happy with---green on black, red comments, colored key words... etc etc. Some of this is set in my 'terminal preferences', and some is in my ~/.emacs file (see below). When I run emacs from screen, the basic color-scheme is the same (green on black), but the coloring is different (e.g. comment characters are red, but not the entire comments) -- and really

When using vim or less in gnu screen, quitting vim or less leaves a lingering imprint

拟墨画扇 提交于 2020-01-31 04:33:58
问题 On my new Ubuntu system, I start a screen session and edit a file in vim or view it in less. After I quit, the screen doesn't redraw itself, but simply scrolls up to show a command line under all the stuff I was just viewing in vim or less. How can I change this so that quitting vim will return me to the screen the way it was before I invoked vim? 回答1: screen's altscreen (alternate screen) feature is turned off by default. Add this to your .screenrc : altscreen on See: http://www.gnu.org

Bash array as argument inside of screen

故事扮演 提交于 2020-01-24 14:07:06
问题 The below code is is not working as I expect it to. I might be because I am doing this all wrong but I think it may be a quoting issue. #!/bin/bash IFS=$'\n' fortune_lines=($(fortune | fold -w 30)) Screen_Session=$(mainscreen) Screen_OneLiner=$(screen -p 0 -S ${Screen_Session} -X stuff "`printf "say ${fortune_lines[@]}\r"`") for var in "${Screen_OneLiner[@]}" do echo "${var}" done I think I am not quoting something correctly because when I attempt to execute this. I get.. line 5: mainscreen: