Configuring a pretty and usable terminal emulator for WSL 29 September 2017 on,. Table of Contents. Introduction I've been using a Mac as my daily driver for work for the last few years. While there's nothing particularly special about MacOS that I love (in fact there's quite a bit I don't like), it's honestly been the terminal and the underlying Unix based operating system that keep me glued to it. With Homebrew, command line tools just work. Python and Node dev environments just work.
Terminator is an open-source terminal emulator programmed in Java. It is available on Microsoft Windows, macOS, Linux and other Unix systems that use the X Window System. Terminator will run on any modern POSIX system running Java 6 or later. Finally, I came across Terminator which is a Java based terminal emulator packaged as a native Mac app. It supports a number of important.
And using with is the best terminal experience I've ever had. I often feel like I just pay the premium for Mac hardware to have a reliable and easy to configure.Nix operating system. But lately I've really been wanting to get off the Mac ecosystem and start using Windows 10 on my X1 Carbon as my daily machine.
With the (WSL) it's now possible to have a 'native' Ubuntu command line on my Windows 10 machine to use for my CLI nerdiness. But the only thing holding me back was the lack of a nice terminal emulator (admittedly, I'm shallow and like pretty things). This just wasn't going to cut it: After much tinkering, I've ended up with what I feel is the most comfortable terminal experience I can get on Windows. It supports tabs, splits, mouse mode and has a pretty color scheme to boot: In this post, I'm going to quickly explain how I got it running and configured, and some of the other options I tried.
First Attempts I really just wanted the equivalent of iTerm2 in Windows. I wanted to utilize WSL (not Cygwin) and at a minimum needed:. Pretty colors and fonts. Tabs (non-negotiable). Working mouse support for scrolling and Vim/Tmux.
Tmux support and auto resizing. Sane copy/paste I think I tried every major Windows terminal app I could find. Each had their own drawbacks and I eventually gave up. Some of the ones I tried:.
Pros: Tab support. Works with cmd and PS nicely.
Cons: Lacked mouse support in Tmux; resizing Windows was funky. Same as Cmder - not as pretty though by default. Pros: Window resizing and mouse worked great. Cons: No tabs!.
Same as Wsltty, just harder to configure initially. Pros: Screenshots online made it look pretty. Apparently has nice plugins. Cons: Buggy as hell. Never got to properly work. Plugins based on NPM failed all the time. Pros: Lots of features out of the box.
Cons: Based on Cygwin, not WSL. Pros:??. Cons: Didn't support WSL Bash. Not free. Pros: A lot. Love this app for managing remote connections (e.g. RDP).
Cons: Not the best for local shells. Mouse/tmux support not working The closest I got, and one that I used for a while was Cmder: Unfortunately, when I started using Tmux it became a problem. I could never get mouse mode to work (scrolling or selecting panes), and resizing windows was problematic. I'd end up with screens like this a lot: Not gonna cut it for me (though I still do use Cmder regularly for when I need to run Windows cmd.exe) Linux Terminal Emulators What I realized in my search and multiple trials was there just wasn't a good Windows terminal emulator. When I was about to give up, I saw a post on Reddit about someone who got XFCE working on WSL Bash. That was way overkill for what I wanted to accomplish, but reading through the post I learned/realized that if I had an X Server running on Windows, I could use GUI Linux terminal emulators 'natively' on Windows! That opened up a ton of possibilities, and one of my favorite Linux terminals, was now a possibility!
Installing an X Server To run an X Window application, I needed to have an X Server installed and running on my Windows 10 machine. After researching, it seemed the two most popular options are:. I went with VcXSrv since it looked like it was more actively maintained, but I tried both and they work the same.
After installing, VcXsrv creates a desktop shortcut to start the server in multi-window mode through the following command: 'C: Program Files VcXsrv vcxsrv.exe':0 -ac -terminate -lesspointer -multiwindow -clipboard -wgl -dpi auto A taskbar icon shows it's running, and we can verify by looking at netstat: C: Windows system32netstat -abno findstr 6000 TCP 0.0.0.0:6000 0.0.0.0:0 LISTENING 6216 It's important to note that VcXsrv is listening on all interfaces and requests a blanket firewall exception for private networks. AFAIK there is no way to only force it to listen/accept connections from localhost only, so I disallowed the firewall exception request and configured a custom rule to only allow traffic from 127.0.0.1 Configuring Terminator Once VcXsrv was installed and configured to allow access from 127.0.0.1, the next step was to install Terminator on WSL Bash: $ sudo apt-get install terminator If I didn't want to use terminator, any other terminal emulator should work, including Gnome Terminal (which Terminator is based on), Urxvt, or xterm.
After it installed, all that was left was to try launching it by specifying the X Display to connect to (:0) $ DISPLAY=:0 terminator & And a nice Terminator windows popped up:) Installing Zsh The next step I did was install Zsh with. Installation is straightfoward: sudo apt-get install curl wget git zsh curl -L bash I set the theme 'ys' in.zshrc The only 'gotcha' about using Bash in WSL is it will always run Bash instead of Zsh. To get around that, I add this to the end of my.bashrc which will launch zsh instead when it starts up: if -t 1 ; then exec zsh fi Terminator Colorscheme The next thing I chose to do was change the default Terminator colorscheme to Solarized Dark.