New answers tagged

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.


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 ...


1

By modifying the line (line 406)... call s:X("Special","799d6a","","","Green","") in the jellybeans.vim file you can change the escape character color in strings. Simply replace 799d6a with the hex color code you want the escape character to be.


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.


2

Actually, the escape sequence starts with the first escape character and ends with the \033\007 (ASCII ESC and ASCII BEL). The 0 is a parameter, corresponding to Ps in the description for xterm, while the text after the semicolon is Pt: Ps = 0 -> Change Icon Name and Window Title to Pt. Ps = 1 -> Change Icon Name to Pt. Ps = ...


2

Those are escape sequences which tell xterm to optionally switch to and from the alternate screen. The question mark shows that it is "private use" (a category set aside for implementation-specific features in the standard). About a third of the private-use modes listed in XTerm Control Sequences correspond to one of DEC's (those have a mnemonic such as ...


3

These are XTerm Control Sequences, so from that list ESC ] is an "Operating System Command", and then down in that section one finds: OSC Ps ; Pt BEL Ps = 0 -> Change Icon Name and Window Title to Pt. The use of unicode (\u...) is a bit odd, though the low number values used here can be looked up in man ascii: $ man ascii | egrep -i '1b|007' ...


0

ESC[?1049h seems to be from the DEC Private Mode Set: Save cursor as in DECSC and use Alternate Screen Buffer, clearing it first. (This may be disabled by the titeInhibit resource). This combines the effects of the 1 0 4 7 and 1 0 4 8 modes. Use this with terminfo-based applications rather than the 4 7 ...


3

This is a terminal independent way of enabling the blinking attribute. If it doesn't work then either you've mis-set your terminal type, it's not enabled in the terminal characteristics, or it's simply not supported: tput blink echo hello, world tput sgr0 The terminfo database is well worth perusing (not bedtime reading, mind) to find semi-readable names ...


0

I find that gnome-terminal and its close relative mate-terminal don't support blink, but xterm does, at least partially. Even then, it only supports slow blink (code 5, not 6) and the text only blinks while the window has focus.



Top 50 recent answers are included