New answers tagged

0

Use emacs, start an inferior shell and issue your command. The output will be available in the shell buffer and can be selected using the usual commands. Alternatively, select file in $(find <whatever>); do vi $file; break; done The emacs approach is more practical if you already know the editor. Emacs can run arbitrary "inferior processes", ie. ...


2

In "Bash Get Time", they describe the arguments to date command. screen uses a similar format, but the arguments are different. Check out the "String Escapes" section of the manual (also available in the man page) for details. As far as I can see, there's no way to achieve what you want. Perhaps seconds (%s) will suffice?


2

It will not make a real difference, in the sense that if you run screen (or tmux) and you disconnnect there will be NOHUP signal sent to your application whether you start it with nohup or not. I suggest you try it out by using screen/tmux and just start the program without nohup. Then forecfully disconnect, login and again and reattach to the previous ...


2

I don't believe you can force screen to overwrite the log. It logs to screenlog.%n by default, where %n is the screen window number (so each window has it's own log). If that file exists, it appends to it. However, you can tell screen to use a different filename, including a timestamp, so you'll get a new log file each time, but you'll then need to manage ...


2

It's more useful as screen -dmS name command args - that will start a screen session called name in the background (i.e. detached), and run command args inside that screen session. Without the command args, it will just start the screen session in the background. In either case, you can attach to that session later with, e.g., screen -d -r name. From ...


1

-dmS just enforces these things: It will start detached. -dm And you can name your session. -S sessioname Running as a daemon indicates that it will execute the specified command in the background until execution finishes. Starting screen, then running the command, then detaching should have the same behavior as using -dmS to run the command. I often ...


2

You would only use -dm if you want to run a command in a screen session and not enter it interactively -S is just to give the session a usable name so you can reconnect to it again easily later If you want to use it interactively and don't want to give it a human readable name, you can omit all of those arguments safely. For example, if you just want to ...


0

The link to script-declutter is not working, but it is shown on a webpage: #!/usr/bin/perl -wp # clean up control characters and other non-text detritus that shows up # when you run the "script" command. BEGIN { # xterm titlebar escape sequence $xtermesc = "\x1b\x5d\x30\x3b"; # the occurence of a backspace event (e.g. cntrl H, cntrol W, or cntrl U) ...


1

Normally, screen accepts a command and arguments, so this might work: screen -m -S 'test' nohup ~/<script-to-be-run>.sh Because it is not expecting a variable assignment, and the variable might otherwise be reset, you would probably have to add env to set the variable: screen -m -S 'test' env DISPLAY=:0 nohup ~/<script-to-be-run>.sh'


0

As you've stated, your status line works fine in my own .screenrc - good lookin', too. From within a new screen session, enter ^a to initiate command mode, then enter source $HOME/.screenrc (I've seen ~ fail to work in some instances). If that doesn't work, again from command mode, enter echo $HOME to see where GNU screen thinks your home directory lies.


0

msgwait 0 is an answer to my question UPD: Well, i need to visual compare output from default more and my implementation. To make it faster i created session with msgwait 0, attached another terminal started new window with msgwait 0. After wait each time i calls at "#" stuff " " Both of them scrolls by one screen. It's all i need Sorry for unclear ...


0

This was discussed in a Debian bug report: #435715 Remove window resize from 'putty': The escape code (CSI ? 3 l) sets 80-column mode, forcing a window resize. This is not appropriate for a reset sequence. which was inconclusive because PuTTY's developers did not participate: It seems there was nothing from the putty developers so we will keep ...


4

No there is no chance of losing during compression. Only when the file is complete processed is the source deleted (that is, if you don't specify -k or --keep, in which case the source is not deleted at all).


3

Perhaps you cannot have what you are asking. From the terminal's standpoint: screen is a full-screen (no pun) application just like vi or less. the terminal implements scrolling and an alternate screen. when the terminal is in alternate-screen mode, it does not add to its scrollback area as it would in normal mode. in gnome-terminal (and perhaps some ...


2

I know this isn't answering the exact question you have, but I normally jump to miniterm.py when presented with this kind of device because I've never found a way to do what you want with screen. miniterm.py is minimal like screen and does the 'right thing' by default with \n. On the downside, my fingers don't know how jump around, quit and log, etc, so I ...


0

reset has its place, but clears your screen. If you are running xterm or anything compatible, the shortest, least intrusive thing to use would be printf '\033[?9l' That is not explicitly stated in the Mouse Tracking section of XTerm Control Sequences, but xterm allows you to reset (disable) mouse mode by turning off any of the possible modes that might be ...


0

I stumbled upon this now, 4 years later. There is an alternative perfect for what this question requires: tmux to start a new session, and to attach to it use tmux attach If there are more than one session, use tmux attach -t SESSION_NAME which is available through tmux ls or bottom of the screen.


1

Start tmux as follows: (cd /aaa/bbb; tmux) Now, any new windows (or panes) you create will start in directory /aaa/bbb, regardless of the current directory of the current pane. If you want to change the default directory once tmux is up and running, use attach-session with -c. Quoting from the tmux man page for attach-session: -c will set the session ...


1

If you wish to use screen, use something like: screen -dmS yourscreenname sudo python /path/to/file.py from rc.local to run your program on detached screen. Next, after boot you can attach to it by screen -r yourscreenname from root account. Alternativly - if you only wish to have logs from your program - maybe simpler is redirect output to syslog? ...



Top 50 recent answers are included