Skip to content

Releases: Rosettea/Hilbish

Hilbish v2.0.1

29 Dec 02:24
2a80795
Compare
Choose a tag to compare

Fixed

  • Corrected documentation for hooks, removing outdated command.no-perm
  • Fixed an issue where cd with no args would not update the old pwd
  • Tiny documentation enhancements for the hilbish.timer interface

Hilbish v2.0.0

21 Dec 02:14
97188e7
Compare
Choose a tag to compare

NOTES FOR USERS/PACKAGERS UPDATING:

  • Hilbish now uses Task insead of Make for builds.
  • The doc format has been changed from plain text to markdown.
    YOU MUST reinstall Hilbish to remove the duplicate, old docs.
  • Hilbish will by default install to /usr/local instead of just /usr/
    when building via Task. This is mainly to avoid conflict of distro packages
    and local installs, and is the correct place when building from git either way.
    To keep Hilbish in /usr, you must have PREFIX="/usr/" when running task build or task install
  • Windows is no longer supported. It will build and run, but will have problems.
    If you want to help fix the situation, start a discussion or open an issue and contribute.

Added

  • Inline hints, akin to fish and the others.
    To make a handler for hint text, you can set the hilbish.hinter function.
    For more info, look at its docs with the doc hilbish command.
  • Syntax highlighting function. To make a handler for it, set
    hilbish.highlighter. Same thing as the hinter, check doc hilbish for
    more info/docs.
  • Ctrl+K deletes from the cursor to the end of the line. (#128)
  • Alt+Backspace as an alternative of Ctrl+W to delete a word. (#132)
  • Enhanced timer API (doc timers)
  • Don't exit until intervals are stopped/finished when running a non interactive script.
  • Ctrl+D deletes character below cursor if line isn't empty instead of exiting.
  • Ctrl+Delete to forward delete a word.
  • Right prompt (#140)
  • Ctrl+_ to undo in Emacs input mode.
  • Emacs style forward/backward word keybinds (#139)
  • hilbish.completion.call to call a completion handler (doc completions)
  • hilbish.completion.handler to set a custom handler for completions. This
    is for everything/anything as opposed to just adding a single command completion.
    #122
  • fs.abs(path) to get absolute path.
  • Nature module (doc nature)
  • hilbish.jobs.add(cmdstr, args, execPath) to add a job to the job table.
    cmdstr would be user input, args is the args for the command (includes arg0)
    and execPath is absolute path to command executable
  • job.add hook is thrown when a job is added. acts as a unique hook for
    jobs
  • hilbish.jobs.disown(id) and disown builtin to disown a job. disown
    without arguments will disown the last job.
  • hilbish.jobs.last() returns the last added job.
  • Job output (stdout/stderr) can now be obtained via the stdout and stderr
    fields on a job object.
  • Documentation for jobs is now available via doc jobs.
  • hilbish.alias.resolve(cmdstr) to resolve a command alias.
  • hilbish.opts for shell options.
  • hilbish.editor interface for interacting with the line editor that
    Hilbish uses.
  • hilbish.vim interface to dynamically get/set vim registers.
    Example usage: hilbish.vim.registers['a'] = 'hello'. You can also
    get the mode with it via hilbish.vim.mode
  • hilbish.version interface for more info about Hilbish's version. This
    includes git commit, branch, and (new!!) release name.
  • Added fg and bg builtins
  • job.foreground() and job.background(), when job is a job object,
    foreground and backgrounds a job respectively.
  • Friendlier functions to the hilbish.runner interface, which also allow
    having and using multiple runners.
  • A few new functions to the fs module:
    • fs.basename(path) gets the basename of path
    • fs.dir(path) gets the directory part of path
    • fs.glob(pattern) globs files and directories based on patterns
    • fs.join(dirs...) joins directories by OS dir separator
  • .. and 2 properties
    • fs.pathSep is the separator for filesystem paths and directories
    • fs.pathListSep is the separator for $PATH env entries
  • Lua modules located in hilbish.userDir.data .. '/hilbish/start' (like ~/.local/share/hilbish/start/foo/init.lua)
    will be ran on startup
  • hilbish.init hook, thrown after Hilbish has initialized Lua side
  • Message of the day on startup (hilbish.motd), mainly intended as quick
    small news pieces for releases. It is printed by default. To disable it,
    set hilbish.opts.motd to false.
  • history opt has been added and is true by default. Setting it to false
    disables commands being added to history.
  • hilbish.rawInput hook for input from the readline library
  • Completion of files in quotes
  • A new and "safer" event emitter has been added. This causes a performance deficit, but avoids a lot of
    random errors introduced with the new Lua runtime (see #197)
  • bait.release(name, catcher) removes handler for the named event
  • exec, clear and cat builtin commands
  • hilbish.cancel hook thrown when user cancels input with Ctrl-C
  • 1st item on history is now inserted when history search menu is opened (#148)
  • Documentation has been improved vastly!

Changed

  • Breaking Change: Upgraded to Lua 5.4.
    This is probably one of (if not the) biggest things in this release.
    To recap quickly on what matters (mostly):
    • os.execute returns 3 values instead of 1 (but you should be using hilbish.run)
    • I/O operations must be flushed (io.flush())
  • Breaking Change: MacOS config paths now match Linux.
  • Overrides on the hilbish table are no longer permitted.
  • Breaking Change: 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.
  • Breaking Change: Job objects and timers are now Lua userdata instead
    of a table, so their functions require you to call them with a colon instead
    of a dot. (ie. job.stop() -> job:stop())
  • All fs module functions which take paths now implicitly expand ~ to home.
  • Breaking Change: hilbish.greeting has been moved to an opt (hilbish.opts.greeting) and is
    always printed by default. To disable it, set the opt to false.
  • Breaking Change: command.no-perm hook has been replaced with command.not-executable
  • History is now fetched from Lua, which means users can override hilbish.history
    methods to make it act how they want.
  • guide has been removed. See the website
    for general tips and documentation

Fixed

  • If in Vim replace mode, input at the end of the line inserts instead of
    replacing the last character.
  • Make forward delete work how its supposed to.
  • Prompt refresh not working properly.
  • Crashing on input in xterm. (#131)
  • Make delete key work on st (#131)
  • hilbish.login being the wrong value.
  • Put full input in history if prompted for continued input
  • Don't put alias expanded command in history (sound familiar?)
  • Handle cases of stdin being nonblocking (in the case of #136)
  • Don't prompt for continued input if non interactive
  • Don't insert unhandled control keys.
  • Handle sh syntax error in alias
  • Use invert for completion menu selection highlight instead of specific
    colors. Brings an improvement on light themes, or themes that don't follow
    certain color rules.
  • Home/End keys now go to the actual start/end of the input.
  • Input getting cut off on enter in certain cases.
  • Go to the next line properly if input reaches end of terminal width.
  • Cursor position with CJK characters has been corrected (#145)
  • Files with same name as parent folder in completions getting cut off #130)
  • hilbish.which now works with commanders and aliases.
  • Background jobs no longer take stdin so they do not interfere with shell
    input.
  • Full name of completion entry is used instead of being cut off
  • Completions are fixed in cases where the query/line is an alias alone
    where it can also resolve to the beginning of command names.
    (reference this commit)
    for explanation.
  • Jobs now throw job.done and set running to false when stopped via
    Lua job.stop function.
  • Jobs are always started in sh exec handler now instead of only successful start.
  • SIGTERM is handled properly now, which means stopping jobs and timers.
  • Fix panic on trailing newline on pasted multiline text.
  • Completions will no longer be refreshed if the prompt refreshes while the
    menu is open.
  • Print error on search fail instead of panicking
  • Windows related fixes:
    • hilbish.dataDir now has tilde (~) expanded.
    • Arrow keys now work on Windows terminals.
    • Escape codes now work.
  • Escape percentage symbols in completion entries, so you will no longer see
    an error of missing format variable
  • Fix an error with sh syntax in aliases
  • Prompt now works with east asian characters (CJK)
  • Set back the prompt to normal after exiting the continue prompt with ctrl-d
  • Take into account newline in input when calculating input width. Prevents
    extra reprinting of the prompt, but input with newlines inserted is still a problem
  • Put cursor at the end of input when exiting $EDITOR with Vim mode bind
  • Calculate width of virtual input properly (completion candidates)
  • Users can now tab complete files with spaces while quoted or with escaped spaces.
    This means a query of Files\ to\ wi...
Read more

Hilbish v2.0.0-rc1

14 Oct 23:26
Compare
Choose a tag to compare
Hilbish v2.0.0-rc1 Pre-release
Pre-release

This is a pre-release version of Hilbish for testing. To see the changelog,
refer to the Unreleased section of the full changelog
(version 2.0.0 for future reference).

Hilbish v1.2.0

23 Mar 02:13
Compare
Choose a tag to compare

Added

  • Job Management additions
    • job.start and job.done hooks (doc hooks job)
    • hilbish.jobs interface (get(id) function gets a job object via id, all() gets all)
  • Customizable runner/exec mode
    • However Hilbish runs interactive user input can now be changed Lua side (doc runner-mode)

Changed

  • vimMode doc is now vim-mode

Fixed

  • Make sure input which is supposed to go in history goes there
  • Cursor is right at the end of input on history search

Hilbish v1.1.0

18 Mar 00:59
Compare
Choose a tag to compare

Added

  • hilbish.vimAction hook (doc vimMode actions)
  • command.not-executable hook (will replace command.no-perm in a future release)

Fixed

  • Check if interactive before adding to history
  • Escape in vim mode exits all modes and not only insert
  • Make 2nd line in prompt empty if entire prompt is 1 line
  • Completion menu doesnt appear if there is only 1 result
  • Ignore SIGQUIT, which caused a panic unhandled
  • Remove hostname in greeting on Windows
  • Handle PATH binaries properly on Windows
  • Fix removal of dot in the beginning of folders/files that have them for file complete
  • Fix prompt being set to the continue prompt even when exited

Hilbish v1.0.4

13 Mar 02:33
Compare
Choose a tag to compare

Fixed

  • Panic when history directory doesn't exist

Hilbish v1.0.3

13 Mar 00:11
Compare
Choose a tag to compare

Fixed

  • Removed duplicate executable suggestions
  • User input is added to history now instead of what's ran by Hilbish
  • Formatting issue with prompt on no input

Hilbish v1.0.2

07 Mar 01:49
Compare
Choose a tag to compare

Fixed

  • Cases where Hilbish's history directory doesn't exist will no longer cause a panic

Hilbish v1.0.1

06 Mar 21:25
Compare
Choose a tag to compare

Fixed

  • Using hilbish.appendPath will no longer result in string logs (debugging thing left being)
  • Prompt gets set properly on startup

Hilbish v1.0.0

06 Mar 19:12
Compare
Choose a tag to compare

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 once
  • hilbish.aliases interface - allows you to add, delete and list all aliases
    with Lua
  • hilbish.appendPath() can now take a table of arguments for ease of use
  • hilbish.which(binName) acts as the which builtin for other shells,
    it finds the path to binName in $PATH
  • Signal hooks sigusr1 and sigusr2 (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 via hilbish.inputMode()
    • Changing Vim mode throws a hilbish.vimMode hook
    • The current Vim mode is also accessible with the hilbish.vimMode property
  • Print errors in hilbish.timeout() and hilbish.goro() callbacks
  • hilbish.exit hook is thrown when Hilbish is going to exit
  • hilbish.exitCode property to get the exit code of the last executed command
  • screenMain and screenAlt 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, use hilbish.userDir instead,
    as it functions the same but is OS agnostic
  • hilbish.flag() has been removed
  • ~/.hprofile.lua has been removed, instead check in your config if hilbish.login
    is true
  • hilbish.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 and items keys. Here is a (more or less) complete example of how it works now:
     hilbish.complete('command.git', function()
     	return {
     		{
     			items = {
     				'add',
     				'clone'
     			},
     			type = 'grid'
     		},
     		{
     			items = {
     				['--git-dir'] = {'Description of flag'},
     				'-c'
     			},
     			type = 'list'
     		}
     	}
     end)
    Completer functions are now also expected to handle subcommands/subcompletions