My trusty Macbook Air is getting a little bit long in the tooth, so I’ve recently been looking around for a new notebook. I settled on a Lenovo X1 Carbon for various reasons, the main one being their known high compatibility with Ubuntu. So, this post (and probably several others) are going to be my impressions of the X1.

Hardware

First, some thoughts on the hardware.

The keyboard feels good. I’m used to the Control key being under my left pinkie: that’s the way it was on my Macbook. Not sure if all Macs are like that, but it’s a life-saver when you use the keyboard a lot. I use Control for vimming, tmuxing, and copy-paste when the times get rough. I never use Caps Lock. There doesn’t seem to be an official way to remap keys, but SharpKeys did the trick really well. For some reason, the Lenovo Japanese keyboard switches the underscore-backslash key (unshifted-shifted) to be backslash-underscore. This is annoying, cause as a programmer I use underscores way more often than I use backslashes. There’s also already another key for backslash, which also happens to be unshifted. Unfortunately, SharpKeys can’t handle that particular mapping for some reason.

The trackpad is good. The only nitpick I have is that it seems to misbehave with my beloved gameknot.com. Normally, I click to select a piece, drag to move it, and click again to place it. Using the trackpad, that second click sometimes registers as two single clicks, which is annoying. Peculiarly, I haven’t seen this happen on any other site or application. Maybe it’s because I don’t use the mouse that much. Haven’t really touched that red dot thing in the middle of the keyboard.

The machine gets really hot, even when idling. I doubt I’ll be able to keep it on my lap. Disappointing, because I’ve spent many hours with my Macbook Air on my lap during long haul flights - it was some of my most productive work.

Software

Enough about the hardware for now, let’s look at the software. I wanted to get productive with the new notebook as quickly as possible. I wanted to avoid installing a new O/S, and was willing to give the new Windows a chance.

I spend most of my time in the command line, so the first thing I did was to enable the Linux subsystem so I don’t have to endure the abomination of the built-in Windows command prompt. I evaluated a couple of terminal emulators using the following critria:

  1. Must work with my beloved solarized scheme
  2. Must work with my toolchain (bash, vim, etc. running within tmux)
  3. Must work in full-screen mode, with easy switching to other applications like StackOverflow
  4. Must not annoy me while working
  5. Must support tabbed panes
  6. All of the above must happen with minimum effort, because I want to become productive in the new environment quickly

I initially started with ConEmu. It’s very promising and customizable, but it had some glitches working with non-ascii fonts in vim under tmux, and had to fidget with the color scheme to make solarized work properly.

I also tried mobaxterm, but it was didn’t work well in full-screen, and was a pain to use overall. ZOC terminal looked promising, but it appears to only support connections to remote servers.

Ironically, I went back to using the built-in Windows terminal application. It isn’t feature rich, but it took the least effort to get it to satisfy the above criteria. There is a git repository for installing the colors from the solarized scheme. My existing toolchain “just works”, surprisingly. Copy-paste between tmux and Windows-land didn’t work originally, probably because tmux captures the Ctrl key for its own uses, but I worked around that by putting the following into .tmux.conf:

#
# COPY & PASTE
#
# https://emacs.stackexchange.com/questions/7191/copy-and-paste-to-system-clipboard-in-tmux
#
# To copy: hold ctrl, press a, then press y, release ctrl
# To paste: hold ctrl, press a, then press p, release ctrl
#

# Copy tmux buffer to X clipboard
# run -b runs a shell command in background
# bind C-y copies the tmux buffer to the system clipboard
bind C-y run -b "tmux show-buffer | $HOME/bin/copy.sh"

# Paste from the system clipboard into tmux
bind C-p run -b "exec </dev/null; $HOME/bin/paste.sh | tmux load-buffer - ; tmux paste-buffer"

bin/copy.sh:

#!/bin/bash
#
# Read from standard input, write to clipboard
#
pyexe="/mnt/c/Users/misha/AppData/Local/Programs/Python/Python37/python.exe"
$pyexe -c "import sys;import win32clipboard as c;t=sys.stdin.read();c.OpenClipboard();c.EmptyClipboard();c.SetClipboardText(t);c.CloseClipboard()"

bin/paste.sh:

#!/bin/bash
#
# Read from clipboard, write to standard output
#
pyexe="/mnt/c/Users/misha/AppData/Local/Programs/Python/Python37/python.exe"
$pyexe -c "import sys;import win32clipboard as c;c.OpenClipboard();sys.stdout.write(c.GetClipboardData());c.CloseClipboard()"

The only down-side was that the Windows terminal app doesn’t support tabbed panes. I usually have multiple tabs open, one for each server, and within each tab I run tmux. I suppose I could have multiple terminal windows open instead of multiple tabs, but that feels like a step backward.

These instructions were helpful for setting up an SSH agent so I can use it across different terminal tabs. Without it, you have to enter your passphrase more often than necessary, which gets boring really quickly.

In general, windows definitely looks and feels better than I remember it. The last time I did any serious work on a Windows machine, it was Windows 7 time. The UI looks slick and attractive, perhaps not as stylish as MacOS, but it doesn’t make you puke while you use it. Nevertheless, sometimes a window pops up and it’s a blast from the past, like the old XP days.

I don’t like the way Windows 10 handles languages and keyboard layouts. By default, they are not independent: e.g. if you want Windows to display everything in English, you need to install and enable one of the English keyboard layouts like en_US. This kind of makes sense, except for cases like Japanese: the Japanese keyboard layout has an English-only mode. This means you have effectively two English keyboard layouts, and switching between them becomes a pain. There’s a way to work around this, but it requires digging through some advanced settings.

The Windows 10 file system sucks. I wasn’t able to git-clone my blog to the C drive: I think it doesn’t support pathnames with apostrophes or some other character. Writing to the Linux partition works fine.

The high-definition display is great, except for times when it isn’t. Some older applications e.g. PasswordSafe and Anki look blurry. It’s tolerable, but an eyesore. Part of me wishes I just got a standard panel instead of a hi-def one.

Epilogue

After about a month of on-and-off Windows usage, I decided that it just wasn’t for me, and installed Ubuntu 18.04. Stay tuned for news of my adventures.