Changing xterm.js Font Per-Guest?

Sep 1, 2022
587
219
68
42
Ref: https://forum.proxmox.com/threads/change-fonts-of-xterm-js.121134/post-694047

The instructions in the message above explain how to change the global default xterm.js font.

Is there a way to change the xterm.js font for a specific LXC or VM?

I really like the default, but for some guests, I need to use a nerd-font to print special characters.
is there a way to override the xterm.js font per-guest?
 
Is there a way to change the xterm.js font for a specific LXC or VM?
I have never really looked into this - but AFAIK this is only available as a global setting - so short answer; NO.
However, since these are user-account-based, what you could do as a workaround, is set a different user when you want to use a different font.
 
  • Like
Reactions: UdoB
For a Debian-and-variants VM, if you're logging into the console from the proxmox webui, login as root and:

ls /usr/share/consolefonts |less


To set the console font for the current TTY, e.g.: setfont Lat15-Fixed14

You can set different font for tty1, tty2, etc
.
I currently know of no way to do the above for an unprivileged LXC. If you need more control, I suggest installing XRDP and using RDP to open an xterm on the desktop with the font you want. You may also be able to do it with ssh and X forwarding, at least I got it to work on a Mac with Xquartz.

ssh -X -Y user@ip

Use ' xfontsel -print ' to select a font, then for example:

xterm -fn '-bitstream-bitstream vera serif-*-*-*-*-*-*-*-*-*-*-microsoft-*'

NOTE xfontsel may be buggy, poke around in the dropdown menus until you get a result