Hilbish v2.0 Release

by sammyette

Hilbish v2.0 has been released! Well actually, it was released a week ago, but I only wrote this Hilbish blog after that.

This is a big release, coming 9 months after the previous v1.2.0 and featuring over 40+ bug fixes and tons of new features and enhancements, so let’s see what is in this release.

Documentation

When querying about the problems people have with Hilbish, one of the issues was its poor documentation. Hilbish had plain text, autogenerated documentation which only covered the module functions (bait, hilbish, commander, etc.) and did not include the interfaces (hilbish.timers, hilbish.jobs and all that).

I have tried to improve this by working on documenting all the interfaces (except for some functions of hilbish.runner, that’s hard to do) and made the documentation markdown for use on this website. This means that users can look at documentation here or with the doc command.

Hopefully this addresses documentation complaints, and if not, please open an issue.

Main Bug Fixes

As this is a piece of software with no unit testing that is maintained by me alone, there is gonna be either some bug or something that I overlooked when making a change. I make a lot of mistakes. There’s also the other fact that sometimes there’s just bugs for any other reasosn. Good thing I fixed more than 40 of those bugs in this release!

Readline Bug Fixes

The pure Go readline library is good in some ways and bad in others. A good portion of the bug fixes are for the readline library, and also related to text input with east asian characters and the like (Korean, Japanese, etc.)

A few of the fixes (and additions) include:

  • Fixing various crashes, including when there is a “stray” newline at the end of text
  • Grid completion menu causing spam and duplicate text when there are items longer than the terminal and/or contain Japanese or other characters.
  • Cursor positioning with CJK characters
  • Adding new keybinds and fixing others

Other fixes

There are a lot more fixes, even more than the ones listed here, but these are the main ones: - Don’t put alias expanded command in history (I’ve fixed this 5 times now….) - Handle stdin being nonblocking - Completion related fixes, like showing the full name, completing files with spaces

Breaking changes

This release is a major version bump not only because there are tons of fixes, but because there are breaking changes. This means that there are some changes done which would cause errors with an old user config (breaking).

Lua 5.4

The most important is the use of a new Lua VM library. Previously, Hilbish used gopher-lua, which implements Lua 5.1. This has been changed to golua , which implements Lua 5.4.

Moving from 5.1 to 5.4 does have breaking changes even if it doesn’t seem like it, and since these are different Lua implementations, there may be some differences there too.

Userdata

Previously, objects such as jobs or timers were represented by tables. This has been changed to userdata to make more sense.

Other changes

Runner functions are now required to return a table. It can (at the moment) have 4 variables:

  • input (user input)
  • exitCode (exit code)
  • error (error message)
  • continue (whether to prompt for more input) User input has been added to the return to account for runners wanting to prompt for continued input, and to add it properly to history. continue got added so that it would be easier for runners to get continued input without having to actually handle it at all.

The MacOS config paths now match Linux, since it makes more sense for a program like Hilbish.

The Hilbish greeting is now an opt, and is printed by default.

Feature Additions

Besides fixes and changes, this release also includes a good portion of new features! Users can now add handlers for syntax highlighting and inline hinting.

Some new hooks have been added, like hilbish.cancel and hilbish.init. You can look at all the hooks via the doc hooks command

Job management functions have also been added. You can now put jobs in the foreground/background and disown them via the expected commands and also via the Lua API.

The hilbish.timers API interface was also added in this release!

Closing Off

Hilbish has gone from something small and simple for myself to a slightly advanced shell with a decent amount of features, and a few users. It still hasn’t reached levels of other alt shells in regards to literally everything, but the goal is to get there!

If you want to check the FULL changelog, you can do so here. This v2.0 release marks an advancement in Hilbish (and also how long one of my projects hasn’t died) and I hope it can advance even further.

Thanks for reading, and I’ll be back for the v2.1 release notes, or maybe something else in between.