Writing your own serial terminal

Today I wasn’t doing much Gentoo work, because I was at a meeting with my employer (hi Carlo :) ), where I picked up some stuff to do that requires me to use a serial console (without going in further details). Beside the fact that enterprise only have one serial port, which means I now have to choose between three different devices to connect to it, it’s time for me to use massively serial terminals during the day, so it’s worth spending some of my free time to make the work easier.

I never had a really good experience with terminal emulators, in particular minicom always was terrible to configure, and it sends the AT commands every time; this time it also does not work (does not write to the serial port), and I’ve been told it does not work with USB serial converters (that I need). Cutecom is not good either, because it’s a line-based emulator and does not allow me to send BREAK signals (for Klothos console).

So I decided to spend my free time out of job doing something that would make my job easier, funnier, and might be useful to others… writing a new serial terminal emulator, for KDE!

I took Konsole code, and started replacing PTY and processes with TTYs, the result of about an hour of hacking is a Konsole that can actually receive the data out of the serial console (not yet send though).

Update (2016-04-29): Unfortunately I cannot find the screenshot anywhere for this one, so it’s gone.

I’ve mailed Robert Knight, the new Konsole maintainer, as it’d be nice to me if Konsole would be able to work as a serial emulator, but I really doubt for 3.5 series that is going to happen; for this reason, I’ll be working on a serial terminal emulator that forks off Konsole code, and only supports serial ports. As Konsole is the German for Console, I’m gonna call it Serielle Konsole, guess what is the German for? :)

I know it’s not exactly the simplest of the projects, but luckily most of the complex code (displaying and parsing) is already written on Konsole, I just need to replace the settings, remove the bookmarks (no CWD to bookmark anyway), replace the way Sessions work (I will use different sessions for the various serial consoles, of course), and hook correctly the serial support.

It’s not that much of a difficult task actually, because I looked up most of what is needed to write a basic serial terminal emulator for my High School graduation project (it’s pretty dumb but it did the job to show my teachers what I was able to do — and it was now three or four years ago. Who said that High School is useless?)

5 thoughts on “Writing your own serial terminal

  1. For the series “even GNOME can be right”, it’s a slightly tweaked Klearlook with Knifty as windows decoration.

    Like

  2. Ira, I’m far from being discouraged :) Especially since it’s almost ready, working on settings right now.But picocom is really interesting, and I’ll certainly give it a try, thanks!

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s