Connecting to Serial Ports with Windows Terminal
Windows Terminal is a killer app for Windows 10 & 11. With it you can launch Windows command interpreter, Powershell, bash, and WSL sessions. It is however missing the ability to connect to COM ports and serial connections.
If you’ve been a sysadmin on or with Windows long enough you’ve probably got PuTTY installed which will let you connect to serial consoles. Launching a whole other tool with different font & colour scheme settings, when Terminal should be able to do the job, seems silly to me. Luckily PuTTY bundles the plink
tool which lets us connect to serial ports from the command line.
Speaking to the device at the other end of your serial port is as simple as passing the COM port as an argument, as long as your serial port’s default configuration matches the other device’s settings.
If you need to set some parameters such as a different baud rate these can be passed as arguments too but before we go too far and start adding a full plink
session to our Windows Terminal configuration there’s an important note in the PuTTY documentation about plink
.
Plink is probably not what you want if you want to run an interactive session in a console window.
This is true, but it probably won’t be obvious why until it suddenly becomes frustrating. It does not pass any of the “interactive” keystrokes in a console session, such as the up arrow to allow correcting mistyped commands.
Thankfully, Edward Wright wrote a nice tool, SimplySerial, that picks up where plink
leaves off. Once installed, it can be launched much like plink
, by running the ss
command, passing the COM port as an argument.
The SimplySerial documentation includes a hint on how to add ss
to Windows Terminal, but it’s default behaviour isn’t as clean as I’d like. I suggest adding the -nostatus
flag to prevent the tab title from being renamed and the -quiet
flag to suppress the large start-up banner.
With this configuration added to Windows Terminal, we can create a new tab with the COM5 profile.
This launches a nice, clean, serial session ready for you to configure your network switch or talk to your microcontroller.
2024-08-23