Emacs vterm should default to system theme #312

Open
opened 2026-02-16 17:26:09 -05:00 by yindo · 5 comments
Owner

Originally created by @paralin on GitHub (Jun 26, 2025).

Originally assigned to: @adamdotdevin on GitHub.

Image

@adamdotdevin here is how it looks in emacs vterm now. much better, there are still some stray blue underscore characters though.

Image

Forked from #101

Originally created by @paralin on GitHub (Jun 26, 2025). Originally assigned to: @adamdotdevin on GitHub. <img width="943" alt="Image" src="https://github.com/user-attachments/assets/88609ac5-04be-4589-a807-c9f2d347d3a7" /> @adamdotdevin here is how it looks in emacs vterm now. much better, there are still some stray blue underscore characters though. <img width="444" alt="Image" src="https://github.com/user-attachments/assets/c1abc1b9-2301-4e24-bfe9-7c581e1ec77f" /> Forked from #101
Author
Owner

@unholywhale commented on GitHub (Jul 6, 2025):

@paralin does it just work for you by default? This is how it looks for me in vterm (Emacs 30.1). Also, does scrolling work for you?

Image Image
@unholywhale commented on GitHub (Jul 6, 2025): @paralin does it just work for you by default? This is how it looks for me in vterm (Emacs 30.1). Also, does scrolling work for you? <img width="1072" height="930" alt="Image" src="https://github.com/user-attachments/assets/05a43c2c-44e9-4e7c-b38c-a0a48824c1dc" /> <img width="1079" height="987" alt="Image" src="https://github.com/user-attachments/assets/beaae980-bc9d-4b83-8239-ab85f343a669" />
Author
Owner

@paralin commented on GitHub (Jul 6, 2025):

Looks good now with "system" theme

@paralin commented on GitHub (Jul 6, 2025): Looks good now with "system" theme
Author
Owner

@paralin commented on GitHub (Oct 9, 2025):

Fixed by setting the "system" theme:

Write to ~/.config/opencode/opencode.jsonc

{
  "$schema": "https://opencode.ai/config.json",
  "theme": "system"
}

I would recommend automatically defaulting to this if vterm is detected

@paralin commented on GitHub (Oct 9, 2025): Fixed by setting the "system" theme: Write to ~/.config/opencode/opencode.jsonc ```json { "$schema": "https://opencode.ai/config.json", "theme": "system" } ``` I would recommend automatically defaulting to this if vterm is detected
Author
Owner

@prasanthkrishnan commented on GitHub (Nov 4, 2025):

On doom emacs, I am not able to scroll to the previous page when using open code via libvterm. Any suggestions?

@prasanthkrishnan commented on GitHub (Nov 4, 2025): On doom emacs, I am not able to scroll to the previous page when using open code via libvterm. Any suggestions?
Author
Owner

@WuuBoLin commented on GitHub (Dec 10, 2025):

I have the same question as @prasanthkrishnan.

Additionally, the loading symbols in the bottom-left corner are causing the UI to shift in libvterm (and also in the installation script).
Image

This is a font issue, though, because (U+FF65) is a CJK character that is not present in most Latin fonts. Given the nature of Emacs as an editor, it will fall back to a non-monospace font for that character. Similarly, (U+2B1D) is also not present in most fonts, although it is not a CJK character.

My current solution is to replace both characters with the "Middle Dot" · (U+00B7):

(defvar my-vterm-display-table (make-display-table))

;; Map U+2B1D (Black Very Small Square) to display as U+00B7 (Middle Dot)
(aset my-vterm-display-table ?\u2B1D (vector ?\u00B7))
;; Map U+FF65 (Halfwidth Katakana Middle Dot) to display as U+00B7 (Middle Dot)
(aset my-vterm-display-table ?\uFF65 (vector ?\u00B7))

(add-hook 'vterm-mode-hook
          (lambda ()
            (setq buffer-display-table my-vterm-display-table)))

Preventing the use of characters that are not available in monospace fonts might fix these kinds of issues.

@WuuBoLin commented on GitHub (Dec 10, 2025): I have the same question as @prasanthkrishnan. Additionally, the loading symbols in the bottom-left corner are causing the UI to shift in libvterm (and also in the installation script). <img width="1633" height="66" alt="Image" src="https://github.com/user-attachments/assets/09f25b7c-46f3-4850-9ee2-c29f10117d72" /> This is a font issue, though, because `・` **(U+FF65)** is a CJK character that is not present in most Latin fonts. Given the nature of Emacs as an editor, it will fall back to a non-monospace font for that character. Similarly, `⬝` **(U+2B1D)** is also not present in most fonts, although it is not a CJK character. My current solution is to replace both characters with the _"Middle Dot"_ `·` **(U+00B7)**: ```emacs-lisp (defvar my-vterm-display-table (make-display-table)) ;; Map U+2B1D (Black Very Small Square) to display as U+00B7 (Middle Dot) (aset my-vterm-display-table ?\u2B1D (vector ?\u00B7)) ;; Map U+FF65 (Halfwidth Katakana Middle Dot) to display as U+00B7 (Middle Dot) (aset my-vterm-display-table ?\uFF65 (vector ?\u00B7)) (add-hook 'vterm-mode-hook (lambda () (setq buffer-display-table my-vterm-display-table))) ``` Preventing the use of characters that are not available in monospace fonts might fix these kinds of issues.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#312