Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [colors]

It is possible to use colors on the Unix command-line interface.

1
vote
0answers
38 views

Color rm -i prompt messages

I'm looking for a way to apply custom colors to messages emitted by the rm -i command: ~ $ rm -i file.txt rm: remove regular empty file 'file.txt'? I understand that I need to redirect the stderr as ...
1
vote
1answer
11 views

How to override GTK style setting from kde-config-gtk-style for one specific app?

I am quite happy, how my kde on debian handles the theming for gtk apps like firefox or thunderbird. I usually use the breeze-dark or adwaita-dark themes. However, I use one application (moneyplex) ...
1
vote
1answer
25 views

Whois queries with color output

Is there an easy way to make whois queries from the terminal have syntax coloring in the output so it would be easier to read? Something basic like coloring NOT FOUND in red, and field names and ...
0
votes
2answers
43 views

Maintain color from script output for later viewing

I want to save the output from a script so I can view it later. However, when I save the output to a file (script > some/file) and view it later, there's no color, even though script originally ...
1
vote
2answers
34 views

Changing the color and text of the status message seen when starting and stopping a service in RHEL 6.4?

How to change the color and text of the message while you start or stop a service?
0
votes
1answer
32 views

Nano text editor - How to bring back on the syntax coloring?

I am using the Nano text editor. Before, there was color on every command I typed, but now I don't know what buttons I pressed as there are no more colors. How to bring back on the syntax coloring?
0
votes
1answer
20 views

SuperCat can't find configuration

Recently I've downloaded SuperCat but I can't get it to work. There is always a message: can't find a config file Although I've created it in ~/.spcrc/spcrc. Anyone knows what's going on?
2
votes
1answer
22 views

less toggle raw-ness while viewing output

I instinctively type less -R <file> whenever I want to view a file that might contain ansi escape codes (particularly for color). Sometimes if I'm using less in a long pipeline though I forget ...
0
votes
0answers
14 views

GNU Linker Colorization

Compiling code with GCC or Clang can result in some colorful error outputs. Linking code, however, doesn't enjoy the same luxury. It seems like the GNU Linker doesn't support colorized error output ...
0
votes
1answer
16 views

How to make desktop color by xfconf-query in ubuntu18.04 please?

My environment is xubuntu 18.04 64-bit. I use this to set desktop's color: xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/workspace0/color1 -n -t int -t int -t int -t int -s 19018 -s ...
0
votes
2answers
53 views

Display ANSI colours with curl?

I'm currently trying to curl some raw text and have it displayed with interpreted ANSI colours in the Terminal. Currently, when I run curl http://example.com/test.txt (not the actual URL), it simply ...
0
votes
1answer
37 views

ls don't display correct color with bold in xterm [closed]

I use xmonad with xterm, seeing picture below. It displays color in xterm but ls cannot display correct color with bold font. What is showing now: My Xresources is a copy of solarized/xresources. ...
28
votes
2answers
2k views

Inconsistent color output from `ls` command

I teach an Intro to UNIX/Linux course at a local college and one of my students asked the following question: Why are some of the files in my directory colored white and others are gray? Are the ...
0
votes
0answers
39 views

Change text color in PDF files

I want to change some Text-Coloring by regex search in one or more PDFs. for example i want to change the color of all appearances of "A[0-9]+.[0-9]" like A120.1, A600.0 and so on. is it even possible ...
1
vote
1answer
86 views

Bash tab completion colors differ from ls colors

I have LS_COLORS and LSCOLORS both defined, but for some reason, I'm being shown different colors when I use ls versus when I tab complete in bash. I'm on MacOS. I have these lines in my .bashrc ...
2
votes
1answer
29 views

How to have something like head -c but working on colored characters

Looks like head and sed treat color codes as actual characters. How can I get the first n actually visible characters from input?
1
vote
1answer
70 views

How to display ls --color=auto in prompt same as outside of it

When I put $(ls --color=auto) at the beginning of my PS1 it displays all in white and every filename in newlines. But when I call ls --color=auto, it displays in colors and separated by double spaces. ...
10
votes
2answers
531 views

How to keep colored output using sed

I'm using the sed command and I want to keep colored output from the previous command. The output of ls is colored, but the output of sed is not. I'm using OSX. ls -la | sed -En '/Desktop/q;p'
3
votes
2answers
122 views

'less -R' not working

I got this in a file: \033[31mException log And when I do: less -R demo I get no colors: What am I doing wrong?
2
votes
1answer
139 views

How to generate (git) diffs with <n> characters of context?

The --unified=<n> option lets you set the number of lines; is there a way to do the same for characters? example limit the context around the changes to X character(s) when using git diff --...
0
votes
2answers
141 views

Output colored text in all major distros without using non-word color codes (like \033[0;31m)

I found these ways, for example, to output colored text in a simple way to the screen: RED="\033[0;31m" # Red color (via ANSI escape code); NC='\033[0m' # No color (via ANSI escape code); echo -e "${...
0
votes
1answer
120 views

mutt/neomutt - color of 'active' message in index menu [closed]

The mutt documentation (http://www.mutt.org/doc/manual/#color) lists a bunch of color objects than can be modified: color object foreground background However none of these color objects (I tried ...
0
votes
1answer
23 views

color of echo with commands

i have the following command: echo -n $i". "${!ip}" - " ;curl -X POST http://${!ip}:50333/api/v1/version; echo " " I want the output to be green so what i did was echo -n -e "\e[32m$i". "${!ip}" - "...
1
vote
0answers
212 views

Can't highlight words in terminal

I have been using the gnome Terminal for 3 months already, but today I can't highlight the words on the terminal suddenly. I can't do so on nedit as well. When I use the 'find' function in nedit to ...
0
votes
1answer
94 views

Input from readline owerwrites the prompt

So I'm trying to create an interactive bash script, where i can call given options from 1-n or just them like commands. It will end up with a simulated prompt and 'read' is used to get the input, ofc....
0
votes
2answers
23 views

Git: keep color of git stash list --pretty=<..> through a pipe

I have this command: git stash list --pretty="%C(yellow)%h %>(14)%Cgreen%cr %C(blue)%gs" gives output colored, but if I pipe it git stash list <..> | less -R, color disappear in output. ...
2
votes
1answer
61 views

All-round 100% portable terminal color support check

Test for terminal color support using tput #!/bin/sh colors_supported() { command -v tput > /dev/null 2>&1 && tput setaf 1 > /dev/null 2>&1 } I am currently using ...
0
votes
2answers
490 views

Is there a command to display colors when giving hex value in terminal?

How can I display colors in terminal to handle hexadecimal color values ? It can be useful for theming, XResources etc. For example : $ command '#FF0000' // display a red square I use urxvt, i3wm ...
0
votes
1answer
55 views

Colour Errors / Warnings / Information in bash script

So I have the following variables defined in /etc/bash.bashrc: RS="\033[0m" # reset HC="\033[1m" # hicolor UL="\033[4m" # underline INV="\033[7m" # inverse background and foreground FBLK="\...
0
votes
1answer
169 views

Console text red at boot (CentOS 7)

When CentOS 7 is booting, the text becomes red. This happens through IPMI and a direct connected VGA screen. The server seems to be OK, but I would like to know why all console text is red. The OS is ...
0
votes
1answer
21 views

Configuring xterm without access to xrdb on Red Hat 6.10

To give some context, I try to configure an environment in which I just arrived. The targeted development environment is confined on a remote Red Hat 6.10 system, only accessible through putty on a ...
1
vote
1answer
131 views

rxvt-unicode some colors missing on CentOS 7

I have the following configuration. It works fine on Ubuntu 16. However, on CentOS 7, some colors of rxvt are not displayed (just white), and some are totally fine, there is no obvious differences ...
1
vote
2answers
55 views

How can I get colors when executing `bash -c`?

No colors are displayed when running bash -c "ls -l" (CentOS 7.2). I have an obscure reason to want to show the colors after all. Can I disable this... color suppression? For anyone wondering about ...
0
votes
2answers
149 views

How can I make ANSI RGB color codes bold?

I've been learning how to customize my prompt with colors. I understand that you can define red text with \e[0;31m and define an RGB color (in the following example, R=255, G=95, B=255) as \e[38;2;...
5
votes
1answer
582 views

Does grep --color default to =auto or =always?

What is the default color behavior for grep --color if no [=WHEN] is specified? The grep man page states: --color[=WHEN], --colour[=WHEN] Surround the matched (non-empty) strings, ...
0
votes
0answers
127 views

How to vary the amount of red or blue light with xcalib?

xcalib commands follow this structure xcalib -color <gamma> <brightness-percent> <contrast-percent> I then issue two commands as one to try and adjust the amount of red on my ...
2
votes
0answers
35 views

How can I keep colorful terminal output, but disable pagers

On macOS man uses the pager "/usr/bin/less -is" (see man's man page). When I type man , I see colorized output, and I like this. But, I prefer to use the terminal's find commands when using man, and ...
1
vote
0answers
53 views

color filter in linux display stack

is it possible to change the displayed color in a monitor, either in its open-source driver, or other middleware in the display stack of a linux system? i came across this question because i visited ...
0
votes
0answers
37 views

Colorize bash output?

I keep all my git repositories in a single folder, and sometimes I want to get a quick status check on all of them, mostly to make sure I'm not leaving the office without pushing any commits. I ...
0
votes
1answer
78 views

How to grep/sed/awk regex and color in man pages? [duplicate]

If I do man bash | grep read -c the output is 218. But I want to search only for colored regex in man. I still haven't find an approach. Any hint is welcome.
0
votes
2answers
32 views

Copy/paste doesn't work properly when changing prompt colors

Open a prompt, try to do this: type this code: export PS1="\e[1;30m-30-\e[m >" copy it with your mouse (select the code + copy it (I have auto-copy when I select with the mouse enabled)) close the ...
0
votes
0answers
103 views

Tmux: terminal color is different inside tmux

OS: Arch latest zsh: 5.6.2.1 tmux: 2.8.1 TERM: screen-256color Color of vim both in terminal st-terminal and tmux set correctly. But zsh's color - shell's color changed. e.g: do ls in terminal ...
1
vote
2answers
147 views

Syntax highlighting in Vim turned on for user, but off for root

I noticed that when I open a file like ~/.bashrc in Vim as root, the syntax highlighting (SH) when editing a bash script as normal user (blue for comments, orange for keywords, red for numbers, etc.) ...
0
votes
1answer
261 views

Changing the color of colored outputs

My terminal has a white background. When commands print yellow text to the terminal, I can't see the text clearly (due to low contrast). I thought: wouldn't it be great if all the yellow text that ...
-1
votes
1answer
84 views

sct (setcolortemperature) segfaults with cron

Debian stretch user here. I wanted a screen flash every ten minutes. After trying a couple of alternatives (includeing xrefresh) I decided to use sct. It works in shell but does not work with cron. ...
1
vote
1answer
87 views

grep breaks formatting of systemctl

If I call command systemctl without grep, then formatting looks correctly: Now I want to filter only lines with 'yarn', but this time line is broken into two parts: same happens when console is two ...
0
votes
0answers
16 views

Tmux: change color of separated line and spaces between two panes [duplicate]

I'd like to change green color to something else, and spaces between two panes to other value, how could I achieve this?
1
vote
2answers
323 views

Changing the color of git branch output?

In my .bash_profile I have a parse_git_branch function from the internet, and a PS1 to color some of my output. If possible, I would like to make my git branch name colored red, instead of white. ...
2
votes
2answers
132 views

How can I use “source-highlight” with “git show”?

Using source-highlight in conjunction with less works really well, but I'm struggling to see how I can use it with git show because there's no file extension to clue source-highlight about the ...
2
votes
1answer
43 views

tree(1) colours not properly interpeted by watch(1) even with --color option

I am using a simple combination of commands to "monitor" a bit of my filesystem change: watch and tree. Except I want colours and can't get it. Here's what I thought should work: watch --color 'tree -...