12

These aren't italic, they're the "typographically correct" open- and close-quotes. But they are pretty useless in a shell To disable them globally: System Preferences > Keyboard > Text > uncheck "Use smart quotes and dashes" To disable them in-application, if the menu is available, deselect "Smart Quotes" in the Edit &...


10

In zsh, you don't need to hardcode escape sequences as it has several builtin ways to set the background and foreground colours. You can use echoti setaf to set the terminal ansi foreground colour and echoti setab to set the background one (setaf and setab being the names of the corresponding terminfo capabilities) Assuming your terminal supports 256 colours ...


6

printf "\033[48;5;226mhello\e[m\n" printf "\033[48;2;255;255;0mhello\e[m\n" Support for the more standard variant of the second (RGB) form (which includes an unused "color space identifier" after the 2) is not supported in older versions of the VTE library (as e.g. libvte-2.91 used by Terminator 1.91 on Debian 10).


5

There are two different approaches for a program to send output that is separate from its standard output. One is to output to standard error, and as you suspect, this might be more common on Unix-style environments than on Windows; see Do progress reports/logging information belong on stderr or stdout? for some discussion of this. Standard error can be ...


4

A terminal just sends a stream of characters to the host. For keys in the main alphanumeric section of the keyboard (in ISO 9995 terminology) this is fine and dandy, as they are usually sending ordinary printable characters or C0 control characters. Things are different when it comes to cursor keys, function keys, editing keys and suchlike in the other ...


4

file -- * Here would be code in a Unix shell language. Unix shell language specialising in looking up and starting commands in new processes, passing them arguments and environment variables and plumbing their standard input/output/error streams. The language is rudimentary but has a few fancy features. That line in an example of a simple command in the ...


4

With the Perl Rename utility, $ ls aaaaaa_bb_cccc_ddddd_ee.jpg $ rename -n 's/([^_]*_){2}//' * rename(aaaaaa_bb_cccc_ddddd_ee.jpg, cccc_ddddd_ee.jpg) $ rename -n 's/([^_]*_){3}//' * rename(aaaaaa_bb_cccc_ddddd_ee.jpg, ddddd_ee.jpg) The -n flag tells Rename to output what it would do. If you remove -n, the modifications will be applied. The * will expand to ...


4

When I do the same thing under bash, I am able to disable icanon, but I don't notice any change in behaviour. That's because bash turns the canonical mode off when reading commands from the user (in order to be able to implement line editing features not offered by the terminal driver -- like inserting text, moving the cursor left and right with the arrow ...


3

The rendering issue is caused by null bytes, which are shown as spaces by ANSI editors (and under DOS, presumably, although I haven’t checked). To fix this: tr '\0' ' ' < 67_Calendar_2020_06_June.ans | iconv -f CP437 -t UTF8


3

To eliminate everything up to the second _ rename -n 's/[^_]*[_][^_]*[_]//' * To eliminate everything up to the third _ rename -n 's/[^_]*[_][^_]*[_][^_]*[_]//' * Remove the -n to effectively change the filenames, and not just test.


2

The direct colour and indexed colour ITU T.416 control sequences for foreground are SGR 38:2 and SGR 38:5. The control sequences for background are similarly SGR 48:2 and SGR 48:5. Read § 13.1.8 of ITU T.416. % TERM=rxvt-256color setterm -7 --background "137" | hexdump -C 00000000 1b 5b 34 38 3b 35 3b 31 33 37 6d |.[48;5;137m| 0000000b % If ...


2

You can set PS1 as PS1='C:$PWD>' $PWD is expanded to the current working directory. Add that line to ~/.bashrc to make it permanent.


2

Just tput cnorm affects the cursor. The reset command may not alter that, depending on the terminal description. It's not an explicit step done by reset, but rather something that is usually done for completeness (see tput reset also). If the terminal description used a hard reset, then (depending on the terminal emulator...) one would expect the terminal ...


2

What you are seeing is the attribute string for the terminal. Terminals might respond differently to one or more of these commands. A quick way to reproduce them: $ echo -e '\033[c' In my case, inside Gnome terminal this types 65;1;9c, inside xterm it types 64;1;2;6;9;15;18;21;22c and in the console, after pressing Ctrl-Alt-F1 I get 6c. The strings are ...


2

Alacritty ignores the resource settings, xterm uses them. Those S_xxx names are post-processed with the C preprocessor before xterm sees them. Copying that .Xresources stuff into a file, and trying that shows a problem with the settings (some values are undefined): > XAPPLRESDIR=/users/tom/app-defaults.orig uxterm Warning: Color name "S_base3" ...


1

htop stops updating the display, which is something good to know, but is htop still running [after Ctrl-S was entered]? Yes, absolutely. htop or other command is NOT stopped or frozen by the Ctrl-S. The IXON termios setting does not work like ISIG. Typing the VSTOP (Ctrl-S) or VSTART (Ctrl-Q) characters does NOT send any signal to the process running in the ...


1

As you may already know, XON and XOFF, bound to Ctrl+S and Ctrl+Q by default, are software flow control characters and in principle relics from the old times of paper-printing teletype terminals. They were used at times when a receiving equipment (often a paper printer) sometimes couldn't keep up with the input sent by a remote sender. Nowadays, paper ...


1

rxvt-unicode runs on top of libX11, it doesn't use any high-level UI library like GTK, Qt, fltk, etc. To deal with this issue, install the terminus font and set it in ~/.Xdefaults: URxvt.font: xft:Terminus:pixelsize=32:antialias=false URxvt.depth: 32


1

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m, setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m, Your prompt is not correct for your terminal type. It has hardcoded SGR control sequences for ...


1

Try this export PS1='C:$(pwd)> ' If it works for you, add it to your .bash_profile or .bashrc


1

Argument list too long is the error message that typically corresponds to the E2BIG error code: $ zmodload zsh/system $ syserror E2BIG Argument list too long E2BIG is the error code returned by execve() when asked to execute a command with a list of arguments and environment variable strings larger than supported, or on Linux when a single argument or ...


1

Your $PATH, if you set it to something different from the default PATH, should be set in .bash_profile or .bash_login (if you're using bash which it seems like you are). Not in .bashrc and certainly not in .screenrc and certainly not in /etc/screenrc. You generally want to set this once at login and it gets inherited in sub-shells and processes you start ...


1

SSH supports in session increases/decreases in verbosity! Here's how to decrease the verbosity: At the command prompt, press Enter/Return. This only works just after pressing Enter Type a tilde ~ character. Notice that it doesn't appear in your terminal - this is by design. Type an uppercase V (for "less verbose" - a lowercase v makes the output ...


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