New answers tagged

1

The interface between the terminal and the application sends bytes, not keys. Printable characters are interpreted as the byte sequence corresponding to the character encoding of the terminal. Function keys are encoded as escape sequences. There are common conventions for those escape sequences but they aren't completely standardized. For more general ...


2

A few keys are used as modifiers (shift, control are the most used). Terminal emulators receive a series of X events, which you can see with xev. The terminal emulator combines some of those events such as shifta using X libraries to get A. For other cases such as function-keys and cursor-keys (called "special keys") there is no predefined transformation ...


-1

Default shell is related to /etc/passwd such as : grep mohsen /etc/passwd mohsen:x:1000:1000:Mohsen Pahlevanzadeh,,,:/home/mohsen:/bin/bash You can change vi following ways: edit the given file use usermod command use chsh command


0

The reason why an event-script fails to send a "growler" message is that mcabber closes the standard input, output and error streams when it runs an event command. You can see this in hooks.c: if ((pid=fork()) == -1) { scr_LogPrint(LPRINT_LOGNORM, "Fork error, cannot launch external command."); g_free(datafname); return; } if (pid =...


1

How about this: printf '\e[41m%-*s\e[0m\n' $COLUMNS 'Warning text' You could also make it a function to take arguments, add color variables, etc: linecolor () { printf '\e[41m%-*s\e[0m\n' $COLUMNS "$1"; } usage: linecolor 'Warning text'


2

In your loop, there is a short window of time between the "stty echo" at the end of the loop and the "stty -echo" at the next iteration. Keyboard input received during this window will be echoed, even though no read command is waiting for it. If you don't want echoes, don't call "stty echo" 😉


2

The strings aren't actually ANSI sequences. Rather, they started as ANSI sequences, but are translated (due to some scripting error) on your remote machine so that most of the characters are converted to a different form. An ANSI sequence for instance would have escape[A possibly with an optional ; before the A, but the problematic output shows a 133 ([ ...


0

This data very much looks like ANSI escape sequences. Those can be used to switch color of your characters, to change the title bar of your terminal emulator and much more. They work by printing those codes directly to screen and hoping that your terminal emulator understands them correctly. Some (like changing color) are implemented in pretty much every ...


2

Clearing to the end of the line will use the current background color with xterm and Linux console, as well as terminals which copy that behavior. In ncurses that is referred to as the background color erase (bce) capability. When the feature is supported, this provides a way to keep the background for the currently-edited line have a given color. However:...


2

Found the solution myself (in this related question). Use this: echo -e '\x1b[41;37mWarning text\x1b[K\x1b[0m';echo Normal text The documentation says about \x1b[K: K EL Erase line (default: from cursor to end of line). ESC [ 1 K: erase from start of line to cursor. ESC [ 2 K: erase whole line.


1

If you go a few levels deeper then it'll start truncating $ sweh in ~: cd D1 $ sweh in ~/D1: cd D2 $ sweh in ~/D1/D2: cd D3 $ sweh in ~/D1/D2/D3: cd D4 $ sweh in ~/D1/D2/D3/D4: cd D5 $ sweh in ~/.../D3/D4/D5: cd D6 $ sweh in ~/.../D4/D5/D6: Outside of $HOME it appears to truncates earlier: $ sweh in ~: cd /usr/local/share/locale/ $ sweh in .../local/...


0

If an extra initial blank line is acceptable: echo -e "\x1b[41;37m\n\x1b[0m\x1b[41;37mWarning\x1b[0m"; echo "Normal" seems to work. The only explanation I can come up with for the behaviour I see is that it comes down to how the terminal determines which background colour to use for a new line, that would make it likely to work differently if you use ...


5

Never known about the command intel_gpu_time interesting, thank you. This command is part of the package intel-gpu-tools (apt-get install intel-gpu-tools) under Ubuntu and by the look of it the package under RedHat (CentOS) is called exactly the same. So, give yum install intel-gpu-tools a try.


0

CentOS 6 has 2.31.3; CentOS 7 has 3.14.3 (where the feature works). It is not a new feature, having been introduced in 2007: Bug 118967 – single line scrolling with "Ctrl+Shift+ArrowUp/ArrowDown" while 2.31.3 dates from 2010 (a noticeable delay even for the enterprise releases). However, it does not work with CentOS 6 and incidentally, the git-commit logs ...


0

Yes, Conky lua can be a better option. for you to get a desktop widget. But you need to modify it with htop. conky uses top.


0

On more recent versions of gnome-terminal, Shift+Ctrl+↑ and Shift+Ctrl+↓ work for scrolling by line, but I have no way of checking for 2.31.


1

The bindings (whether they appear in the manual or not) appear when you type bind -p For instance (partial listing): "\C-g": abort "\C-x\C-g": abort "\e\C-g": abort "\C-j": accept-line "\C-m": accept-line # alias-expand-line (not bound) # arrow-key-prefix (not bound) # backward-byte (not bound) "\C-b": backward-char # backward-byte (not bound) "\C-b": ...


0

As is pointed out in section "1.3 Readline Init File" of the manual you refer to, the readline library is configurable. Keybindings may be defined either in /etc/inputrc, or in your local ~/.inputrc.


0

try this maybe install brew brew install openssh --with-brewed-openssl --with-keychain-support


0

This is related to another which I answered recently, but the accepted answer in that case is unsuitable: terminal: displaying special characters The first screenshot clearly shows htop being run on a terminal where UTF-8 encoding is not supported, because the misdrawn text should be line-drawing characters. The latter shows it using ASCII characters to ...


0

The commands using dialog do not work because there is no terminal (tty) associated with the at process. Like cron, at is intended to be a noninteractive environment. Since there is no terminal for dialog to interact with, setting TERM does not help. If you happen to be logged in (and have X running), you can make dialog appear in a separate terminal. ...


0

This is an ugly solution based on the annotate-output script of Debian ANNOTATE-OUTPUT(1). Not sure if this is what you are looking for but could be something to start with: #!/bin/bash readonly col=150 # column to start error output add_out () { while IFS= read -r line; do echo "$1: $line" done if [ ! -z "$line" ]; then echo ...


0

tput is left vague and minimal in POSIX because there is a more detailed specification in X/Open Curses: tput - change terminal characteristics (POSIX) X/Open Curses, Issue 7 There appears to be no direct link to an HTML version of the latter (in particular the command-line tput), but it is more detailed (about twice as long). Quoting from the ...


2

Server log says sshd: /etc/ssh/sshd_config: No such file or directory This means the the server is unable to open the file for some reason. Check if the file exists and if it has appropriate permissions (including SELinux labels) ls -lZ /etc/ssh/sshd_config should give you enough information to figure this out (restorecon /etc/ssh/sshd_config should ...


0

That question is actually several questions, and "control characters" addresses only a small part of it, e.g., the progress-bar for curl. More generally, these are common features of terminals (and terminal emulators). Most of these common features are standardized in ECMA-48: Control Functions for Coded Character Sets. However, other features are not. ...


0

I felt bored and I have use for such a script as well so I changed Thomas Dickey's in little ways, not in any drastic way but just e.g. so that you can deal with all sort of file names (even those with newlines) and easily change the separator between the file names (e.g. just set ORS to "\0" to forward it to xargs -z …) #!/bin/sh find "${1-.}" -type f -...


-1

It's because of ip conflict, I have same kind of issue, you should not use the same ip for other vm's. Even if you delete it, ip won't be released. try with another ip in the same network it should work.


2

You can do this using the stat command. Here is a simple script which prints the filenames, with some allowances for embedded blanks: #!/bin/sh find $* -exec stat -f '%m %B %N' {} \; | \ awk '$1 == $2 { \ s=length($1)+length($2)+3; $0 = substr($0,s); print $0; }' The %m and %B are respectively the modified and birth times (which appear to be what ...


1

While I do not condone this practice, I will answer the question on how you would go about sshing into your machine, and what you do with it is your own prerogative. With that being said, a few things you may have missed Use your External IP address, not your LAN/WAN IP. The fact that you are using the Port Checker implies that you have done this part, ...


0

First a bit of relationship advice: If you do not trust your girlfriend, that is not the person for you. Instead of trying to spy on her, work on finding a better match. Second tangent to this, depending on your locality, and this is valid for most any placed with a lick of privacy laws, what you are planning to do is a considered a crime, i.e., recording/...


1

Accounting for the comment that echo only "beeps" my computer, the question is not looking for a way to use echo (or tput bel), but for something like that mentioned in Remotely make the computer beep on built-in speaker. That wouldn't be in the standard CentOS repositories since it is not in Red Hat Enterprise. But there is a package for it on RepoForge, ...


2

As promised in a previous answer, a simple C program. Why not? Boring day. slower.c #include <stdio.h> #include <time.h> #include <stdlib.h> int main(int argc, char** argv) { int delay; char* rem; if (argc > 1) { delay = strtol(argv[1], &rem, 10); } else { delay = 500; } char* line; ...


3

If its just the output of find you need to rate-limit in this manner, then you can just use find's -exec parameter to perform the sleep for each line: sudo find / -exec sleep 0.2 \; -print


1

You will have to do in this way: ubuntu-app-launch dialer-app tel:///###-###-####


5

pv, the pipe viewer, will let you print one line every second, use it like: cat foo | pv --quiet --line-mode --rate-limit 1 (or, shorter, pv -qlL1). In --line-mode, the --rate-limit (-L) flag defines the number of lines per second that will be printed; the higher the number, the faster the output. It should be available in your distro's repositories (e....


6

Answer from thrig's comment on OP. Works very well. Change the decimal after sleep to modify the time between lines. sudo find / | awk '{system("sleep .5");print}' Quit with ctrl+z and then kill the job (when using bash); ctrl+c only exits that line. Edit: Did some research based on a comment below. The suggestion awk '{system(sleep.5)||exit;print}' ...


1

If you know N beforehand, you can use fifo as a semaphore. mkfifo sem; exec 3<>sem rm -f sem Then make each N>1 process read a byte from that &3. Since those bytes won't initially be available, it'll put them to sleep as well. Once N==1 is done sleeping, it can write a N bytes into &3, waking up each process that has been waiting on a byte ...


0

Without seeing a snippet of your code I can only guess that it might be something like this: for k in $(seq $N) do script.sh & done So, in order to wait for the first one to complete before firing off the others you could do something like this: for k in $(seq $N) do script.sh & [[ $k == 1 ]] && wait done If the script ...


1

The pseudo-terminal slave, e.g.,/dev/pts/1 is allocated each time you open a terminal. It can be different if there is more than one terminal that has been opened. Further reading: Control pseudo-terminal (/dev/pts/*) assignments What is stored in /dev/pts files and can we open them?


0

Open Settings Manager -> Keyboard -> Application Shortcuts, click "Add" In the "command" field, enter xfce4-popup-whiskermenu In the next dialog window, press Super_L (The left "Windows" key)


1

You're about to get Thomas Dickey overheated. Ignore the samizdat that has been circulating for years about VT10x terminals. Much of it is wrong. The DEC VT100, VT101, and VT102 implemented a very specific set of functions, which one can learn from reading their doco. That is not what people who go incorrectly bandying around the terms vt100 and vt102 ...


0

If you do not specify the cursor color, xterm will draw the cursor using the reverse of the foreground/background colors on the cell where the cursor happens to be. That's for xterm. Other programs do not behave that way. This is what the xterm manual says: cursorColor (class CursorColor) Specifies the color to use for the text cursor. The default ...


1

This is because your default shell is sh, to use bash, just run bash from your shell. bash To set bash as your default shell: chsh -s /bin/bash or sudo chsh -s /bin/bash yourusername


0

Go to terminal preferances. And then click to "command" bar. Check the "Run a custom command instead of my sell" and write whatever command you want to execute at the startup of your terminal.


0

Found two other python libs to be used https://github.com/camelware/camel-ipsum-python https://github.com/per9000/lorem


0

Usually TERM is passed from your local environment, unchanged, to the remote environment. If you set TERM on the local side when invoking ssh, that will do what is needed. For instance, if the remote end has the terminal description for rxvt (but not rxvt-unicode), that would work well enough for function keys, etc. Assuming bash or some shell which is ...


0

In a desktop environment, you are using X, and the xwininfo utility can show the size of the window in pixels. Also, if you are running on the desktop (and not, for instance, remotely connected), the terminal emulator provides a variable $WINDOWID which you can use as a parameter to xwininfo, e.g., xwininfo -id $WINDOWID and get a listing list this: ...


1

You can use GParted to rename partition. To install GParted use, $ sudo apt-get install gparted Launch GParted -> Unmount the drive -> Rename by setting new label. For more info visit this website.


2

This is similar to How to enable Control key combinations for GNU screen on putty?, but addresses a different aspect. In a quick check, it seems that the problem is a conflict between this line set-window-option -g xterm-keys on and this: set -g terminal-overrides "screen*:kLFT5=\eOD:kRIT5=\eOC:kUP5=\eOA:kDN5=\eOB:smkx@:rmkx@" Dropping the set-window-...


2

The easiest thing to do is to for a permanent result is to give the filesystem a label. The way you do this depends on what filesystem you formatted it as. First find the device it is on: $ findmnt /mnt/d1b2aa11-a3e4-434b-b71c-47a8ac23ac23 TARGET SOURCE FSTYPE OPTIONS ... /dev/sdc1 vfat ... For example, above it is on /dev/sdc1 (check this isn't ...



Top 50 recent answers are included