Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Removing coloured/colored text in terminals?

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
debianneedstuning
Posts: 214
Joined: 2012-12-03 02:44

Removing coloured/colored text in terminals?

#1 Post by debianneedstuning »

i've just upgraded to stretch and various results in terminals come back in coloured/colored text which makes it very hard to read.

What is the program that i reconfigure/turn off/remove to have this revert to the black on white that I need?

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: Removing coloured/colored text in terminals?

#2 Post by bw123 »

I haven't tried /etc/terminal-colors.d but it looks interesting.

Code: Select all

$ apropos colors
dir_colors (5)       - configuration file for dircolors(1)
dircolors (1)        - color setup for ls
setvtrgb (8)         - set the virtual terminal RGB colors
terminal-colors.d (5) - Configure output colorization for various utilities
I just figured out yesterday how to control the TERM= variable by using ~/.Xresources (xterm.termName:) and this affects colored prompt. See also ~/.bashrc for color prompt.

I guess different terminals will handle this differently? I use xterm and konsole and settings for konsole are all handled through the gui.
resigned by AI ChatGPT

User avatar
roseway
Posts: 1528
Joined: 2007-12-31 22:50
Location: Kent, UK
Has thanked: 3 times
Been thanked: 4 times

Re: Removing coloured/colored text in terminals?

#3 Post by roseway »

By default, Debian sets up an alias for the ls command like this:

alias ls='ls --color=auto'

If the output of ls is your problem you could try removing this alias or changing it to something else.
Eric

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Removing coloured/colored text in terminals?

#4 Post by Head_on_a_Stick »

debianneedstuning wrote:various results in terminals come back in coloured/colored text which makes it very hard to read
Which terminal emulator(s) are you using? They all have their own configuration methods to set the colour scheme.

What do you mean when you say "various results"? A (link to a) screenshot may help.
bw123 wrote:how to control the TERM= variable by using ~/.Xresources
You should let the terminal emulator set $TERM, forcing it can cause strange problems — we have had _many_ threads over at the Arch forums caused by people doing just that ;)
deadbang

Dai_trying
Posts: 1100
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: Removing coloured/colored text in terminals?

#5 Post by Dai_trying »

like @roseway said there are some useful (or not so useful in this case) options in the file ~/.bashrc that can set (or not) colour options for bash sessions, it might be worth checking them all to see what they are set to.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: Removing coloured/colored text in terminals?

#6 Post by bw123 »

Head_on_a_Stick wrote:
You should let the terminal emulator set $TERM, forcing it can cause strange problems — we have had _many_ threads over at the Arch forums caused by people doing just that ;)
I will sure keep an eye on it, thanks for the tip. I really prefer using defaults when possible, but xterm is still a nasty little black on white mini window by default. It sets TERM=xterm which as you can see by looking at .bashrc bypasses the color prompt. Right now I'm thinking it's easier/better to use the .Xresources setting than start editing my .bashrc because I only want to control xterm/uxterm, not all terminals.

BUT if you know the proper way to set color prompt for xterm (only xterm/uxterm) on stretch, then do share it, thanks!
resigned by AI ChatGPT

debianneedstuning
Posts: 214
Joined: 2012-12-03 02:44

Re: Removing coloured/colored text in terminals?

#7 Post by debianneedstuning »

Update, the coloured text I'm talking about has been turning up from only a few programs run in a terminal after i "upgraded(?)" to stretch. Inxi is one such program that I can rember atm.

comments made here remind me of some of the setting changes I made back in wheezy(?)

I can not rember if I commented/changed any option In .bashrc. Nothing sticks out, but then it was only about coloured prompts.

I may have changed the ls commands in another area. Soz its been a disaster here with hardware since i asked this question, so i've forgotten where I found a few ls options commented out.

The mention of xterms reminded me that I gave up trying to edit all the setrtings for the various xterms available under Debian and set up a few scripts in /usr/local/bin for what I wanted, e.g
/usr/local/bin/xt-16-lg
#! /bin/sh
exec xterm -fg black -bg LightGrey -fa mono -fs 16 &

A series of those covers many eventuallities.
I loath any colour on a black back ground, but some eye problems made black on white very hard on my eyes. So LightGrey is a setting I've mainly stuck with.

The colours come from any rgb.txt on your system. /usr/share/vim/vim80/rgb.txt. was one on mine that I just found.

Fa is typeface that looked good and FS is type size, which was necessary on a 1900x1080 screen.
Try /usr/bin/xfontsel if you really have time to waste choosing a different fontface. Mono works for me from a practical viewpoint.

HTH.


I commented out (#) the line that said

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Removing coloured/colored text in terminals?

#8 Post by debiman »

you could set your TERM variable to TERM=dumb, but that would likely also indice other problems.

tbh, i just cannot understand why somebody wouldn't want to have colours but whatever.

another solution would be to use a _monochrome color scheme_.

if you use xterm (i'm not sure if you answered HoaS' question), you can do that via Xresources.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Removing coloured/colored text in terminals?

#9 Post by Head_on_a_Stick »

bw123 wrote:the proper way to set color prompt for xterm
Change ~/.bashrc so that a TERM value of "xterm" doesn't reset the colour prompt, perhaps?

Failing that, upgrade your shell:

Code: Select all

# apt install mksh
cp /etc/skel/.mkshrc ~
chsh -s $(which mksh)
I use colour in my prompt in xterm, it seems to work:
Image
deadbang

Post Reply