2025-09-15: Code clean ups

Published: 2025-09-15

Terminal emulator improvements and automated pylint fixes using the new agentic capabilities.

Improving the terminal emulator

Having recently added an agentic terminal emulator capability I decided to do more testing with it. As I've seen before, one or two LLMs demonstrated different behaviours.

An interesting one was DeepSeek as it decided to only fetch 10 lines of text at a time, and this exposed a subtle bug.

The read_terminal operation reads the last "n" lines from the terminal buffer, but in the case of a new terminal the last few lines are usually empty to start with. I modified the code to use the internal tracking that works out which rows have been touched by the cursor and ignore all the ones below that.

While I was doing this, however, I realized the internals of the terminal were being exposed as public properties and that some of those properties were being used in the terminal GUI. Modified them so they're private, added some accessor methods, and updated everything to use the new methods.

Pylint fixes

I've had 2 minor pylint issues for a while now. Given the new agentic capabilities in the terminal I decided to let Humbug find and fix its own problems again. Nice one-shotted fix that cleared both issues and made the code more readable.