TransWikia.com

Use 24-bit color Emacs theme with Raspberry Pi over SSH

Raspberry Pi Asked by charliesneath on October 5, 2021

I am using Emacs on my Raspberry Pi (an RPi Zero W and RPi 4) through an SSH connection with the Blink terminal program on my iPad.

Emacs seems to be limited to 256 colors, but the themes I am using (Dracula is one of them) support 24-bit color. The colors render correctly when using Emacs locally on my MacBook.

Is it possible to use Emacs with 24-bit color when connection to the Raspberry Pi over SSH?

Please let me know if there is any additional information I can provide to help clarify. Thank you!

2 Answers

I was able to get this working. After following the instructions from the Emacs FAQ, I found that I had to run export TERM=xterm-24bits (note the plural ‘bits’) and that enabled 24-bit color when running $ emacs.

If anyone is interested in getting 24-bit color to work over Mosh, you’ll need to build from scratch as described here.

Correct answer by charliesneath on October 5, 2021

I'm not familiar with "Blink" but presume this is not a limitation of that.

After logging in and before you start emacs try:

export TERM=xterm-256color
export COLORTERM=truecolor

The first one is necessary for the second one to work, which should set 24-bit (aka "true color") depth if possible.

I'm not an emacs user either; if this does not work check if the version on the Pi was compiled to use true color in terminal mode. Related to this point, I am an mc user, which can be compiled to support true color and usually is. Unfortunately, the version used in Raspbian/RpiOS (actually, I think Debian derived systems generally) uses an alternate TUI library (slang instead of ncurses) which only implements 256 colors.

Answered by goldilocks on October 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP