11 ms·
I just wanted Emacs to look nice – Using 24-bit color in terminals
- ggm 3y agoI run emacs with minimal colour, so will probably never use this but I very much enjoyed the read. I'm rather used to the garish green of tmux and a small amount of rusty red brown from the amounts of emacs colour left in my life.
- vardump 3y agoJust discovered today standard ANSI escape sequences work on Windows 10 command prompt. Even 24-bit color works fine! Try (not possible to copy paste, see [1]): echo ^[[48;2;255;0;0mHello^[[0m Hello is printed with a red (RGB(255,0,0)) background. "^[[0m" resets back to normal colors. [1]: You can type ^[ (escape) by pressing CTRL-'['. Don't type ^ and [ as separate chars, that won't work.
- teddyh 3y agoJust don’t forget to add DEVICE=C:\DOS\ANSI.SYS to your C:\CONFIG.SYS file.
- zadjii 3y agoYou haven't needed to do that for like, 7 years now. RGB color support was added to the windows console in 2016: https://devblogs.microsoft.com/commandline/24-bit-color-in-the-windows-console/ https://devblogs.microsoft.com/commandline/24-bit-color-in-t...
- account42 3y ago> [1]: You can type ^[ (escape) by pressing CTRL-'['. Don't type ^ and [ as separate chars, that won't work. You can also use the \x1b escape code(or the \e alias) together with a command that accepts escape code in order to avoid nonprintable characters on the command-line: echo -e '\e[48;2;255;0;0mHello\e[0m' For scripts, always use printf though since echo -e is nonstandard and even plain echo differs in edge cases: printf '\e[48;2;255;0;0mHello\e[0m\n'
- vardump 3y agoPlease note I was talking about Windows 10/11 command prompt. Your tip works on Linux.
- bloopernova 3y agoDigging around in terminfo is like holding a flickering, flaming torch up to some hieroglyphics in some deep catacomb. It's weird to think just how much complexity goes into a terminal application. Makes me even more grateful to the devs behind iTerm and Kitty (and all the others!) EDIT: for iTerm+zsh, I collected some functions for setting tab colors: https://gist.github.com/aclarknexient/84ebe33c1879f92168530487528802c4 https://gist.github.com/aclarknexient/84ebe33c1879f921685304... EDIT2: Contrast terminfo with the old-school method of connecting to HTTP or SMTP with telnet. Yeah, it's simple text but that text is being displayed by a complex application that supports all sorts of wild stuff!
- vidarh 3y agoI use my own terminal, and early made the decision not to give a shit about terminfo, pretend to be rxvt, and deal with the fallout (now, admittedly, the only user I care about for my terminal is me - at least for now). Modern terminals supports enough of a shared subset that it's less painful doing that than having to deal with applications get all confused because they don't recognize your TERM variable, to the point where I've typically found the closest match whenever I've used a less common terminal in the past too. (This matters less if you don't regularly ssh into new systems, of course)
- bloopernova 3y agoThat's fascinating! Did you have a specific itch you wanted to scratch by writing your own terminal? Or was it a learning project that you found useful?
- vidarh 3y agoA combination of a procrastination project, wanting a pure Ruby library I can use for output from hybrid applications (e.g. my editor) to be able to have a mostly terminal UI but being able to add in limited graphics when available, and wanting a testbed for other terminal changes I want to experiment with in terms of creating more of a hybrid UI. A basic terminal can be fairly small - mine is ~1800 lines of Ruby at the moment, which I consider disappointingly large. For comparison st is ~8k lines, I think, and xterm is ~88k. But you can do a working terminal in far less than my 1800, even in more verbose languages, so it's a nice space to play in where you can get something that works in very little (set TERM to a dumber terminal than rxvt, dump any escape sequences your terminal doesn't yet understand to a log, and run the apps you need, then iterate...), and build up in whichever direction you want to something quite usable very quickly. Then you can spend a lifetime polishing quirky little details nobody with you will ever care about... ;)
- electroly 3y agoI suspect the author would have had a better time had they known to do "export COLORTERM=truecolor". This is mentioned in a footnote in the linked Emacs document about detecting truecolor support, and it appears in their Konsole screenshot, but I suspect it got lost inside their layers of terminal multiplexers (as, I find, it often does). It lets you skip past all this hard stuff straight to the part where the app understands that you want true color. A terminfo database isn't even required.
- bhaak 3y agoIndeed. Going down the terminfo road lies madness only. This is partly due to the maintainer of ncurses being somewhat ... conservative and the new fangled terminal devs wanna move things fast.
- Sjonny 3y agoCOLORTERM is also a very weird thing. Most of the time I don't need it to be defined, but when using a screen session it suddenly looks very crappy when COLORTERM is set to truecolor. Removing the env var makes it look all normal again.
- bhaak 3y agoDoes your screen even support 24bit colors? If unsetting COLORTERM fixes the display problem then it is a program issuing 24bit colors but the terminal (in your case screen) not understanding the escape sequences.
- spudlyo 3y agoTmux supports 24-bit color. I bit the bullet and switched a few years ago, and my muscle memory remains exactly the same. I'm incredibly happy with the power, flexibility, configurability, and reliability of Tmux.
- Paul-Craft 3y agoAlternatively, just use your favorite GUI Emacs with either `tramp` or `sshfs`.
- okasaki 3y agoOne of the most frustrating things about terminal Emacs is figuring out how to get nice colors in tmux. By the time I get it working finally, I have no idea which combination of the tens of things I did made it work.
- ParetoOptimal 3y agoWhat features aside from session persistence do you use tmux for? I partially moved to emacs because I was annoyed with tmux/screen.
- okasaki 3y agoWindows, panes, a nice bar with the time, scrolling.
- NoThisIsMe 3y agoYou can get all of that with just Emacs tho
- okasaki 3y agoI guess but tmux is installed on every system I connect to, and emacs is not. Some systems only have ancient versions of emacs available in repos, limiting packages I could install.
- mksybr 3y agoYou don't need emacs on the other end to get those features, connect over SSH with TRAMP.
- dmm 3y agoI really want to use TRAMP. Basic editing works but I had a lot of trouble getting lsp based programming modes, like rustic, working. Maybe I should try again. Terminal mode works but requires a lot of workarounds and copy/paste integration isn't perfect.
- sph 3y agoThe best thing about Emacs compared to vim/neovim is that it has first-class GUI support that's not simply a terminal emulator in a window. I know about gVim and hundreds of half-baked neovim frontends, but the default way of running emacs is through a bonafide GUI, and I love that. Terminals are alright, but they have too much historic cruft and limitations that actually do not make any sense in this day and age. If your issue is running Emacs on a remote server, there's TRAMP and emacsclient (does it work over TCP?)
- hazebooth 3y agothis 10,000,000,000%!! (dr stone ref.) I love modal editing and vim a ton, but I couldn't stand the half baked solutions terminal editors gave me. We have an entire rich graphical platform, why not use it?
- smohare 3y agoThis depends heavily on your workflow. For example I use vim almost exclusively for editing files, and drop back into the shell to use external tools (e.g., git, linters, formatters, debuggers, file tree manipulation, etc.) So my terminal emulator is already the main application. For this workflow the lack of a dedicated GUI is almost immaterial.
- drivers99 3y agoThe great thing about running everything in a terminal is you can copy anything that is shown in the terminal. Frustrating when a GUI app won't let you copy some text it's showing and you have to retype it somewhere else by hand
- NoThisIsMe 3y agoThis is not an issue with Emacs though, GUI or otherwise, because everything's just a buffer
- jimmaswell 3y agoMany dialogs that look uncopyable actually support ctrl-c, sometimes even giving some funny ascii art of the buttons.
- hollerith 3y agoI want to make sure that people understand that you do not have to use a terminal to interact with Emacs: instead, you can use one of Emacs's "graphical" front ends for MacOS, Windows, X.org or Wayland. Visually, graphical Emacs looks so much like Emacs running in a terminal that if the tool bar has been turned off (and most users decide to turn it off) most non-users of Emacs will assume (incorrectly) that a graphical Emacs window they see running on a colleague's computer is a terminal window (unless perhaps the window is currently displaying an image). (Graphical Emacs is an image viewer among other things.) In a survey of Emacs users, 80% said that they use one of the graphical front ends.
- s1gnp0st 3y agoRight. There's also the sophomorically named "TRAMP" for connecting from a locally hosted emacs session to files across a wide range of protocols including ssh.
- spudlyo 3y agoTRAMP also exhibits a wide range of performance problems. Getting it not to hang the display of the buffer list or lock up Emacs completely for minutes at a time requires a deep dive in to a decade of Stack Overflow breadcrumbs. I've done this, and I'm still not completely satisfied with the performance. I do however love the concept.
- db48x 3y agoNo, it requires only one thing: turn on persistent SSH connections. This means that new SSH connections to the same server do not actually require opening a new TCP connection, do not require negotiating new session keys, and do not require additional authentication. To turn this on, add these settings to your ~/.ssh/config file: ControlMaster auto ControlPersist yes ControlPath ~/.ssh/control/%C You should also use key–based authentication so that TRAMP never has to ask for a password, but this is less important once you are using persistent connections. Add something like this to your ssh config: Host orod-na-thon Hostname 192.168.2.133 User db48x IdentityFile ~/.ssh/id_ed25519_your_private_key Now go to Emacs and open up /ssh:orod-na-thon:~/.ssh/authorized_keys. This is the TRAMP path for your authorized_keys file on the machine named orod-na-thon. It will ask you for your password. Paste in your public key (which you can get by opening up the .pub file that goes alongside the private key in ~/ssh), and save it. Now future connections to orod-na-thon will be able to authenticate automatically using this key pair, and there will be no password prompt when you open a file there.
- barrkel 3y agoI found it easier to tune the 16 color palette in each of my various terminal apps than to try and get application-side terminal codes just right. In my ~/.Xdefaults for rxvt-unicode: ! yellow Rxvt*color3:rgb:F5/79/00 ! magenta Rxvt*color5:rgb:AD/7F/A8 ! cyan Rxvt*color6:rgb:88/8A/85 ! white Rxvt*color7:rgb:BA/BD/B6 ! ... And in my custom theme .el: (if (display-graphic-p) (setq color-yellow "#f57900" color-bright-yellow "#fce94f" color-red "#ff6464" color-bright-red "#ef2929" ... color-cyan "#888a85") (setq color-black "black" color-white "white" ... color-bright-magenta "brightmagenta")) I then use these to set various faces `(minibuffer-prompt ((t (:foreground ,color-blue)))) `(highlight ((t (:background ,color-bright-yellow)))) `(region ((t (:background ,color-bright-blue)))) `(shadow ((t (:foreground ,color-bright-cyan)))) `(secondary-selection ((t (:background ,color-bright-magenta)))) etc. As a bonus, colored `ls` output etc. is nicer too. The raw 16 color palette is too saturated and often has bad contrast.
- loeg 3y agoYep. I just tune the 16-color palette in Terminology (it's an INI file) to my preferred theme for the same styling in the console and terminal applications (vim).
- jszymborski 3y agoYah, I do pretty much the same thing. The default colours are far too dark for the dark background, so I just increase the luminance of all the colours.
- rollcat 3y ago> (if (display-graphic-p) This right here. Emacs actually supports graphical output (X11, Cocoa, Win32). Additional bonuses include: Esc is actually Esc; you can bind Ctrl+Shift or Cmd; you can use more than one font at a time; you can display a picture; change the shape of the cursor... It's like a time machine that takes you 20 years forward - into 1989.
- 3y ago
- moyix 3y agoMy guess is that widespread 24-bit support in terminal apps is still held back by the fact that the macOS terminal still doesn't support it. As far as I can tell nearly everything else does :(
- lxgr 3y agoIs that really a good reason to not support it? It seems possible to offer graceful degradation for non-supporting terminals, and I'd be surprised if the number of Terminal.app users that would even notice the difference would be that high: Surely everybody who cares about a good terminal experience uses some third-party client already? Then again, maybe I'm underestimating managed/corporate devices that don't allow third-party terminal emulators, since they do have quite critical access in the end.
- moyix 3y agoIt's the default, which means it has a lot of people use it. And IME the alternatives on mac aren't very good.
- alwillis 3y agoIME, this is like the golden age of terminal apps in general and macOS-compatible ones in particular. There are several really good terminals for macOS: iTerm2: (https://iterm2.com/ https://iterm2.com/) Kitty terminal (https://sw.kovidgoyal.net/kitty/ https://sw.kovidgoyal.net/kitty/) WezTerm termina (https://wezfurlong.org/wezterm/index.html https://wezfurlong.org/wezterm/index.html) Alacritty (https://github.com/alacritty/alacritty https://github.com/alacritty/alacritty) My daily driver is WezTerm… - Runs on Linux, macOS, Windows 10 and FreeBSD - Multiplex terminal panes, tabs and windows on local and remote hosts, with native mouse and scrollback (https://wezfurlong.org/wezterm/multiplexing.html https://wezfurlong.org/wezterm/multiplexing.html) - Ligatures (https://github.com/tonsky/FiraCode#fira-code-monospaced-font-with-programming-ligatures https://github.com/tonsky/FiraCode#fira-code-monospaced-font...), Color Emoji and font fallback, with true color and dynamic color schemes (https://wezfurlong.org/wezterm/config/appearance.html#colors https://wezfurlong.org/wezterm/config/appearance.html#colors). - Hyperlinks (https://wezfurlong.org/wezterm/hyperlinks.html https://wezfurlong.org/wezterm/hyperlinks.html) - Searchable Scrollback (https://wezfurlong.org/wezterm/scrollback.html https://wezfurlong.org/wezterm/scrollback.html) (use mouse wheel and `Shift-PageUp` and `Shift PageDown` to navigate, Ctrl-Shift-F to activate search mode) - xterm style selection of text with mouse; paste selection via `Shift-Insert` (bracketed paste is supported!) - SGR style mouse reporting (works in vim and tmux) - Render underline, double-underline, italic, bold, strikethrough (most other terminal emulators do not support as many render attributes) - Configuration via a configuration file (https://wezfurlong.org/wezterm/config/files.html https://wezfurlong.org/wezterm/config/files.html) with hot reloading - Multiple Windows (Hotkey: `Super-N`) - Splits/Panes (Split horizontally/vertically: `Ctrl-Shift-Alt-%` and `Ctrl-Shift-Alt-"`, move between panes: `Ctrl-Shift-ArrowKey`) - Tabs (Hotkey: `Super-T`, next/prev: `Super-Shift-[` and `Super-Shift-]`, go-to: `Super-[1-9]`) - SSH client with native tabs (https://wezfurlong.org/wezterm/ssh.html https://wezfurlong.org/wezterm/ssh.html) - Connect to serial ports for embedded/Arduino work (https://wezfurlong.org/wezterm/serial.html https://wezfurlong.org/wezterm/serial.html) - Connect to a local multiplexer server over unix domain sockets - Connect to a remote multiplexer using SSH or TLS over TCP/IP - iTerm2 compatible image protocol support, and built-in imgcat command (https://wezfurlong.org/wezterm/imgcat.html https://wezfurlong.org/wezterm/imgcat.html) - Kitty graphics support - Sixel graphics support (experimental: starting in `20200620-160318-e00b076c`)
- __alexs 3y ago> The first edition of ECMA-48 is lost to time, Apparently there is a copy in Germany https://search.worldcat.org/title/1069189730 https://search.worldcat.org/title/1069189730
- worksonmine 3y agoInteresting, as a Vim user I'm surprised Emacs doesn't have better theme support. I always assumed it had everything. In modern Vim there's even hex support.
- rlonstein 3y agoI'm not sure why you say that. https://www.gnu.org/software/emacs/manual/html_node/emacs/Custom-Themes.html https://www.gnu.org/software/emacs/manual/html_node/emacs/Cu... and https://emacsthemes.com/ https://emacsthemes.com/ exists.
- worksonmine 3y agoI got that impression from the article because of the length he went with ANSI escape codes. I wouldn't touch that other than for my PS1. But I see now there are sane options and the author probably just wanted some fun.
- flexagoon 3y agoEmacs does support hex colors in themes as well
- matheusmoreira 3y agoThat timeline is very enlightening and those references are extremely useful. Must have taken a lot of time to find and make sense of all that material. I'm especially thankful for the explanation of terminfo files. > We used semicolon (like other SGR parameters) for separating the R/G/B values in the escape sequence, since a copy of ITU T.416 (ISO-8613-6) which presumably clarified the use of colon for this feature was costly. Non-free standards are self-defeating. What's the point of the standard if the people who need them to implement stuff can't read them?
- volemo 3y agoI get that the post is about terminal witchcraft, but regarding the Emacs part I believe you, author, ought to look into TRAMP mode.
- psanford 3y agoI tried using kitty recently. Its really neat, until you try to sshing somewhere. If the remote system doesn't have kitty in its terminfo, nothing works. Kitty's "solution" to this is to use a custom ssh wrapper, which I'm sorry, is not an acceptable solution. A simple solution would be to let users override what TERM gets set to, but they refuse to allow this on some moral ground. Maybe I'll try it again in a few years when its in more terminfo packages.
- IshKebab 3y agoYeah that's silly. TERM is as broken as web user-agents. You just have to accept that and `export TERM='xterm-compatible, like xterm-256color, like gnome-terminal'` or whatever :-D
- jrockway 3y agoI just type 'export TERM=xterm' whenever I log onto one of these systems (I use tmux-direct as my $TERM). It seems like Debian 12 has a lot of newer terminfos these days in the default install, and I've tried to upgrade most places I ssh to that. Like our CI system can take a Docker image as the place where your code runs; so instead of using the default one from 2018 or whatever, I just made my own that has all these niceties. (I use kitty on Mac and Windows Terminal on Windows, but it ends up not mattering because I'm always in tmux, so that's the terminfo that remote machines need. I never bothered setting up 24 bit color though, so I have no idea if that would work with my setup. I switched to TERM=tmux-direct to get italic fonts in Emacs running on Linux inside tmux inside an SSH session from Windows Terminal. It works!)
- db48x 3y agoWhy not just install Kitty’s terminfo file on the remote server? This is quick and easy to do, and only needs to be done once.
- vulcan01 3y agoThat is what kitty's "custom SSH wrapper" does, if I understand correctly. Each time you ssh into a server, it will copy kitty's terminfo file if it doesn't already exist. I use the ssh kitten, it works fine.
- jimmaswell 3y agoReally shameful that they lock away standards under such high prices that people have to go to such lengths to not buy them, with potential results like this. If it's a standard it should be available. It maybe made sense to charge a printing fee back when they were only available as books but I can't believe a crappy pdf was $200.
- medo-bear 3y agoGreat article ! This is exactly how I use my Emacs, only in tty. Take that VS :)
- jedberg 3y agoThis is a cool deep dive into terminal standards and their footguns but... not sure why? Unless you're showing pictures in your terminal, why would you want true color and the overhead that introduces? If you're just doing a status bar on a black background, your eye won't really see the difference between FF0000 and FF1515 (which I picked because the next 16 bit color is FF3333 which you can already barely tell the difference from). I'm just saying I'm not sure I would want that much color choice, it would just give me anxiety about picking the right color!
- spudlyo 3y ago> I'm just saying I'm not sure I would want that much color choice, it would just give me anxiety about picking the right color! Developers of themes for Emacs often target the GUI first, where 24-bit color is the default. If you're a hardcore terminal Emacs user (and there are many legit reasons for this) you're stuck by default with 256 colors, and the themes just don't look right due to having to map the carefully chosen colors to the nearest color in the 256 color palette.
- chadaustin 3y agoExactly correct. Loading solarized in 256-color emacs shows just how poorly the (carefully-selected) Solarized colors map onto the xterm-256color palette.
- bhaak 3y agoIt clearly depends on what you do but having more colors is nice. Even if 256 colors are available it's not enough. The palette of the 256 colors is gruesome. You can clearly see that a technical person without any knowledge of color theory designed it.
- jwr 3y agoIf only there was a way to magically pass extended modifier keys to Emacs over a terminal… It's the only thing stopping me from using Emacs remotely over a terminal: I really do need my Super modifier. Hyper I can live without, but being able to do shift-super-f for example is fundamental.
- globular-toast 3y agoHmm... My Emacs has just worked with full colour in terminal for years. I didn't know it was a thing that needed to be configured. Skimming through the article I hope I never have to know this stuff. I also have icons in my terminal by using nerd icons.
- spudlyo 3y agoThe article is a deep dive on the evolution on terminal color, mentioning some of the "colorful" characters in the scene. This is specifically about the ultimate 24-bit expression of gawdy terminal bling, aka COLORTERM=truecolor. Perhaps you're not the kind of person who would notice if their Emacs color theme looked wrong because the theme designer's carefully chosen 24-bit color was mapped to the nearest color in the 256 color palette of the stock terminal.
- globular-toast 3y agoOh, I am that kind of person, believe me. Mine looks identical in the terminal. I use zenburn theme. The only thing I ever set in my bashrc is `TERM=xterm-256color`. I'm not sure why. I do have `COLORTERM=truecolor` set, but I didn't do it myself. It just works for me with or without those variables set in both xterm and alacritty.
- austinshea 3y agoThis is fantastic! Thank you for writing this and sharing it.
- chewxy 3y agoMeanwhile I want my emacs to look more like this https://imgur.com/a/h0jA1ro https://imgur.com/a/h0jA1ro (in case anyone thinks that's serious, it's a joke. I only use Cool Retro Term for presentations) edit: apparently my emacs works with 24 bit colour out of the box: https://imgur.com/a/BM5OTxp https://imgur.com/a/BM5OTxp. The syntax highlighting is a bit annoying though.
- com2kid 3y agoI have a deep love for cool retro term, I am sad that the project is mostly abandoned and has multiple issues on MacOS. IMHO none of the other retro terms look nearly as good.
- spudlyo 3y agohttps://muppetlabs.com/~mikeh/crt_emacs.png https://muppetlabs.com/~mikeh/crt_emacs.png Cool Retro Term is great, I want to use it in a presentation as well.
- ghosty141 3y agoI actually use a light customized crt effect with the windows terminal.
- BigParm 3y agoThis is why I just use VSCode now. I enjoyed tinkering for years. One day my Vim colors wouldn’t work in Tmux for like the 5th time in my life. I said, you know what? I’m done with all of this. I appreciate that what you did is fun. I just thought I’d share a perspective that sometimes we’re sick of tinkering.
- gpderetta 3y agoCan you use vscode in the terminal now?
- kens 3y agoThat's a very interesting investigation. However, perhaps computing has lost its way, when a production system uses emulators of 1970s terminals to run a 1970s editor on a version of a 1970s operating system. I really think that we're stuck in a local maximum and there are probably much better ways to do things. Our computers are millions of times more powerful now, but we're still doing things the same way as literally half a century ago.
- TylerE 3y agoPeople may be stuck in what they think is a local maximum. I ditched emacs close to 20 years ago (for jEdit, later Sublime and finally IntelliJ) and have never regretted it in the slightest. I don't want my editor to read usenet or play solitaire. I want it to edit text and surface useful contextual information, and otherwise stay out of the way and let me devote my mental energy to the task at hand and not futzing with the damn editor config.
- omaranto 3y agoWow, this looks so much harder than simply running GUI Emacs.
- user1234x 3y ago[dead]
- ljm 3y agoProtesilius has changed the game on theming, to the extent that modus-operandi and modus-vivendi are now baked into emacs. They are fucking incredible and you only need to look at their readme to see the the intense duty of care. It’s not just aesthetics it’s accessibility. My blog is built by emacs and I use modus-operandi for syntax highlighting.
- anonuser123456 3y agoThe easiest way to make Emacs look nice is to install VSCode.
- wmedrano 3y agoNot sure that's a good answer. There's plenty of stuff that Emacs don't that VSCode doesn't do very easily.
- tmtvl 3y agoI mean you're right: installing VSC and forcing yourself to use it for a while will make Emacs seem truly amazing by comparison.
- simonmic 3y agoBecause.. VS Code's terminal pane is well behaved ? (I run most of my emacsen inside VS Code.)
- nibbula 3y agoI wrote the patch for 24 bit color in xterm, but I have to admit I was today years old when I learned how to make ncurses work with xterm-direct. I was already using my own terminal library in Lisp, but it's still useful to be able to fall back to using ncurses. Thanks to Mr. Dickey for answering a stack overflow question, and the author Chad for bringing it up.
- shmerl 3y ago> It turns out, for years, popular terminals have supported 24-bit color. And yet they’re rarely used. Hard to say how rarely. I've been using 24-bit color in bash prompts and neovim scheme for a while. Can't go back to 16 or 256 color ones, they are just too limited. I wish tty terminal also supported 24-bit color. For setting the color in bash I use something like: printf "\x1b[38;2;${r};${g};${b}m" or printf "\x1b[${f};38;2;${r};${g};${b}m" If I need to set extra bits like bold.
- jasonm23 3y agoOr, I don't know, install the latest Emacs, open a terminal that supports 24bit xterm, and do: emacs -nw If it looks good when you apply a theme, great. If not add the following to .bashrc, .zshrc, .fishrc (you know the drill): export COLORTERM=truecolor (reload the shell, or just execute this line and start emacs -nw again, voila.) For some reason, this article makes it look like you need to dig into terminfo, generally you won't need to, maybe 10 years ago, not now. (I quickly retested just now, to be sure, on Macos iTerm & Linux, Alacritty, Kitty, Gnome Terminal. 24Bit xterm is commonly supported these days.)
- assimpleaspossi 3y agoIn my case, I don't care. Give me plain black and white all day long--and I do. When you have that many colors on the screen it no longer is helpful and only becomes a blur of clown colors. If you must, use just a couple of colors--or even just shades of gray or bold--to highlight important things like functions. But that's what indentation is for. You indent/format your code to help find things. It seems to work well in books. And that works everywhere without any work involved to make it happen.
- wwarner 3y agoI really love emacs in the terminal. I created a docker image that looks beautiful (and identical) whether you're editing locally or remotely. It's configured properly for 24 bit color and unicode, and it also has all the underlying binaries for native compilation, lsp, ripgrep, fast json and so on, all ready for both amd and arm. Caveat -- I haven't used it on windows yet. https://hub.docker.com/r/wwarner/emacs-gopy https://hub.docker.com/r/wwarner/emacs-gopy
- cultofmetatron 3y agoI see stuff like this and I think. it would be cool if they embedded some kind of inferior lisp like scheme into zed's editor.
- bm98 3y agoThank you for this article. One of the great frustrations of using Magit for Emacs is the inability to read things because the foreground and background colors for various things end up the same on some platforms. From this article I found the command "toe -a" and was able to try various TERM values until I found one that makes Magit readable: vt100. This turns off colors entirely, which may not be pretty, but at least I can read everything now.