2

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.

4

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.

  • That'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 Jul 5 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 at 9:02
  • No, 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 Jul 5 at 11:16
3

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"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.