Closed c02y closed 5 years ago
Don't know why, I switch to another environment, it works again, the colors of the highlighed line in SPC b b
and marked text are visiable now.
FYI: GNU Emacs 26.2 (build 1, x86_64-suse-linux-gnu, GTK+ Version 3.24.8) Spacemacs develop branch Yakuake v3.0.5 openSUSE Tumbleweed tmux v2.9
I'm having the same issue. What did you do to solve it?
@KPLauritzen I haven't solve it, I just switched to another environment, check the two FYI parts.
@KPLauritzen I solved it by changing theme in configuration in your terminal such as solarized-dark
or use the following configuration in user-config
(when (not window-system)
(progn
;; change the color or current highlighted line
(set-face-background 'hl-line "839496")
;; change the color of selected item in helm list
;; (set-face-background 'region "black")
(set-face-attribute 'region nil :background "#666")
(with-eval-after-load 'helm
(set-face-background 'helm-selection "839496"))
))
Have you tried following the instructions from this guide? https://github.com/syl20bnr/spacemacs/wiki/Terminal
@sdwolfz Yes, the problem of colors is fixed.
But another serious probelm happens again(I mentioned this problem in here https://emacs.stackexchange.com/questions/50546/my-terminal-emacs-displays-weird-characters-u2506-for-unvisiable-characters-i) Emacs in terminal
Vm in terminal:
Hmm... I think you need to select a powerline font for your terminal: https://github.com/powerline/fonts.
I found out that this is the problem of the variable LANG,
$ echo $LANG
en_US
But
$ cat /etc/locale.conf
LANG=en_US.UTF-8
$ localctl status
System Locale: LANG=en_US.UTF-8
...
After I export the LANG to en_US.UTF-8, and problem is gone, and I don't have to do anything from the https://github.com/syl20bnr/spacemacs/wiki/Terminal
I don't know why echo $LANG
returns en_US
. This OS is managed by administrator in my company and a lot of files have been changed, and I've been using Linux for several years, and this is the first time this problem happens to me.
Anyway, if anyone has the same problem, please change your LANG variable to en_US.UTF-8
.
UPDATE:
Actually, only setting LANG
is not perfect, so now I use export LC_ALL=en_US.UTF-8
in ~/.bashrc
In case other issues happen in the future, you may need to put the following three into ~/.bashrc
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
Thanks @c02y, I've added the exports to the wiki page for future reference.
@sdwolfz I'm sorry, this is not perfect, changing the environment variable of LC_ALL/LANG only solved the issue I mention at https://github.com/syl20bnr/spacemacs/issues/12257#issuecomment-494220038
The issue (highlight faces) I posted at the beginning of this page is back again.
And I use MobaXterm to access two OSes, one is openSUSE, one is RHEL7, besides, there are the following info I need to mention:
So this is not the problem of emacs or spacemacs or tmux , this is problem of my RHEL7 itself.
I reopen this issue, and will update it.
UPDATE: Don't know why, it works again, maybe restart tmux?
UPDATE2::
I know the reason now, if you happen to use tmux, please use tmux -2
or tmux attach -2
instead of just tmux
or tmux attach
, just to be safe.
Since after tmux
or tmux attach
, terminal+tmux may not support true colors any longer.
Use https://gist.github.com/HaleTom/89ffe32783f89f403bba96bd7bcd1263#file-print256colours-sh or https://askubuntu.com/a/821161/345798 to test colors on your terminal.
BTW:
You may want to disable loading theme when using spaemacs in terminal, use the following snippet in your user-config
then:
(unless (display-graphic-p)
(disable-theme 'spacemacs-dark))
it works for me, now, emacs in terminal does use the theme of my terminal instead of spacemacs-dark
, spacemacs-dark
is the default theme used my spacemacs if you didn't change dotspacemacs-themes
variable in your ~/.spacemacs
or ~/.spacemacs.d/init.el
Pay attention to my cusor position and color of the highlight line, all my cursors in the following images are in the same position .
GUI emacs:
terminal emacs+tmux without ~/.tmux.conf (TERM: screen) using command
emacs -nw
terminal emacs+tmux without ~/.tmux.conf using command
env TERM=screen-256color emacs -nw
terminal emacs+tmux with ~/.tmux.conf containing only
set -s default-terminal "screen-256color"
using commandemacs -nw
terminal emacs without tmux using command:
env TERM=screen-256color emacs -nw
Conclusion:
Normally
set -s default-terminal "screen-256color"
is in my ~/.tmux.conf, this is the result of aftering using tmux+fish for several years, so this is the best configuration, but terminal spacemacs doesn't work with tmux+screen-256color, how can I fix it?FYI: GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars) of 2019-03-18 Spacemacs develop branch xfce4-terminal 0.6.3 Ubuntu 16.04.6 LTS tmux v2.8