Hilbish v1.0.0
the big release. almost 200 commits from v0.7.1 and lots of new features and fixes.
a major change, more than all the others, is a new line editor library. hilbish no longer depends on gnu readline!
Added
- MacOS is now officialy supported, default compile time vars have been added
for it - Windows is properly supported as well
catchOnce()
to bait - catches a hook oncehilbish.aliases
interface - allows you to add, delete and list all aliases
with Luahilbish.appendPath()
can now take a table of arguments for ease of usehilbish.which(binName)
acts as the which builtin for other shells,
it finds the path tobinName
in $PATH- Signal hooks
sigusr1
andsigusr2
(unavailable on Windows) - Commands starting with a space won't be added to history
- Vim input mode
- Hilbish's input mode for text can now be changed to either Emacs
(like it always was) or Vim viahilbish.inputMode()
- Changing Vim mode throws a
hilbish.vimMode
hook - The current Vim mode is also accessible with the
hilbish.vimMode
property
- Hilbish's input mode for text can now be changed to either Emacs
- Print errors in
hilbish.timeout()
andhilbish.goro()
callbacks hilbish.exit
hook is thrown when Hilbish is going to exithilbish.exitCode
property to get the exit code of the last executed commandscreenMain
andscreenAlt
functions have been added to Ansikit to switch
to the terminal's main and alt buffer respectively
Fixed
- Tab completion for executables
- Stop interval (
hilbish.interval()
) when an error occurs - Errors in bait hooks no longer cause a panic, and remove the handler for the hook as well
- Formatting of home dir to ~
- Check if Hilbish is in interactive before trying to use its handlers for signals
- Global
args
table when running as script is no longer userdata - Home dir is now added to recent dirs (the case of cd with no arg)
index
subdoc will no longer appear- Alias expansion with quotes
- Add full command to history in the case of incomplete input
hilbish.exec()
now has a windows substitute- Fixed case of successful command after prompted for more input not writing to history
command.exit
is thrown when sh input is incorrect and when command executed after continue
prompt exits successfully
Changed
- The minimal config is truly minimal now
- Default config is no longer copied to user's config and is instead ran its location
Breaking Changes
(there were a lot...)
- Change default SHLVL to 0 instead of 1
- ~/.hilbishrc.lua will no longer be run by default, it now
only uses the paths mentioned below. - Changed Hilbish's config path to something more suited
according to the OS ($XDG_CONFIG_HOME/hilbish/init.lua
on Linux,
~/Library/Application Support/hilbish/init.lua
on MacOS and
(%APPDATA%/hilbish/init.lua
on Windows). Previously on Unix-like it was
$XDG_CONFIG_HOME/hilbish/hilbishrc.lua
- The history path has been changed to a better suited path.
On Linux, it is$XDG_DATA_HOME/hilbish/.hilbish-history
and for others it is
the config path. hilbish.xdg
no longer exists, usehilbish.userDir
instead,
as it functions the same but is OS agnostichilbish.flag()
has been removed~/.hprofile.lua
has been removed, instead check in your config ifhilbish.login
is truehilbish.complete()
has had a slight refactor to fit with the new readline library.
It now expects a table of "completion groups" which are just tables with the
type
anditems
keys. Here is a (more or less) complete example of how it works now:Completer functions are now also expected to handle subcommands/subcompletionshilbish.complete('command.git', function() return { { items = { 'add', 'clone' }, type = 'grid' }, { items = { ['--git-dir'] = {'Description of flag'}, '-c' }, type = 'list' } } end)