A Note on Terminals

Recently I’ve been trying to track down some sudden slowness in canto-curses. Things like scrolling and other routine operations seemed to take many times longer than they should.

Well. To make a long and ultimately fruitless debug session short, turns out that the problem wasn’t with canto-curses it was with the terminal I’ve been using. I’ve been distro-hopping again (sorry Arch, you broke my shit one too many goddam times) and lately I’ve been trying out LMDE with the Cinnamon desktop. I don’t feel as efficient as I do with a tiling WM like Qtile, but I’ve been mostly happy with it.

As part of the Cinnamon desktop, I’ve been routinely using gnome-terminal which, in turn, uses cairo to do its font rendering like a lot of the other DE terms. Apparently cairo doesn’t like having walls of text thrown at it as often as canto-curses does, and as such, scrolling the terminal (which pretty much means every character on the screen needs to be updated) chokes cairo and slows scrolling to a comparative crawl.

The solution? Well, I don’t have one in code yet. I’m wondering if I can workaround it or at least smooth it out. So, in the meantime, if canto-curses doesn’t scroll fast enough for you, use a non-cairo terminal like [u]xterm or [u]rxvt.

Merged RSS URLs

I’ve redirected the old canto RSS feed to the new canto feed. No more content will be published for the previous one and it was still getting thousands of requests so I figured I might as well make use of it.

curses 0.8.3 daemon 0.8.2

Various improvements.

Daemon

  • Fix for daemon hang stemming from a database trim failure
  • Fix mangling canto-remote one-config calls
  • Make Reddit plugin better behaved
  • Better handling of interrupted syscalls
  • Converted to a time based item keeping system1
  • Exposed keep time configuration
  • Added option to never discard unread items

Curses client

  • Added config wrappers keep_time, keep_unread, kill_daemon_on_exit and border2
  • Better notification of config error corrections on startup
  • Fixed unicode input in command line
  • Fixed fetch error with obsolete urrlib2 import
  • Fixed tag header not updating consistently (read/unread items)
  • Added extra_tags to tag header format string
  • Added experimental reader aligns/float status commands and focus control

1: Items are now kept, by default, until they’ve been absent from the source feed for a full day. This is configurable for the daemon at the global and feed level as defaults.keep_time and Feed.keep_time and is an integer value for number of seconds it needs to be absent before it’s possible to discard.

2: These are the curses wrappers for new daemon functionality as well as other tweaks. You can now issue the following commands:

:keep_unread = [True|False]
:keep_time = [integer seconds before possible to discard items]
:border = [True|False]
:kill_daemon_on_exit = [True|False]

If keep_unread is True, then items that are unread will be kept by the daemon indefinitely, otherwise after keep_time seconds absent from the source feed they’ll be eligible to discard like every other item that isn’t otherwise protected (i.e. sitting in a client somewhere). keep_unread defaults to False.

If border is True, old-style Canto borders will be rendered in the taglist. It defaults to False which is the behavior present in all previous releases (borderless).

Lastly, if kill_daemon_on_exit is True, the client will send DIE to the daemon on exit which will cause it to terminate as if canto-remote kill had been run. This defaults to False.

canto-curses-0.8.3.tar.gz (54K)
canto-daemon-0.8.2.tar.gz (39K)

Have fun. Report bugs.

Next round of features

It appears everything is going pretty well with the new codebase, there’s been a dearth of real bugs (and one aesthetic one). I’m chalking that up to lack of adoption however as most of the emails I’m getting (one or two a month outside of the tracker mails) are still about old versions in Ubuntu and Debian repos.

Or my code is fucking perfect. You know, could be that one too, right?

Anyway, with a lack of bugs to distract me, here’s what I’m looking to add to the next version of canto-curses and, if necessary, canto-next.


Old Canto look. This one’s done and in the git right now at the request of langner, it adds the old school borders to tags. The cursor behavior is already present and I think all the other interface foibles are either irrelevant or already handle-able.

Polish. There are some operations that are currently bulky, or return unwanted output (like canceling an input with Ctrl+g can sometimes throw a pointless warning message about unparseable output). I’d also like to simplify use of manual tagging.

Documentation. The plugin and theme docs are currently non-existent which is a shame because both of those systems are integral to the design. Unfortunately, docs also mean that the interfaces have to be standardized and examples drawn up so I’m not looking forward to it.


Future concerns:


Tab completion. I was disappointed that the initial release didn’t include this, or at least some form of history, but readline in Python with curses doesn’t seem to be a well-trodden path and I’m sure as hell not home-brewing it unless I absolutely have to.

Memory usage. canto-daemon still uses more memory than I’d like. All of the information clients query from it is on-disk and as such it should be possible to strip the memory usage down to nuts and bolts, but then of course you pay a disk performance penalty every time you grab new data. There’s a middle ground somewhere in there, likely stripping the resident content down to a smaller subset of the XML, so stuff like getting larger item content (reader) will be penalized with a bit of IO but just populating the feed list won’t be.

Sync. I’m against writing a Google Reader plugin, though it should be relatively easy with the daemon plugin capabilities, because the API is unofficial. I would like a solution for people that use multiple boxes that’s a little more elegant than requiring an rsync but we’ll see.


curses 0.8.2 daemon 0.8.1

Various improvements:

Daemon

  • Possibly eliminate feed fetch problems causing forgetfulness.
  • Better whitespace handling for canto-remote.
  • Added -V version flag.

Curses client

  • Added wrappers update_interval,update_style, and update_auto1
  • Added simpler to use variables with wrappers for changing the basic theme.
  • Increased update interval from 5 to 20.
  • Added -V version flag.

1: These allow you to change how the client grabs updates from the server. You can change these by doing the following in the client:

:update_interval = [int seconds]
:update_style = (maintain|append)
:update_auto = (True|False)

If update_auto is True, then every update_interval seconds, the client will fetch items for tags that have changed. By default, update_auto is True, and update_interval is 20.

The update_style setting determines whether updates from the server should have new items appended to their tags (append) or if it should reorder them to reflect their order on the server side (maintain). By default, append is used because it guarantees that, when an update happens, all new items in your current tag show up after you cursor so you don’t have to navigate to the top of the tag to check for new items before you mark the whole tag read (r) or mark all items in the tag before the cursor read ($).


This update to the curses client also makes rudimentary theming much simpler. This will have to be covered in more depth than appropriate here though.

canto-curses-0.8.2.tar.gz (52K)
canto-daemon-0.8.1.tar.gz (36K)

Have fun. Report bugs.

Canto 0.8.0

Welcome to the newest version of Canto, 0.8.0. It’s the culmination of the rewrite kicked off almost two years ago and while it doesn’t have the depth of testing that 0.7.x and prior versions have the codebase is more sound and featureful for both users and myself (sole developer).

So what’s different?

Let me count the ways from major to minor

  • Server client separation in line with the Unix Philosophy
  • Managed configuration done through the client, no config file editing
  • Built-in command line in canto-curses
  • Everything is entirely pluggable
  • Python 3 codebase, instead of Python 2
  • Updates reflected immediately
  • Interface scales better in the 10k+ item range
  • Interface settings default to persistent
  • Interface is sleeker
  • Vastly improved debug logging
  • Cleaner feed storage
  • Ability connect to the daemon over the network

I can get into greater detail, but the takeaway here is that the re-engineered canto follows a much saner design. It was a hard decision to rewrite the original codebase, but in the loss of time and effort will be made up over the next few years with the ease of extension and the facilities at my disposal to debug issues that in the old codebase were nightmarish.

The new version of canto is very much informed by user feedback as well. I can’t tell you how many times someone came into the IRC channel and just wanted something simple like the ability to toggle links being shown in the reader persistently. Thus now every aspect of the display is persistently configured without the need to add obscure Python to your configuration file.

Meanwhile, none of the flexibility of the old client is gone. In fact, it’s been vastly improved. The entirety of both canto-daemon and canto-curses are plugin friendly. In essence, standard users that want basic functionality are taken care of without ever opening an editor while power users can change virtually any component of canto on the fly by designing plugins that anyone can then drop into their configuration directory and take advantage of.

There are going to be bugs. Of course. There are places that need polish (creating plugins or new themes are totally undocumented, tag folders are a bit clunky) but the core engine is there, sleek and efficient. I need users to push it harder and differently than I do. Developers make bad testers. Go forth and bug report!