Questions tagged [colors]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
20 views
+200

How to restore desktop color settings?

OS is Debian 12. Video driver is Nvidia 525.147.05. I'm trying to play an older game via wine that uses directx. (diablo 2). I launched the game in windowed mode, but when I did so, the colors of the ...
cat pants's user avatar
  • 395
-1 votes
0 answers
40 views

How to play video in retro monochrome

I have been using cool-retro-term. But when I play a video such as with mpv, it plays as per normal, which reminds me it’s current year and I’m not a hacker. How can I play videos in a cringe ...
1toneboy's user avatar
  • 425
-1 votes
0 answers
46 views

Setting Xterm to 8-Color Mode from the Terminal on Ubuntu 22.04

Currently using the GNOME terminal which is in true color mode. Need to switch $TERM to 8-color mode within this terminal [for specific reasons], but so far, no luck. Here’s what I’ve tried: I've run ...
N00B_141's user avatar
-1 votes
1 answer
40 views

iTerm2 color scheme: use alternative background color (41m)

I have set up iTerm2 to change its profile when I ssh to a specific machine. This works as intended (I am using zsh and oh-my-zsh). The main thing I do for this is in my ~/.zshrc file: echo -e "\...
Andreas's user avatar
1 vote
0 answers
94 views

I feel like my :colorscheme is not displayed correctly. There is so much terminology involved. What are vim color modes?

I have a feeling that the :colorschemes I'm using in Vim are not displayed properly. That the colors are corrupted. I think this because I have 3 virtual machines rented from 3 different vendors, two ...
michal roesler's user avatar
0 votes
0 answers
28 views

Why is Nano refusing to use syntax colouration?

I am running Alpine Linux 3.18. I have installed nano 7.2 and nano-syntax 7.2, and my $TERM is set to "xterm-256color", but I'm not getting any syntax colours in Nano. The file is a Ruby &...
Sod Almighty's user avatar
1 vote
1 answer
142 views

Is there any way to enable ansi colors in journalctl logs?

foo.py prints ansi colored output in my terminal Now if I execute foo.pyin a systemd unit and journalctl --all -u foo.service --output cat -f all output is monochrome. How can I journalctl systemd ...
jjk's user avatar
  • 411
1 vote
0 answers
72 views

Why suddenly apt-get output became colored?

I'm trying to get wine. I've been doing instructions from https://wiki.winehq.org/Ubuntu and on sudo apt update I've seen "E: The repository 'cdrom ..." with red "E". Just several ...
Martian2020's user avatar
  • 1,157
2 votes
0 answers
40 views

How to best define nano & terminal colour scheme for light Windows terminals (cmd)?

It has been a usual thing for me to log into my Debian servers via a Windows cmd terminal during daylight. This is why the terminal has white background and black text. Now, when editing a file with ...
bomben's user avatar
  • 479
-1 votes
1 answer
147 views

How does a terminal produce accurate colors?

Background I am using terminals in various settings. Often the color output of programs is not correctly rendered on the screen. The internet is full of recipes for fixing the colors for specific ...
sjdh's user avatar
  • 231
-2 votes
1 answer
66 views

Understanding escapes used for changing text colour

I know that things: To change the output text to red, I need output an escape code like \033[31m. The \ is the escape. The 033 is the ASCII escape code in octal. But my question is, why I need to ...
Magenta's user avatar
2 votes
1 answer
762 views

How to display rgb hex colors on terminal using python?

Using ANSI escape sequence, I can change the color of text that python prints. The example below prints "Hi World" in light blue. #!/usr/bin/python3 print(f'\033[38;5;117mHi World') While ...
un31389's user avatar
  • 21
1 vote
0 answers
48 views

Coloring man pages doesn't work anymore? [duplicate]

I've had this for more than 3 years in my bashrc: man() { LESS_TERMCAP_md=$'\e[01;31m' \ LESS_TERMCAP_me=$'\e[0m' \ LESS_TERMCAP_se=$'\e[0m' \ LESS_TERMCAP_so=$'\e[01;44;33m' \ ...
Enlico's user avatar
  • 1,523
0 votes
0 answers
36 views

Truncate output to terminal width (colour and wide char aware) [duplicate]

I have the alias: trunc='cut -c -${COLUMNS:-80}' This works just dandy when text doesn't contain colours and wide characters. I could play with tput rmam and tput smam, but these don't actually ...
Tom Hale's user avatar
  • 30.1k
0 votes
0 answers
62 views

BASH: Is there a way to READ the current foreground and background color in use? Not CHANGE them... just see what the user is using NOW? [duplicate]

Some background for any who find this later This is a question about colors being applied in the shell. NOT about how to CHANGE said colors (there's a bajillion answers for that). But how to READ them....
NerdyDeeds's user avatar
0 votes
1 answer
135 views

Effect of dircolors

What does dircolors affect. Is it for the ls command only ? Should dircolors be called before defining alias ls='ls --color'?
Vera's user avatar
  • 1,213
4 votes
1 answer
2k views

Getting italics working correctly in tmux

I have an issue that the colors and font don't get produced correctly in tmux. The same output looks different when the command is run outside vs inside tmux. Outside tmux: Inside tmux: As suggested ...
Abhilash's user avatar
  • 329
1 vote
1 answer
39 views

Is it possible for a program to get what colors are being used in terminal? [duplicate]

In terminal I use a white on black. A program appears to expect black on white text or something like that. Because of the use of color to highlight important commands, they force regular text to be ...
traisjames's user avatar
0 votes
1 answer
64 views

Font Effects in 8-Bit and 24-Bit Colour Representations

I want to use 8-Bit and 24-Bit colours in terminal, and have seen some different versions. code="\e[38;5;${if}m" code="\e[38;5;${ir};${ig};${ib}m" I am unsure about the second ...
Vera's user avatar
  • 1,213
2 votes
2 answers
1k views

zsh: How to change the color of all invisible file names in the Mac's Terminal?

I'm using a Mac Silicon with the Ventura MacOS. In the Terminal app, all the file names have the same color. Take note that the default shell is zsh in Ventura, and is the one I want to use. ...
Cham's user avatar
  • 123
0 votes
1 answer
172 views

colorizing commands vs arguments in output of shell

When working with make/cmake scripts you often have to use VERBOSE=1 and look at all the commands run. This is what I do a lot, and its utterly straining for someone just looking for the origin of ...
Kalen White's user avatar
1 vote
1 answer
273 views

set colored-stats ignores $LS_COLORS

Problem Bash <tab> autocompletion ignores $LS_COLORS variable and uses default color values. Setting I have a dircolors file and just the following declarations in .bashrc: eval `dircolors $HOME/...
Karolis Koncevičius's user avatar
2 votes
1 answer
392 views

How to retain color output with custom zsh function?

I am setting up a zsh shell environment and I wanted to try writing a simple function for my own learning purposes: # ~/.zsh-extensions/conda_which # get version in conda env function conda_which { ...
SumNeuron's user avatar
  • 205
1 vote
1 answer
31 views

Concatenating string passed into a control sequence

I have this echo invocation that prints a blue bar in a Bash terminal: echo $'\e[48;2;0;0;255m \e[0m' I would like to pass some variables to it, something like (this doesn't work): ...
user73235's user avatar
2 votes
1 answer
68 views

How can I re{duce,move} the Angry Fruit Salad effect [duplicate]

Above, you can see the output of the kscreen-doctor -o command on Suse Tumbleweed. I tried kscreen-doctor -o | cat to no avail. Short of using a black background as a damage limiting device (still ...
gboffi's user avatar
  • 1,362
0 votes
2 answers
96 views

Not enough arguments for capability `setaf` in OpenBSD

I want to change the text colour in a shell. I can use tput to get the correct escape codes. For example, echo "$(tput setaf 5)My text$(tput sgr0)" outputs My text in a pink-ish tone. This ...
FWDekker's user avatar
  • 101
1 vote
4 answers
2k views

How to "enable" True Color Support and Nerd Fonts in Arch Linux Console

From now on, every time I say "console" I refer to the console you must use in Arch Linux if a desktop environment is not yet installed. I want to "enable" True Color Support in ...
Jimmy Zeng's user avatar
0 votes
1 answer
63 views

Colouring lines in bash variable

I have the following bash function which prints lines from a string variable using colour. I want to use wl="1,5,8" so that lines 1, 5, and 8, are coloured in white. How can I do this? kls ...
Vera's user avatar
  • 1,213
2 votes
1 answer
238 views

How do I enable colours by default for common utilites in PowerShell on (Gentoo) Linux?

I'm currently running Gentoo Linux and have installed PowerShell (app-shells/pwsh-bin) as I am a contrarian. That being said, I am unable to obtain colour by default when running certain commands. ...
JJ Marr's user avatar
  • 23
0 votes
0 answers
39 views

Colouring a bash print statement

I have the following bash print statement which I want to colour blue. local -r sgr="$( tput sgr0 )" local -r wht="$( tput bold; tput setaf 15 )" local -r blu="$( tput bold; ...
Vera's user avatar
  • 1,213
0 votes
1 answer
45 views

Bash function printing certain lines blue

Am having difficulty understanding the following function. It is supposed to colour lines starting with - or with {- using blue. How are not matching lines still printed? kls () { rst='tput sgr0' ...
Vera's user avatar
  • 1,213
0 votes
0 answers
147 views

Color Code Specific Words/Phrases in a Unix/Linux Terminal Regardless of the Command Used that Prints that Word/Phrase

Is there a way in Unix/Linux to always color-code specific words/phrases no matter what made those words/phrases appear as output on the terminal? I know you can write scripts/programs to print out ...
Sacred's user avatar
  • 1
2 votes
0 answers
52 views

Why typing long string into read input with color misbehaves? [duplicate]

I can't seem to move my cursor to the beginning of colored read input when I'm typing a really long string. This below gif shows exactly that, the cursor just stuck on there and I can't move it to ...
Liso's user avatar
  • 131
0 votes
1 answer
155 views

My fish prompt gets messed up when I add more set_color

I've been trying to make a custom fish prompt, but there's one problem that I can't seem to figure out how to fix. I got this to work, but it's not exactly what I want, as I want the ash@cat-box to be ...
Ash's user avatar
  • 1
2 votes
0 answers
101 views

Watch command -d=cumulative gives unexpected behavior with --color

This script gives the expected behavior, highlighting the parts of the date that change: watch -d=cumulative date However this script highlights the entirety of the text instead of just the things ...
Jake's user avatar
  • 21
1 vote
1 answer
805 views

echo -e \e does not print an escape from bash script on macos

I just moved to Mac. I'm using a shared shell script that's running in bash. The script itself works, however it is written to produce colored output, and that is broken. Here's the first two lines ...
Matthias's user avatar
  • 111
3 votes
1 answer
2k views

xrandr: change saturation (less color, more black/white)

I know how to change brightness and gamma with xrandr: xrandr --output eDP1 --brightness 0.8 --gamma "0.90:0.85:0.80" but how can I change saturation, ie decrease the amount of color and ...
Martin Vegter's user avatar
0 votes
2 answers
263 views

convert xterm256 to ansi

I have a program that will only accept ANSI color input but I have reason to feed it the output of a program that outputs xterm256 color codes. Is there a converter? I realize of course that color ...
Ray Andrews's user avatar
  • 2,245
2 votes
1 answer
336 views

How to edit $PS1 variable so that the output of a bash command is another color than the command?

How to edit $PS1 variable so that the output of a bash command is another color than the command? For example, I want the command to be black, and the output to be green. username$ seq 1 3 1 2 3 In ...
Maria A's user avatar
  • 21
0 votes
3 answers
214 views

Linux 9 commands send ANSI/color sequences to monochrome terminal

I'm using a Wyse50 Terminal emulation on Rocky Linux 9. Man pages, help screens, etc., are unusable because the system outputs attribute and color codes that the terminal emulator doesn't understand;...
Darrel Barton's user avatar
3 votes
2 answers
216 views

Bash function colouring from string input matching regex

I have a multi-line string that I use for printing in a bash script. docstring=" Headings -H, -H CNT, -H=CNT, -HCNT, --heading CNT, --heading=CNT Warnings -W, -W CNT, -W=CNT, -WCNT, --...
Vera's user avatar
  • 1,213
0 votes
1 answer
261 views

Change colors of the linux console (not the emulator) [duplicate]

I would like to change the default colors used by the terminal (in particular the blue that is difficult to read with black background). How can I achieve that result? I know this has been asked a lot,...
00M's user avatar
  • 11
0 votes
1 answer
34 views

Split lines (like fmt -w) but on coloured / formatted command line output

I have output from a command (jest, for running automated JS tests) that uses fancy terminal codes to do things like coloured text in its output. I want to trim any very long lines because I run jest ...
Croad Langshan's user avatar
0 votes
1 answer
51 views

Need help determining what causes Zypper --no-color option to be ignored

When I issue zypper --no-color update -y I can still see ANSI codes. Here is a sample of the log: Retrieving package glibc-extra-2.31-150300.41.1.x86_64 ...
user547936's user avatar
2 votes
1 answer
566 views

Why does TERM variable not reflect True Color support in terminal emulators

So using the st terminal emulator the TERM variable is set to st-256color, even tput colors gives me 256. But from multiple sources and the tests I have run, it seems like ST does support TRUECOLOR. ...
Vikash Balasubramanian's user avatar
2 votes
1 answer
710 views

How to remove color from print to make it suitable for piping

I'm piping some Unix commands with my own scripts. The problem is that in my scripts, I'm using colors. Like for example: yellow=`tput setaf 3` reset=`tput sgr0` function Warning() { echo "${...
Alireza Hosseinitabar's user avatar
4 votes
1 answer
356 views

ls command still reads the default configuration even after setting the LS_COLORS

I know there are several related questions asked about this but I could't solve my problem with those. Expected behavior: What I want is to disable all coloring stuff and just make the directories ...
S.B's user avatar
  • 155
6 votes
2 answers
1k views

ANSI terminal color behaves strangely

I am encountering strange behaviour when trying to switch on and off background colors in terminal output: #!/bin/sh printf "\e[48;5;203m" printf "AAA\n" printf "\e[0m" ...
Martin Vegter's user avatar
1 vote
1 answer
1k views

How can I have colored emoji in URxvt?

Let me first clarify that xfce4-terminal does show colored emojis on the very same system for which I ask the question. URxvt, on the other hand, doesn't show them. Based on archlinux wiki, Emojis ...
Enlico's user avatar
  • 1,523
16 votes
2 answers
2k views

How can I keep colouring when piping man to less?

I have this in my .zshrc file export MANLESS="" export LESS="--RAW-CONTROL-CHARS" export LESS_TERMCAP_mb=$(tput bold; tput setaf 5) export LESS_TERMCAP_md=$(tput bold; tput setaf 1)...
Martin Vegter's user avatar

1
2 3 4 5
18