reddit / emacs

vterm unicode glyph display doesn't match my OS terminal. Can I alter the height be increased?

bhrgunatha · 2022-09-12 10:12
**My question:** How can I make the unicode glyphs in vterm prompt look the same as they do in my OS terminal. ---- emacs: GNU Emacs 29.0.50 vterm: 20220831.835 ---- I'm using zsh with xfce4-terminal. My OS prompt is configured using the [powerlevel10k theme](https://github.com/romkatv/powerlevel10k). I have 2 separate configurations for p01k, one for my OS and one for inside emacs. This is copied verbatim [from the vterm repo](https://github.com/akermu/emacs-libvterm/blob/master/etc/emacs-vterm-zsh.sh) [My .zshrc vterm configuration](https://zerobin.net/?b6b1eaa8402bfc2a#z0x6YHH6oUy3MY5ATrNQC6eQ9mCVbhXkY0ftF2qJayY=) I believe it's working because I can see visually that it's different from my OS terminal and when I run `p10k configure`in an emacs vterm buffer, it prompts to save to `bin/p10.emacs.zsh` The main difference i those 2 p10k configs is that the one for emacs has no prompt on the right hand side - I've given up all hope of getting it to work in vterm. vterm is working but there's one problem. The unicode glyphs in the prompts look different. ---- [OS prompt example](https://i.imgur.com/Cq63UFP.png) [vterm prompt example](https://i.imgur.com/doakfSU.png) It appears as if the line height in emacs is a taller than the font size. There is an unappealing strip of background colour above the font making it look as if the glyphs don't align. Whereas they match perfectly in the OS terminal. Any ideas for how I can fix this so that they look the same and I can have an aesthetically pleasing prompt in vterm?
bhrgunatha · 2022-09-15 08:04
Hey future u/bhrgunatha here's how you fixed your problem the last time. --- * Glyphs: [Sub-pixel imperfections around powerline symbols](https://github.com/romkatv/powerlevel10k#sub-pixel-imperfections-around-powerline-symbols) has suggestions. I haven't checked vterm's support of all those suggestions yet. I've already wasted _so much time and brain energy_ on this esoteric terminal and shell nonsense (yes it is nonesense - don't let anyone convince you otherwise. Arcane strings like "\eP\e]%s\007\e\\" "51;A" "51;E" "\e]2;%m:%2~\a" all belong in the dustbin of history but we're still forced to deal with all this crap on modern operating systems. If you're still using teletype terminals you seriously deserve a better life so we don't have to deal with it anymore). I'll revisit vterm support in future and report back. What I **did** discover is: * For my curcumstances - font, size, terminal, vterm - selecting the semi-circle glyph for the separator, head and tail characters is the only one that works. * Unwanted prompt characters (esp % ): I changed a couple of lines in my .zshrc (see below) * Right side prompt: Removed it entirely for now. Again I'll revisit this with more experiments and report back now the other issues have been addresses. ---- .zshrc changes **Prompt end** The whole point of powerlevel10k is to configure the prompt so no need for any special ending vterm_prompt_end() { vterm_printf "51;A$(whoami)@$(hostname):$(pwd)"; } vterm_prompt_end() { vterm_printf "51;A"; } Removing the % from `PROMPT` fixes the appearance of inverse video % characters randomly before and after the prompt. PROMPT=$PROMPT'%{$(vterm_prompt_end)%}' PROMPT=$PROMPT'{$(vterm_prompt_end)}'