New answers tagged

0

Agreeing with @nsg that you cannot do this, it seems that the documentation is lacking. So you can read the source-code for ls, in print_color_indicator, in particular the place where it checks file-suffix, commenting /* Check the file's suffix only if still classified as C_FILE. */ So, no: you cannot fool it by making a directory-name ending with ".jpg"...


0

As I understands it, you can only specify files that ends with a specific pattern, for example *.jpg=01;31 to make jpg-files red. Then of course you can always trick it with something like this *IMG_20150808_202948.jpg=01;31 :)


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.


3

There is more than one problem, seen by making a script of your examples: #!/bin/sh MSG="this is MAJOR stuff" echo "$MSG" | sed -e 's/\(.*MAJOR.*\)/\o033[93m\1\o033[39m/' echo "$MSG" | sed -e 's/\(.*MAJOR.*\)/\033[40;5;95;38;5;202\033[0m/' echo "$MSG" | sed -e 's/\(.*MAJOR.*\)/\o033[40;5;95;38;5;202\o033[0m/' echo "$MSG" | sed -e 's/\(.*MAJOR.*\)/\033[38;5;...


2

You are probably looking for this: sed -e 's/\(.*MAJOR.*\)/\o033[48;5;95;38;5;202m\1\o033[0m/' although it can be simplified with sed -e 's/.*MAJOR.*/\o033[48;5;95;38;5;202m&\o033[m/' Notice change of 40 to 48 what means we want to change background color. If you want background color as black: sed -e 's/.*MAJOR.*/\o033[40;38;5;202m&\o033[m/' ...


1

That particular set of colors is for the "old" style. Lynx is built to support one of these: a "new" style of color with colors assigned to HTML tag types or an "old" style" with colors assigned to links The "new" style is configured with the COLOR_STYLE setting in lynx.cfg: Also known as "lss" (lynx style-sheet), the color-style file assigns color ...


1

I think you need to use 'colorscheme' rather than 'color' in your vimrc and place it in your local vimrc file (~/.vimrc). Also, you are testing this on python files and vim may need some settings to correctly recognise them. Try adding the following lines to ~/.vimrc: syntax on colorscheme dracula filetype indent plugin on


0

As for the color codes, I would use tput: red=$( tput -Txterm setaf 1 ) norm=$( tput -Txterm sgr0 ) bold=$( tput -Xterm bold ) Cf. man tput Then: tail -F myfile.log | sed "s/\(.ERROR.*\)/$red$bold\1$norm/g"


2

The escape sequences used by systemd are hardcoded in the program, like this: #define WHITE_ON_BLACK "\033[40;37;1m" #define NORMAL "\033[0m" static void print_border(FILE *output, unsigned width) { unsigned x, y; /* Four rows of border */ for (y = 0; y < 4; y += 2) { fputs(WHITE_ON_BLACK, output); and making ...


0

The idea of a sed script is okay (and there are several scripts available for this purpose), but the script suggested could be improved: this chunk s/\x1b_[^\x1b]*\x1b[\]//g might be intended to filter out application mode commands. However, the reader is unlikely to find these used, as noted in the xterm documentation: APC Pt ST None. xterm ...


1

For some reason, it was just a Vim issue: when started in tmux, it loaded default colorsheme, but when started from plain terminal, it loaded desert colorscheme but still calling it default when asked via :colorsheme. Forcing :colorsheme default resolved an issue, so I added colorsheme line in my ~/.vimrc and now it's OK. I have no idea why Vim was doing ...


0

Short: if you don't want to start a new xterm, you cannot suppress colors. Long: while you could change TERM to a description which doesn't use color (such as xterm-old), some applications do not use the terminal database. For instance, GNU ls uses its own program, which insists that vt100's are color terminals. Other programs may simply hardcode their ...


2

I wrote a bash function that can show you all the colors, if this helps. function colorgrid( ) { iter=16 while [ $iter -lt 52 ] do second=$[$iter+36] third=$[$second+36] four=$[$third+36] five=$[$four+36] six=$[$five+36] seven=$[$six+36] if [ $seven -gt 250 ];then seven=$[$seven-251]; fi ...



Top 50 recent answers are included