Using the GDB window on a high DPI display (WSL)

Hello,

I’ve been struggling with ArduPilot development on my 14" Thinkpad laptop. It has a 2K OLED display. It runs windows, and I use WSL. When running ardupilot SITL in WSL, everything works great, except the GDB window does not obey the configured resolution. It’s extremely small.
run_in_terminal_window.sh is using xterm to launch the window.

Is there any way we can adjust the font size or at least respect the OS settings?

Currently, the GDB window is unusable on a high DPI display.

Looks like there required fonts are not installed correctly in WSL.

xterm: cannot load font "10x20"
xterm: cannot load font "-misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1"

To fix this, I added a ~/.Xdefaults file with contents:

XTerm*faceName: Monospace
XTerm*faceSize: 11

I also needed to remove the following from run_in_terminal_window.sh:
-xrm 'XTerm*initialFont: 6'

WSL doesn’t have the fonts installed - if you run xterm by itself, you get this:

xterm: cannot load font "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1"

Perhaps we should install the fonts, and run fc-cache after that? This approach worked on my system.

Then, you don’t need add an Xdefaults file or change from initialFont: 6.

1 Like