New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
emacs -nw with Solarized Dark iTerm2 theme clobbers background colour #62
Comments
This is something to think about. In 8-color mode, I set background and some others to nil, because we don't have enough colors otherwise. But the tradeoff is that if your terminal is dark, you can't use light in Emacs, and vice versa. The question: is it more important to allow light/dark in Emacs independent of terminal coloring, or to have the proper background (and maybe some more foreground) colors. Perhaps it should be another custom variable? |
Or maybe |
I also suffer from this. I guess it's safe to assume that most people who opt for Solarized theme in Emacs have it also set in their terminals. |
To revisit this: given that the README is so adamant that one sets one's terminal to the Solarized theme as well:
It should deal with that correctly (in fact I'm surprised it doesn't, because it certainly used to). |
I'm a bit confused by this issue now – @bradleywright, if you're using the Solarized Dark iTerm2 theme, shouldn't your terminal be supporting only 16 colors? When in 256-color mode, we just go into “good enough” mode, because we can't match exact colors. And I think in 256-color mode, we need to override the background, because Emacs’ background-mode isn't enough to tell us your background properly matches Solarized (whereas, in 16/8 color mode, we have to assume your term is set up for Solarized colors). What are the behavioral issues you run into when your terminal is set to 16 colors? |
I have set my $TERM to xterm-256colors as suggested by Ethan Schoonover here: altercation/solarized#97 |
@sellout if I explicitly set it to |
So |
I think just |
I am having the same issue with |
|
On Archlinux, using URxvt with the Solarized Dark colorscheme, I can confirm that this bug applies too. When trying to use the Emacs colorscheme, the background goes black. I tried to set |
I also had this issue on archlinux. Here's how I fixed it: I use urxvt with 16 colors and set them to the solarized palette using Xresources. The solarized theme in X11 emacs works just fine, but with -nw its messed up. Investigating what colors are actually used for the scheme in emacs -nw I found that the hex values for 256 color terminals are used. So I checked what piece of code picks the colors and found in solarized-definitions.el: (let* ((index (if window-system
(if solarized-degrade
3
(if solarized-broken-srgb 2 1))
(case (display-color-cells)
(16 4)
(8 5)
(otherwise 3))))) So for me the 16 case should apply, hence I checked what emacs returns for (display-color-cells) : 88. "In addition to the default foreground and background colours, urxvt can display up to 88/256 colours: 8 ANSI colours plus high-intensity (potentially bold/blink) versions of the same, and 72 (or 240 in 256 colour mode) colours arranged in an 4x4x4 (or 6x6x6) colour RGB cube plus a 8 (24) colour greyscale ramp." Thus, as a workaround, I changed the above code to: (case (display-color-cells)
(16 4)
(88 4)
(8 5)
(otherwise 3))) and now everything is fine. hth |
Thanks for the insight into what’s happening, @junaG. That Also, it sounds like the 256 color mode in urxvt could still give the precise ANSI colors we want. Is that correct? If so, I wonder how we could automatically identify that case. Might have to bring back the |
I tried urxvt with 256colors enabled and indeed I get the precise ANSI colors. I have no idea how to identify that case though. |
On Arch x64, I had the same issue; background went black and I got weird colors. Echoing $TERM and checking with M-x list-colors-display, I got 256 colors. Turns out, unlike contrary believe, Arch's urxvt is by default compiled and run with 256 colors. So adding this in my .Xresources and reloading it with xrdb fixed the problem: |
Having struggled with color differences between running emacs and "emacs -nw" on urxvt for some time some observations that might help others hitting this problem (I'm using emacs 24.2 on Funtoo)
I for now will stick with the work-around in number 4, which for me works best. |
@moesasji
Themes like Solarized have reverse color pallets and it's not so easy to tweak it for every environment. The suggested workaround gives me 90-95% compatibility in lower color mode without much bleeding! |
Hi, I am running Ubuntu 12.04.3 with emacs 23.3.1 .I come across the same issue when I setting .bashrc file 👍 export TERM="xterm-256color". |
And I use emacs -nw mode |
What is the definitive answer on this issue? Am I supposed to have an alias that prepend TERM=xterm whenever I want to start emacs in a terminial? |
This should be fixed in c677b26. |
Thanks, latest version works perfect on my rxvt-unicode-256color. |
Background isn't set to
nil
, so the colour of#1c1c1c
(base03
) shows through.TERM
isxterm-256color
, but I get varying behavioural issues withxterm
as well.The text was updated successfully, but these errors were encountered: