Hot answers tagged

8

The terminal description is named for Linux, which provides its own console emulator (as do several other kernels). Except for FreeBSD, all of the Linux- and modern BSD-platforms get "termcap" by deriving it from the terminfo database in ncurses. Console entries are specific to the systems in which they are implemented (unlike many terminal emulators, ...


6

Use shopt -q: shopt -q extglob && echo enable || echo disable -q option make shopt discard output, and return status to indicate that options set or unset.


6

Just run: $ shopt extglob It will return the current status: $ shopt extglob extglob on $ shopt -u extglob $ shopt extglob extglob off To who all options, just run: $ shopt


6

The kernel's terminal driver (termios) interprets the special keys that can be typed to send a signal to a process, send end of file, erase characters, etc. This is basic Unix kernel functionality and very similar on most Unix and Linux implementations. The stty command displays or sets the termios special characters, as well as other parameters for the ...


6

Your shell's command line editor saved the space. In fact, it saved all of the characters you typed into it that made up the command line. I wonder if you might be under the impression that the shell knows what command to execute by reading back the contents of the screen just before executing the command. That's not the case. Moreover, terminals do not ...


5

Ctrl+C (control character intr): It will send SIGINT signal to a process and usually application gets abort but the application can handle this signal. For example you can handle a signal with signal() function in C Language. Ctrl+Z (control character susp): It will send SIGTSTP signal to a process to put it in background and like SIGINT it can be handle. ...


4

This message comes from (perhaps other places) procps, which does a quick check to determine the screen width for ps command's notion of width. procps makes this check in set_screen_size, e.g., if the screen size is too small to print anything useful: if((screen_cols<9) || (screen_rows<2)) fprintf(stderr,"Your %dx%d screen size is bogus. Expect ...


4

The venerable Gnu Screen can do what you want, but it can't attach to an already running gnome-terminal. You'll need to start screen at work if you want to pick it up later at home. See Session Management specifically.


3

One way is to use a function instead of the alias - put this in your .bashrc or .bash_profile - sreq() { ffmpeg -f x11grab -r 24 -s 1024x768 -i :0.0 -qp 0 -c:v libx264 -preset veryslow $1.mkv }


3

If you have a suspicion that, such a thing, i.e., a long output, to happen, start your session by executing command script this will log all your screen output as well as what you type in to the terminal (caveat emptor, backspaces and other normally unprintable characters will make the file harder to read, if you are not careful). when you are done ...


3

In Debian, that is x-terminal-emulator: sudo update-alternatives --config x-terminal-emulator Further reading: Debian Alternatives System Virtual Package: x-terminal-emulator Debian Policy Manual: Chapter 11 - Customized programs


3

Assuming you're using bash: Try hitting ^Z (i.e., Ctrl-Z) to stop the process, move it to the background, and get another bash prompt. Type fg; not, the former continues the stopped process and returns when it finishes. Alternatively, figure out the proces id of the program you want to wait for, assume it's 2342. In a new shall, type until kill -0 2342; ...


3

If you have fuser installed and have the permission to use sudo: for i in $(sudo fuser /dev/pts/0); do ps -o pid= -o command= -p $i done eg: 24622 /usr/bin/python /usr/bin/terminator 24633 ksh93 -o vi


2

I finally found an although very ugly way to figure out which process occupies the pseudo terminal pts/0. As Superuser I did cd /proc and entered the following bash command: for pid in [0-9]* ; do \ RES=`ls -l $pid/fd/* 2>/dev/null| grep pts/0`; \ if [ -n "$RES" ]; then echo "Process $pid owns: $RES"; fi; \ done This way I figured out that ...


2

That is actually four questions: How do I know their code points? Some sort of regex? How do I count how many character cells a string takes? How do I erase everything that was outputted? OP mentions xterm, but only the last two are possibly specific to xterm. For (1) and (2), the echo command is not much help. You are better off using printf, which ...


2

Probably you cannot. xterm (and the programs which act like it) makes a distinction between mouse operations with/without the shift modifier: the unshifted operations can be programmed, i.e., an application can send an escape sequence telling xterm to send back escape sequences for each mouse click. the unshifted operations cannot be programmed in this ...


2

Perhaps you ran a subshell from an editor, and it left the terminal in the alternate screen. You can test that by tput rmcup which would return to the normal display. While in the alternate screen, some terminals may override the scroll-wheel action by sending up/down cursor escapes.


2

It looks like tmux is doing the right thing for your example: For example, ctrl-shift-right passes as ^[[C (which is the same as the escape sequence of the right key), instead of ^[OC (outside tmux). because the usual connotation of that sequence is that it is the same as cursor-movement sent from the host. A zero parameter is the same as a missing ...


2

If unalias removes the issue (even temporarily) we have confirmation it is an alias. It could be "brute forced" out by adding an unalias ls in ~/.bashrc. echo "unalias ls" >> ~/.bashrc That will get excuted every time bashrc is read and will remove the alias. That will buy you some peace but will not resolve the actual issue that some file is still ...


2

If you don't need to see the output in real time, you can do something like: git push 2>&1 > ~/git-push-$(date +"%Y%m%d-%H%M").log & The above will create a file in your home directory with the date and time you invoked it in its filename (e. g. git-push-20160208-1201.log). You can put this into an alias or shell function so that you don't ...


1

"Raster font" sounds like the Windows command-window (and by the way is not a TrueType font). Linux console fonts can be set, but those are custom-built fonts (not generated or automatically translated from Windows fonts). Unless someone made one of the Linux console fonts to imitate the Windows appearance, you're out of luck. Further reading: How to ...


1

Why don't you just upgrade the alias to a function, e.g function sreq() { ffmpeg -f x11grab -r 24 -s 1024x768 -i :0.0 -qp 0 -c:v libx264 -preset veryslow "$1".mkv } When you type sreq /path/to/filename it would become ffmpeg ..(redacted)... /path/to/filename.mkv


1

The iwm driver is not in the GENERIC kernel. The man page man iwm specifies the methods required to pull the driver in. Either: build a custom kernel load at boot time with /boot/loader.conf load at runtime with kldload The man page does not appear to be online - but it is in the latest snapshot.


1

On your home computer, before starting the job, launch =screen=: screen Then, from work or where ever, ssh into your home machine. Once in a shell, connect to the screen instance running there: screen -raAd That's -r[eattach] -a[ll capabilities] -A[dapt the size of the screen] -d[etach screen if running elsewhere] Do whatever you want to do in that ...


1

Per terdon's request, I am posting this comment as an answer, so that the question can be marked as "answered" Instead of relying on script logging, especially if this will eventually be a cron job, consider sending output and error messages to one or more designated files(s) in your php code. When you run it in cron, it will create a session log ...


1

You can get it from /dev/vcs1 (for the first virtual console (tty1)). cat /dev/vcs1 But chances are those lines are also in a log file. (check /var/log/messages, /var/log/kernel.log, /var/log/syslog for a start). You may also want to check the stdout/stderr of chrome which if you started it with your Windows manager, may be going to some file like ...


1

When you run a new terminal emulator, that creates a new terminal (/dev/pts/NUMBER on Linux). A program doesn't have to be started by that terminal to output there (try running tty in a terminal, then in another terminal run echo hello >/dev/pts/NUMBER). So you can tell your Python script to read and write from the terminal; all you need is to find out ...


1

Linux top has support for a configuration file (~/.toprc) which it can also write from running configuration: start top enable the options you want (colors, update frequency, sort order, statistics displayed, ...) hit W (that is, shift+w) Next time you run top, it will read your configuration and change its defaults to what you asked.



Only top voted, non community-wiki answers of a minimum length are eligible