Chip's Tips for Developers

Chip's Tips for Developers

  • 3270 Point White Dr NE
  • Bainbridge Island, Washington
  • 98110-4015

Description

I love my console-based chat client, jab . It’s minimalist, relying only on console output. But that very minimalism created some problems. Whenever I’m typing at a prompt, a notification or message could come in and interrupt what I was typing. Worse yet, if I wasn’t actively using it, the notifications could scroll the prompt up and out of view. Since the prompt is context-specific, I often ended up sending commands as messages because I’d forget to hit Enter first to see at what prompt I was typing (sorry about those, Chad ). I’m amazed, though, how jab’s design makes it highly customizable. I implemented a solution to this problem without touching the core product. Oh wait — I did have to make one change: output gets flushed regularly now. You shouldn’t even notice the difference unless it fixes something for you. Instead of modifying the core, I created an extension named keep-prompt, which you can simply ‘source’ in your .jabrc to make jab keep the prompt visible at all times. It does this by positioning the prompt on the last line of the terminal, and scrolling all other output into the lines above that. Since you press Enter at the end of a command, those get scrolled in context as well. Of course, this does rely on having certain termcap entries work, which reinforces the wisdom of making this an extension. Here are the links. Happy (not blind) jabbing!

Products & services