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

Questions tagged [colors]

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

0
votes
1answer
11 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
1answer
30 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
29 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 ask the following question: Why are some of the files in my directory colored white and others are gray? Are the white ...
0
votes
0answers
33 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
34 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
33 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
490 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
115 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
132 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
125 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
69 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
19 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
112 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
79 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
17 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
54 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 ...
-1
votes
2answers
288 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 ...
1
vote
1answer
42 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
111 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
15 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
94 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
40 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
88 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
477 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
75 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
29 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
38 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
30 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
63 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
31 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
63 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
80 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
158 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
59 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
54 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
13 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
227 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
108 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
40 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 -...
0
votes
1answer
37 views

Can I configure my .bashrc to highlight the fact that I'm in a Prod directory?

Currently, I'm using the following: export CLICOLOR=1 export PROMPT_DIRTRIM=6 PS1='${debian_chroot:+($debian_chroot)}\[\e[0;31m\]\u\[\e[m\]@\ [\033[01;32m\]\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\...
-1
votes
1answer
123 views

Why does the Solarized colorscheme look different in vim than it does in iTerm2?

In iTerm2, the background color looks like this: While in Vim, the color looks like this (I'm using https://github.com/altercation/solarized): I'd like the first version everywhere. Now, I've never ...
0
votes
1answer
364 views

Neovim colour scheme in Urxvt not rendering correctly

I'm trying to use a 256 color theme in Neovim (this one: https://github.com/ayu-theme/ayu-vim), but can't get it to render correctly on Urxvt, even though it seems to support 256 colors: Here is the ...
0
votes
1answer
80 views

What's the difference between ZSH themes, prompts, and terminal based themes?

I perhaps may have started overthinking this, but I also couldn't find a suitable explanation for it. I recently installed oh-my-zsh and it comes with several themes that change the way the "prompt" ...
1
vote
1answer
179 views

Can the Linux console display 16 colors?

I'm reading the manual page terminfo and I wonder if the Linux console may use the terminal type linux-16color instead of the terminal type linux. prompt% infocmp linux linux-16color comparing linux ...
-1
votes
2answers
82 views

Why is tput failing silently on TERM=vt100

I'm using zsh with iTerm as my terminal emulator on macOS and my environment has TERM=xterm-256color by default. If I run tput setaf 3 it exits with code 0. If I set TERM=vt100 and run tput setaf 3 ...
-2
votes
2answers
113 views

LS_COLORS how persist after sudo su

I have a username created on my machine and the username is added to sudoers file to have root access. My .bashrc file also contains a script which is saying to change the colors for the PS1 and the ...
0
votes
1answer
93 views

Colors in Terminal and VIM with Windows Subsystem

I'm running Debian GNU/Linux through the Windows Subsystem, and I thought it was pretty cool. However, I'm having issues setting up colors in my terminal and VIM. I used to use Ubuntu as a thing to ...
0
votes
1answer
195 views

Bash and Ksh background color - PS1

To change the back color my command is : PS1='\[\033[46m\]' This works fine for bash but in ksh it will but a [] in front of my server. Example : Bash : [USER@SERVER] (in color) Ksh : [][USER@...