Releases: Rosettea/Hilbish
Releases · Rosettea/Hilbish
Hilbish v2.3.0
Added
commander.registry
function to get all registered commanders.fs.pipe
function to get a pair of connected files (a pipe).- Added an alternative 2nd parameter to
hilbish.run
, which isstreams
.
streams
is a table of input and output streams to run the command with.
It uses these 3 keys:input
as standard input for the commandout
as standard outputerr
as standard error
Here is a minimal example of the new usage which allows users to now pipe commands
directly via Lua functions:
local fs = require 'fs'
local pr, pw = fs.pipe()
hilbish.run('ls -l', {
stdout = pw,
stderr = pw,
})
pw:close()
hilbish.run('wc -l', {
stdin = pr
})
Changed
- The
-S
flag will be set to Hilbish's absolute path - Hilbish now builds on any Unix (if any dependencies also work, which should.)
Fixed
- Fix ansi attributes causing issues with text when cut off in greenhouse
- Fix greenhouse appearing on terminal resize
- Fix crashes when history goes out of bounds when using history navigation
exec
command should return if no arg presented- Commanders can now be cancelled by Ctrl-C and wont hang the shell anymore.
See issue 198. - Shell interpreter can now preserve its environment and set PWD properly.
Hilbish v2.2.3
Fixed
- Highligher and hinter work now, since it was regressed from the previous minor release.
cat
command no longer prints extra newline at end of each file
Added
cat
command now reads files in chunks, allowing for reading large files
Hilbish v2.2.2
Fixed
- Line refresh fixes (less flicker)
- Do more checks for a TTY
- Panic if ENOTTY is thrown from readline
- use
x/term
function to check if a terminal
Added
- Page Up/Down keybinds for Greenhouse will now scroll up and down the size of the region (a page)
Changed
- Remove usage of
hilbish.goro
in Greenhouse. - Values in
hilbish
table are no longer protected. This means
they can be overridden. (#287)
Hilbish v2.2.1
Fixed
- Removed a left over debug print
- Recover panic in
hilbish.goro
Hilbish v2.2.0
Added
- Native Modules
- Made a few additions to the sink type:
read()
method for retrieving input (so now thein
sink of commanders is useful)flush()
andautoFlush()
related to flushing outputspipe
property to check if a sink with input is a pipe (like stdin)
- Add fuzzy search to history search (enable via
hilbish.opts.fuzzy = true
) - Show indexes on cdr list and use ~ for home directory.
- Fix doc command not displaying correct subdocs when using shorthand api doc access (
doc api hilbish.jobs
as an example) hilbish.messages
interface (details in [#219])hilbish.notification
signal when a message/notification is sentnotifyJobFinish
opt to send a notification when background jobs arehilbish.goVersion
for the version of Go used to compile Hilbish.
completed.- Allow numbered arg substitutions in aliases.
- Example:
hilbish.alias('hello', 'echo %1 says hello')
allows the user to runhello hilbish
which will outputhilbish says hello
.
- Example:
- Greenhouse
- Greenhouse is a pager library and program. Basic usage is
greenhouse <file>
- Using this also brings enhancements to the
doc
command like easy
navigation of neighboring doc files.
Ctrl-N can be used for the table of contents, which views adjacent documentation.
- Greenhouse is a pager library and program. Basic usage is
Changed
- Documentation for EVERYTHING has been improved, with more
information added, code example, parameter details, etc.
You can see the improvements! - Documentation has gotten an uplift in the
doc
command.
This includes:- Proper highlighting of code
- Paging (via Greenhouse)
- Highlighting more markdown things
Fixed
- Fix panic when runner doesn't return a table
- Fix edge case of crash on empty alias resolve
- File completion on Windows
- Job management commands work now
- Fix infinite loop when navigating history without any history. #252
- Return the prefix when calling
hilbish.completions.call
. #219 - Replaced
sed
in-place editing withgrep
andmv
for compatibility with BSD utils
Hilbish v2.1.2
Removed
- Bad april fools code ;(
Hilbish v2.1.1
Added
- Validation checks for command input
- Improved runtime performance
- Validate Lua code
Hilbish v2.1.0
Added
- Documented custom userdata types (Job and Timer Objects)
- Coming with this fix is also adding the return types for some functions that were missing it
- Added a dedicated input and dedicated outputs for commanders (sinks - info at
doc api commander
). - Local docs is used if one of Hilbish's branches is found
- Return 1 exit code on doc not found
hilbish.runner.getCurrent()
to get the current runner- Initialize Hilbish Lua API before handling signals
Fixed
index
or_index
subdocs should not show up anymorehilbish.which
not working correctly with aliases- Commanders not being able to pipe with commands or any related operator.
- Resolve symlinks in completions
- Updated
runner-mode
docs - Fix
hilbish.completion
functions panicking when empty input is provided
Hilbish v2.0.1
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
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 havePREFIX="/usr/"
when runningtask build
ortask 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 thehilbish.hinter
function.
For more info, look at its docs with thedoc hilbish
command. - Syntax highlighting function. To make a handler for it, set
hilbish.highlighter
. Same thing as the hinter, checkdoc 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.
#122fs.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)
andexecPath
is absolute path to command executablejob.add
hook is thrown when a job is added. acts as a unique hook for
jobshilbish.jobs.disown(id)
anddisown
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
andstderr
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 viahilbish.vim.mode
hilbish.version
interface for more info about Hilbish's version. This
includes git commit, branch, and (new!!) release name.- Added
fg
andbg
builtins job.foreground()
andjob.background()
, whenjob
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 pathfs.dir(path)
gets the directory part of pathfs.glob(pattern)
globs files and directories based on patternsfs.join(dirs...)
joins directories by OS dir separator
- .. and 2 properties
fs.pathSep
is the separator for filesystem paths and directoriesfs.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,
sethilbish.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)
removeshandler
for the namedevent
exec
,clear
andcat
builtin commandshilbish.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 usinghilbish.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 withcommand.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
Luajob.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 ofFiles\ to\
wi...