on OSX, when I run top sometimes I see some different colors, namely black text....
What does it mean?
What bash setting do I need to change to make these a different color? black is too hard to read with my setup.
It turns out that it was a simple text color in the terminal preferences, I think the title of the setting was 'bold text'
Related
I tried to build some simple custom prompt for zsh inspired by the 'powerline look'. My .zshrc currently looks like:
CLICOLOR=1
PROMPT=$'%K{236}%F{246}%n%f#%B%m%b %k%K{045}%F{236}\Ue0b0%f %F{000}%2~%f %k%F{045}\Ue0b0%f %# '
However, I noticed color differences between the background color of the path and the foreground color of the following triangle (both set as 045), as can be seen in the following screenshot
I thought that something is wrong with my PROMPT variable, but the prompt looks fine in the terminal inside VSCode:
It seems as if Terminal.app is darkening the background color for some reason, but I don't find a way to turn this off.
Is this possible or can I modify my PROMPT in some way that prevents the problem?
EDIT: I use the font "Hack" that can be found here: https://sourcefoundry.org/hack/
Thanks in advance,
Philipp
The problem is that the MacOS Terminal app has a weird feature where it renders text against the terminal's default background differently. If a background color is explicitly specified then the foreground colors are all slightly different to what they are when there is no background color specified or it has been reset to default.
This is the same issue as below. Check there for better discussion and a potential workaround. https://apple.stackexchange.com/questions/282911/prevent-mac-terminal-brightening-font-color-with-no-background/446604#446604
I don't know if this is the right place to post this question, but here goes:
I recently (less than a year ago) made the switch to a mac from my ubuntu setup. One of the first things I changed was terminal.app's background color and opacity. In my old setup, it was a semi-transparent, black window, which I would put on top of other windows, so I could see the code on it, as well as look through it at the window under it. terminal.app on my mac looks like this now. This is great… except when I have to use programs like sphinx or look at man pages.
Some programs have outputs in black font; man pages have entries in black font. Since the background of my terminal.app is also black, this font is rendered almost invisible (seen in the two screenshots below):
Is there any way that I can tell terminal.app to display all black text as some other color?
Isn't that in Terminal's Preferences ?
I am using Bash on WebFaction (web hosting) and would like to change my terminal to default to a different background color than black (probably white, but I'd like to play around with it). How do I do this?
I tried doing this:
cp /etc/DIR_COLORS ~/.dir_colors
(edit .dir_colors)
But I could only find the foreground and background colors for various directories and file types, not a global one. Where should I look?
Sorry, you don't have to do it with Bash. Check your terminal emulator display properties.
Note: The shell (Bash in your case) can change the text and background color, but the property can be lost or changed by further ANSI color codes invocations.
I have been playing with color schemes for terminal VIM and have found something annoyingly frustrating that I have been unable to solve thus far.
I expect the 16 system colors to change. They are obviously configurable. For that reason, I attempted to use the 256-color palette to construct a VIM color scheme that would be the same regardless of the terminal's 16 (configurable) system color palette.
I used only colors from the 256 color palette for everything, including background. However, I noticed that if I open terminals with different background and text colors specified for the terminals, the VIM color schemes appear quite different in the two terminals.
I do not see similar behavior on Ubuntu even when the terminals have different background, foreground, AND system color palettes.
I will happily accept an answer that explains why this happens.
I will be ecstatic if someone can tell me a way around this beyond setting up a specific terminal for each set of color settings I want to use.
By default, ANSI terminals are 16 color devices and the Vim color schemes that work in gvim will not work properly in a terminal.
Some terminals are capable of 88 or 256 colors. You can tell Vim about this by setting t_Co. Of course, 256 colors is still less than full RGB that you have in gvim.
There is a package for vim called CSApprox developed by Matt Wozniski. It lets you use the gvim color schemes with approximate colors.
This is what I use myself.
CSApprox includes a documentation file which explains everything better than I can here.
URL: http://www.vim.org/scripts/script.php?script_id=2390
Good luck.
P.S. about your question However, I noticed that if I open terminals with different background and text colors specified for the terminals, the VIM color schemes appear quite different in the two terminals.
That sounds like the OSX terminal does not separate the color definition from the 256 color xterm palette; i.e. that by manipulating its settings you're messing with the palette or something like that.
Terminals should probably be keeping the 16 color user-configurable stuff separate from the 256 color palette.
Terminal dynamically adjusts some color values to ensure a minimum amount of contrast with the background color. Perhaps that’s what you’re seeing.
Please attach a screenshot showing the two different color schemes. A good script for viewing the available colors is 256colors2.pl.
Please, post screenshots so that we see what you see. It's hard to talk about colors without seeing them or comparing their numerical values.
Well, I'm still on 10.6.8 so I've never enjoyed Terminal.app's ability to display 256 colors.
But, AFAIK, its default 16 colors are not taken from the X11 palette. They are probably hardcoded somewhere and their values are user-configurable anyway. Because of that, I have no idea why changing the default Red value to anything would change the looks of your Vim colorscheme.
However, Terminal.app (like most other terminal emulators) allows you to change the values of Background, Text, Bold, Selection and Cursor. Depending on how your colorschemes are written some of these settings may override parts of your colorscheme, Background, most notably.
I've had my Terminal.app background matching my Vim colorscheme's background for a long while with great results. Well, at least for a 16 color terminal emulator.
The 256 colour mode is still just an indexed palette, the same as the 8 and 16 colour modes. The application simply selects a colour by index from a palette, and it's up to the terminal to decide which colour that will actually be.
That two different terminals happen to pick the same colours for these indexes may just be the fact that within the 216-colour RGB cube there's 6 levels of each component, so the "obvious" natural way to assign those colours would be to pick each from the list (0, 0x33, 0x66, 0x99, 0xcc, 0xff). I'd imagine most terminals will do this, and therefore give the same colours at the same indices.
If two terminals differ it's simply an indication they're using some other method of selecting their actual colours.
If you are using iTerm2 then you may need to change what type of terminal it is reporting.
In your iTerm2 Preferences > Profile > Terminal > Report Terminal Type, set to xterm-256color
In Terminal.app aka Apple Terminal, the colours will change if the background colour is not explicitly set as well.
So with your colour scheme you must set up the default background colour using the Normal colour group, e.g.:
hi Normal ctermfg=188 ctermbg=234
and then you should not see any further changes to colours.
Note: I have only noticed the foreground being affected presumably so that you do not miss any important output ;)
I'd like to change the default font color for comments, which is dark blue to slightly yellow color. It is difficult to read on the black background. I'm using xfce4-terminal, not gvim with GUI.
How do I change only this one color?
So far, I have changed the settings in my ~/.profile file according to "256 colors in vim" using:
if [ -e /usr/share/terminfo/x/xterm-256color ]; then
export TERM='xterm-256color'
else
export TERM='xterm-color'
fi
and
set t_Co=256
in ~/.vimrc.
Most well-behaving colorschemes will respect the background setting.
set background=dark
would change the color of comments from dark blue to light blue, when using the default colorscheme.
:hi Comment guifg=#ABCDEF
Pick your color! If using a color terminal, replace guifg=#ABCDEF with ctermfg=N with N being a color number.
Also type :help :hi for more information.
hi Comment ctermfg=LightBlue
Add this to your .vimrc file which is either in your ~ or the /etc/vim directory. This will make it permanent. I haven't tested this with gvim.
I also have set background=light before I set comment color. I like all the colors it created except for the comments.
After searching you can find a decent reference to Vim regarding this issue especially, at "256 colors in vim".
Start with:
:verbose hi
when actually inside Vim, and editing a file.
Then check out how all of the variables have metadata associated with them. Data returned from there makes it real easy to add the desired modifier types into .vimrc. As an example, these are updates I recently added in order to get rid of dark blue, and not have to be tormented by the light blue:
set number background=dark
syntax on
highlight Comment ctermfg=119
highlight Identifier ctermfg=99AA00
If the objective is to make it more readable in the dark background of the text console, the command below is a wonderful option and easy to remember:
:colorscheme evening
But be advised, it will change other element's colors.
See "Syntax Highlighting In VIm".
set background=dark
or
set bg=dark
are the best solution for VIM users!
There are various color schemes in Vim. The "default" color scheme displays comments in a blue color, which makes it hard to read against a black terminal background. I prefer to use the "desert" color scheme which displays in readable colors.
To enable the "desert" color scheme in Vim, use the command :color desert. If you want to go back to the default use :color default.
You can even update your ~/.vimrc with your preferred color scheme using:
echo 'color desert' >> ~/.vimrc
I had the same question and wanted to edit my Comment color from LightBlue to something more toned down, and, following #Benoit's answer, this worked for me:
hi Comment ctermbg=0 ctermfg=DarkGrey
I saved it in my ~/.vimrc file.
0 = Black Background, i.e. Color Terminal Background: ctermbg=0, and the Foreground text is DarkGrey, i.e. Color Terminal Foreground: ctermfg=DarkGrey.
You can check your color scheme first using:
:!ls $VIMRUNTIME/colors
then try whichever suits you best.