Removing coloured/colored text in terminals?

If none of the more specific forums is the right place to ask

Removing coloured/colored text in terminals?

Postby debianneedstuning » 2018-02-22 03:31

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?
debianneedstuning
 
Posts: 211
Joined: 2012-12-03 02:44

Re: Removing coloured/colored text in terminals?

Postby bw123 » 2018-02-22 04:06

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.
User avatar
bw123
 
Posts: 3088
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Removing coloured/colored text in terminals?

Postby roseway » 2018-02-22 06:52

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
roseway
 
Posts: 1491
Joined: 2007-12-31 22:50
Location: Kent, UK

Re: Removing coloured/colored text in terminals?

Postby Head_on_a_Stick » 2018-02-22 07:02

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 ;)
"Il semble que la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y a plus rien à retrancher."
— Antoine de Saint Exupéry, Terre des Hommes (1939).
User avatar
Head_on_a_Stick
 
Posts: 7572
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Removing coloured/colored text in terminals?

Postby Dai_trying » 2018-02-22 08:20

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.
Dai_trying
 
Posts: 447
Joined: 2016-01-07 12:25

Re: Removing coloured/colored text in terminals?

Postby bw123 » 2018-02-22 15:06

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!
User avatar
bw123
 
Posts: 3088
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Removing coloured/colored text in terminals?

Postby debianneedstuning » 2018-02-25 11:09

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
debianneedstuning
 
Posts: 211
Joined: 2012-12-03 02:44

Re: Removing coloured/colored text in terminals?

Postby debiman » 2018-02-27 07:08

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
debiman
 
Posts: 2408
Joined: 2013-03-12 07:18

Re: Removing coloured/colored text in terminals?

Postby Head_on_a_Stick » 2018-02-27 07:22

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
"Il semble que la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y a plus rien à retrancher."
— Antoine de Saint Exupéry, Terre des Hommes (1939).
User avatar
Head_on_a_Stick
 
Posts: 7572
Joined: 2014-06-01 17:46
Location: /dev/chair


Return to General Questions

Who is online

Users browsing this forum: No registered users and 2 guests

fashionable