Run sublimetext in WSL

Background

I need to install xESMF package on my windows laptop. However, it just supports Linux and Mac.

So, I switch to the Windows Subsystem for Linux (WSL). The installation is easy.

Install sublime text

Since it’s quite slow to install sublime text3 from its official website using apt-get, I downloaded the tarball from the sublime text website.

Then, add it to ~/.bashrc:

$ wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
$ echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
$ sudo apt update
$ apt install sublime-text
$ sudo ln -s /opt/sublime/sublime_text /usr/bin/subl

Run sublime text

I’m using MobaXterm which is an enhanced terminal for Windows with X11 server, tabbed SSH client, network tools and much more.

However when I type subl, the GUI looks blurry:

blurry

Because my screen is 4K, I need some tricks for this:

Override the high DPI scaling

The font becomes so small: high_dpi small_font

Scale the UI

Prefrence >> Settings:

// Settings in here override those in "Default/Preferences.sublime-settings",
// and are overridden in turn by syntax-specific settings.
{
	"ui_scale" : 2.5
}

Restart the sublime text and the fontsize and tab_font size looks great!

But, the menus all still small.

small_menu

GDK_scale

Finally, I use the GDK_scale and set the font_size manually:

$ export GDK_SCALE=2

Settings:

// Settings in here override those in "Default/Preferences.sublime-settings",
// and are overridden in turn by syntax-specific settings.
{
	// "ui_scale" : 2.5
	"font_size": 15
}

gdk_scale

References

  1. Run sublime in WSL on 4K screen
  2. Blurry X11 forwarding via MobaXTerm
  3. Blurry fonts on using Windows default scaling with WSL GUI applications (HiDPI)
  4. How do I edit the Solarized (Light) theme in Sublime Text 3
  5. How to increase the file tree and tab font size?
  6. SUBLIME INCREASE TAB FONT SIZE

Say something

Thank you

Your comment has been submitted and will be published once it has been approved.

Click here to see the pull request you generated.

OOPS!

Your comment has not been submitted. Please go back and try again. Thank You!

If this error persists, please open an issue by clicking here.