Magit uses Horizontal Ellipsis unicode escape "\u2026" (which should display as "...") to mark hidden section. How can I configure the Terminal/Emacs to display them when running in terminal mode (option -nw)? The escape string is shown instead of the visual icon. Maybe I need to install a special font? I'm running emacs 26.1 running inside KDE Kconsole terminal emulator.
I found that I missed this in my .emacs.d configuration:
;; UTF-8 support
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
(from here). The other possibility is to
(setq magit-section-visibility-indicator '("..." . t))
instead (3 char string istead of one unicode char). KDE Konsole itself does support the \u2026 char as can be seen when printing the utf-8 sequence:
printf "\xe2\x80\xa6"
-
Thanks. This solved some broader terminal issues for me where output appeared all garbled. I hadn't until now figured out where the problem was exactly, but this solved it. – Gijs Feb 7 '20 at 9:23
When running in -nw mode, Emacs' display is at the mercy of the terminal emulator. If the emulator is using a font which doesn't have a glyph for the character you want to display, the only solution is to change it to use a different font.
-
1That's true, but it doesn't answer the question. The terminal emulator decides between showing
…
and something like�
and Emacs has no way to know which one it is AFAIK. Emacs decides whether to attempt to display…
or to display\uNNNN
. – Gilles 'SO- stop being evil' Jul 5 '19 at 5:57 -
I fail to see how it doesn't answer the question: the font being used is missing a glyph. Switching to a different font will fix that. (and it's magit deciding to use the unicode sequence, not Emacs) – rpluim Jul 5 '19 at 9:02
-
1No, if Emacs displays
\uNNNN
in a terminal, that's because Emacs has decided to display\uNNNN
. This has nothing to do with the font used in the terminal. If Emacs decided to display the character…
and the font didn't have this character, you'd see something like�
instead, the terminal would not substitute\uNNNN
. – Gilles 'SO- stop being evil' Jul 5 '19 at 11:16