reddit / emacs
why does my emacs look different when started from the terminal? (MacOS)
wolfakix · 2022-02-12 19:58
r4n6e · 2022-02-12 20:14
What do you mean exactly? The color?
Myrgy · 2022-02-12 20:15
Try to check $TERM env variable
wolfakix · 2022-02-12 20:17
the color and some icons are missing
wolfakix · 2022-02-12 20:18
xterm-256color
pja · 2022-02-12 20:23
One might be running as a graphical application & the other a terminal app within iTerm?
In which case the latter will inherit some of the default colours of your terminal I think, whilst the former will do it’s own thing.
wolfakix · 2022-02-12 20:24
and how can i start the graphical app within the terminal?
wolfakix · 2022-02-12 20:26
beacuse i noticed when running emacs from the `emacsclient -c -a 'emacs'` command is much much faster than regular `emacs` command
Myrgy · 2022-02-12 20:28
Both?
wolfakix · 2022-02-12 20:32
`[I] ~ λ echo "$TERM"`
`xterm-256color`
wdym both?
mohd_sm81 · 2022-02-12 20:57
I faced the color thing and I fixed it by forcing a certain BG color in one of "customize" options. It took me trial and error and I didn't save the name of the variable to mess with.
Another thin is your terminal emulator colors also have some effect on those. I rarely use the GUI Emacs.
wolfakix · 2022-02-12 20:59
what is happening with the icons tho?
mohd_sm81 · 2022-02-12 21:01
The icons don't appear in my terminal either (using Gnome 41.x terminal)
wolfakix · 2022-02-12 21:04
how does DistroTube get them working on his setup then :/
mohd_sm81 · 2022-02-12 21:05
good question! we should ask him, there has to be something we miss.
wolfakix · 2022-02-12 21:06
if you ask him and you ever get a reply please inform me
mohd_sm81 · 2022-02-12 21:07
sure!
lasseaagren · 2022-02-12 21:22
https://stackoverflow.com/questions/14672875/true-color-24-bit-in-terminal-emacs
wolfakix · 2022-02-12 21:30
what about the icons?
[deleted] · 2022-02-12 22:07
[deleted]
spudlyo · 2022-02-12 22:20
Link me to a video where DT has terminal icons will you? I'd be impressed as hell with him if he got that working. He runs GUI emacs (the different sized fonts in ORG mode are a dead giveaway) in every video I've seen of his.
spudlyo · 2022-02-12 22:23
You can't get icons in the terminal without a fair amount of effort -- it's not for the faint of heart.
You need to start with the [icons-in-terminal](https://github.com/sebastiencs/icons-in-terminal) font. This font jams all the icon font packs into one of the Unicode private use areas. You then need to configure your terminal emulator to use this font as a "fallback" when it can't find the unicode symbol in your default terminal font. In macOS' iterm2 this is called the "Non-ASCII font", and that's where you configure it. In the Kitty terminal emulator I do this:
`symbol_map U+E000-U+EEA0 icons-in-terminal`
This essentially tells Kitty to look for stuff in the Unicode private use are in this specific font. Ok, still with me? Then you need to use the [icons-in-terminal.el](https://github.com/seagle0128/icons-in-terminal.el) code which essentially emulates the `all-the-icons` functionality with a slightly different name. So instead of `all-the-icons-insert` you have a function called `icons-in-the-terminal-insert`. Then you manually `defalias` all the `all-the-icons` functions to their equivalent `icons-in-terminal` functions which substitutes in the terminal variants of all the functions.
Ok, you're still not done yet. Packages that use all-the-icons often check to see if you're running tty emacs before they attempt to output an icon. They use the `display-graphic-p` function to do this, and if that function returns `nil` they don't do anything. But you have the code, so you can fix this. You replace `(display-graphic-p)` with `t`, in `.el` files in your `~/.config/emacs/elpa/{doom-modeline*,all-the-icons-dired*,all-the-icons-ibuffer*,all-the-icons-ivy-rich-*}` directories, recompile and you're good to go. Don't get me started on what you have to do to make treemacs look right.
It's a pain in the ass, but I think it [looks good](https://muppetlabs.com/~mikeh/ttyemacs.png).
wolfakix · 2022-02-12 23:02
i cant even get the font installed xD
spudlyo · 2022-02-12 23:21
Yeah apologies. I should have just replied "It's hard, don't bother." This is mostly just flex, and on the off chance anyone cares.
Myrgy · 2022-02-12 23:33
Sorry. I misread the topic. Had similar issue with different terminal emulators. It depends on client and in any case terminal work in text only mode.
hey_parkerj · 2022-02-13 01:34
Thank you for posting it. I started trying to use emacs in terminal until I got told to stop, but was always curious why exactly that’s the case since I figured it was configurable anyways.
Now I get it.
patrick_thomson · 2022-02-13 03:51
This is an incredible flex. Thank you for it.
jclosure · 2022-02-13 06:51
I used to have this problem all the time with terminal Emacs in ITerm2 in MacOS. I finally tracked it down to that the color theme you're using requires 24bit color and you are probably running 256color. Check it w/.
```
echo $TERM
```
If it does't say `xterm-24bit`, you need to setup your terminal to support 24bit color. Here's a quick and easy way to setup your `~/.terminfo`.
https://gitlab.com/jclosure/dotfiles/-/blob/develop/common/install-terminfo-xterm-24bit.sh
Try it w/:
```
TERM=xterm-24bit emacs -nw
```
gdaythisisben · 2022-02-13 09:34
How do you get these system icons in iTerm though at the window border? 🤔
wolfakix · 2022-02-13 09:56
that is simple-bar run via ubersicht
pja · 2022-02-13 09:59
On OSX? No idea! Some suggestions here: https://www.emacswiki.org/emacs/EmacsForMacOS
moondaddi80 · 2022-02-13 13:02
check out the nerd font for the missing icons
AnugNef4 · 2022-02-13 14:00
Issue the command `open /path/to/Emacs.app`
notaslowkoala666 · 2022-02-13 15:35
And you had to make a thread for this
wolfakix · 2022-02-13 15:42
U got a problem with that?