Stack Exchange Network

Stack Exchange network consists of 174 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
12 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
50 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
56 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
12 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
48 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
65 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
36 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
52 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
12 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
40 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
votes
0answers
59 views

Problem: Don't understand certain output of ls colors

Background: When I type in 'ls', the files and directories within a certain directory are listed. Each type of file/directory in a different color. The output is like this: The 4 files/directories ...
1
vote
2answers
28 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
37 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
378 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
22 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 ...
1
vote
0answers
23 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
25 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
21 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
41 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
29 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
31 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
48 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
60 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
37 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. ...
0
votes
0answers
52 views

Weird colors with vim on xfce-terminal

The situation is when I pick any theme or colorscheme for VIM is impossible set correctly on terminal. The background is inconsistent, even the colors changing with regard to gVim. Look: Inconsistent ...
1
vote
1answer
40 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
72 views

How to display bash prompt colors in tmux? [duplicate]

I'm using ubuntu 18.04 and tmux 2.6 echo $TERM in bash returns xterm-256color. In tmux it returns screen-256color On my terminal it looks like this: But when switching to tmux it looks like this ...
0
votes
0answers
11 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
106 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
82 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 ...
1
vote
1answer
31 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
36 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
38 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
148 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
51 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
131 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
62 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
74 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
50 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
0answers
41 views

Print PDF from command line: choose colour profile for pages

I have one network printer setup on my Fedora 28 system as two different printers: Printer-BW is set-up to print in BW Printer-colour is set-up to print in colour all other settings are the same. I ...
0
votes
1answer
139 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@...
-1
votes
1answer
75 views

Linux VT supports 8 colors but there are actual 16 distict ones. Why is so that?

According to Wiki's https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit article there are 8 "Standard colors" and 8 "High-intensity colors". When I checked terminal capability of the Linux' virtual ...
-1
votes
2answers
114 views

Unable to set LS_COLORS in bash using script

I am trying to set the LS_COLORS environment variable using a launcher script. However this variable is not being set. Steps Downloaded LS_COLORS to ~/.dircolors Added TERM=xterm-newTerminalEmulator ...
0
votes
1answer
104 views

Git status: Coloring deleted files

I'm running git 2.17.0 on Cygwin. Doing a git config --get-regexp color shows me .... color.status.added bold yellow color.status.changed red color.status.untracked white color.status.branch bold ...
0
votes
0answers
153 views

Vim color scheme in bash and byobu

I have a problem with the vim color scheme installation. I did the following: 1) a folder was created ~/.vimrc/colors 2) I put the color definition monokai_pro.vim there 3) I edited the file .vimrc ...
0
votes
2answers
33 views

Linux: Create new type in $LS_COLORS

My distro is RHEL. The LS_COLORS variable is made up of things like rs, di, *.tzo, etc. I was wondering how I could add a new extension type. Similarly in what order are the extensions processed. If ...
1
vote
1answer
56 views

Shell: Changing ls color output if folder is Git repo

My distro is RHEL so I have a DIR_COLORS folder and an LS_COLORS variable. I know how to modify the colors. I also know how to check if a folder is a git repo. What I don't know is how to have ls ...
1
vote
2answers
33 views

Process prompt directives inside $psvar without PROMPT_SUBST

I'm using precmd to generate a coloured git status in my prompt. I generate a sting like %F{green}master%f%F{red}%f, and assign it to $psvar[1]. My prompt includes %1v to display the text. However, ...
0
votes
1answer
528 views

Check if terminal supports 24-bit / true color

In a shell script, how can I test whether or not the terminal supports 24-bit or true color? Related: This question is about printing a 24-bit / truecolor test pattern for eyeball verification
2
votes
2answers
100 views

Alternate prompt, command, and output color

I would like to make my terminal more readable by having commands alternate the default text color. Ideally, this would only affect uncolored text. I'm rather new to linux, so any hints to point me in ...