Releases: Rosettea/Hilbish
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)
Hilbish v0.7.1
"hot" fixes
what happens when i dont properly test
Fixes
- Tab complete absolute paths to binaries properly
- Allow execution of absolute paths to binaries (0627277 regression)
Hilbish v0.7.0
0.7!! not quite a rich feature set or bug fix amount but still a big release nonetheless
hilbish.interactive
andhilbish.login
properties to figure out if Hilbish is interactive or a login shell, respectively.hilbish.read
function to take input more elegantly than Lua'sio.read
- Tab Completion Enhancements
- A new tab complete API has been added. It is the single
complete
function which takes a "scope" (example:command.<cmdname>
) and a callback which is
expected to return a table. Users can now add custom completions for specific commands.
An example is:
Forcomplete('command.git', function() return { 'add', 'version', commit = { '--message', '--verbose', '<file>' } } end)
git
, Hilbish will complete commands add, version and commit. For the commit subcommand, it will complete the flags and/or files which<file>
is used to represent.- Hilbish will now complete binaries in $PATH, or any executable to a path (like
./
or../
) - Files with spaces will be automatically put in quotes and completions will work for them now.
- A new tab complete API has been added. It is the single
prependPath
function (#81)- Signal hooks (#80)
- This allows scripts to add their own way of handling terminal resizes (if you'd need that) or Ctrl-C
- Module properties (like
hilbish.ver
) are documented with thedoc
command. - Document bait hooks
- The prompt won't come up on terminal resize anymore.
appendPath
should work properly on Windows.- A panic when a commander has an error has been fixed.
Hilbish v0.6.1
a simple bug fix release
Fixes/Changes
- Require paths now use the
dataDir
variable so there is no need to change it anymore unless you want to add more paths - Remove double slash in XDG data require paths
- Ctrl+C is handled properly when not interactive and won't result in a panic anymore
- Commanders are handled by the sh interpreter library only now, so they work with sh syntax
- Error messages from
fs
functions now include the path provided
Hilbish v0.6.0
it's been 3 months since the last release! wow, time goes fast
today, i bring yet another feature filled release!
Additions/New Features
- Hilbish will expand
~
in the preloadPath and samplePathConf variables. These are for compile time. - On Windows, the hostname in
%u
has been removed. - Made it easier to compile on Windows by adding Windows-tailored vars and paths.
- Add require paths
./libs/?/?.lua
- Hilbish will now respect $XDG_CONFIG_HOME and will load its config and history there first and use Lua libraries in there and $XDG_DATA_HOME if they are set. (#71)
- If not, Hilbish will still default to
~
- If not, Hilbish will still default to
- Added some new hooks
command.precmd
is thrown right before Hilbish prompts for inputcommand.preexec
is thrown right before Hilbish executes a command. It passes 2 arguments: the command as the user typed, and what Hilbish will actually execute (resolved alias)
hilbish.dataDir
is now available to know the directory of Hilbish data files (default config, docs, preload, etc)- A
docgen
program has been added tocmd/docgen
in the GitHub repository, As the name suggests, it will output docs in adocs
folder for functions implemented in Go - All hilbish modules/libraries now have a
__doc
metatable entry which is simply a short description of the module. fs.readdir(dir)
has been added. It will return a table of files indir
- Errors in the
fs.mkdir
function are now handled. - Breaking Change:
fs.cd
no longer returns a numeric code to indicate error. Instead, it returns an error message. - The
doc
command has been added to document functions of Hilbish libraries. Run the command for more details. link(url, text)
has been added toansikit
. It returns a string which can be printed to produce a hyperlink in a terminal. Note that not all terminals support this feature.- The Succulent library has been added. This includes more utility functions and expansions to the Lua standard library itself.
- The command string is now passed to the
command.exit
hook
Fixes/Changes
timeout()
is now blocking- Directories with spaces in them can now be
cd
'd to - An alias with the same name as the command will now not cause a freeze (#73)
command.exit
with 0 exit code will now be thrown if input is nothing- Breaking Change:
fs.stat
has been made better. It returns a proper table instead of userdata, and has fields instead of functions- It includes
name
,mode
as a octal representation in a string,isDir
, andsize
- It includes
- Hilbish won't print an extra newline at exit with ctrl + d
- Userdata is no longer returned in the following cases:
- Commander arguments
fs
functions
New Contributors
- @L3afMe made their first contribution in #71
- @angelofallars made their first contribution in #72
- @ratogabriel made their first contribution in #73
More submodules have been added, so you'll have to update those.
Hilbish v0.5.1
Tiny little minor update
Features/Additions
- Add
~/.config/hilbish
as a require path
Fixes/Changes
- Handle error in commander properly, preventing a panic from Lua
cd
hook is only thrown after directory has actually changed
Hilbish v0.5.0
Hilbish 0.5!!
An absolutely massive release. Probably the biggest yet, includes a bunch of fixes and new features and convenient additions to the Lua API.
Additions/New Features
-n
flag, which checks Lua for syntax errors without running itexec(command)
function, acts like theexec
builtin in sh- Example:
exec 'awesome'
in an .xinitrc file with Hilbish as shebang
- Example:
- Commands from commander can now
return
an exit code-
When
commander.register('false', function() return 1 end)
false
is run, it will have the exit code of1
, this is shorter/easier than throwing the command.exit hook and can work if the functionality of that changes
-
- Added
-c
description args
variable, set when Hilbish runs a Lua script. It is an array that includes the execute path as the first argument- Lua code can be aliased
- Recursive aliases
- At the moment this only works for the first argument
- Breaking Change: Move
_user
and_ver
to a globalhilbish
table- Accessing username and Hilbish version is now done with
hilbish.user
andhilbish.ver
- Accessing username and Hilbish version is now done with
hilbish.run(cmd)
runscmd
with Hilbish's sh interpreter. Using this function instead ofos.execute
ensures that sh syntax works everywhere Hilbish does.hilbish.flag(flag)
checks ifflag
has been passed to Hilbish.- Hilbish can now be used with Hilbiline if compiled to do so (currently only for testing purposes)
- Aliases now work with every command and not only the first one
- Therefore
alias1; alias2
works now
- Therefore
command.not-found
hookgoro(func)
runs afunc
tion in a goroutine. With channels that gopher-lua also provides, one can do parallelism and concurrency in Lua (but go style).coroutine
no those dont exist they dont mattergoro
is easier
cd -
will change to the previous directoryhilbish.cwd()
gets the current working directory$SHLVL
is now incremented in Hilbish. If not a valid number, it will be changed to 1timeout(func, time)
works exactly like thesetTimeout
function in JavaScript. It will runfunc
after a period oftime
in milliseconds.interval(func, time)
works exactly like thesetInterval
function in JavaScripit. It will runfunc
everytime
millisecondshilbish.home
is a crossplatform Lua alternative to get the home directory easily.fs.mkdir
can now make directories recursively if the 2nd argument is set totrue
fs.mkdir('path/to/dir', true)
commander.deregister(cmdName)
de-registers any command defined with commander.
Fixes/Changes
- Hilbish runs a
preload.lua
file in the current directory first, then falls back to the global preload. Before the order was reversed. cd
now exits with code1
instead of the error code if it occurs- Check if aliased command is defined in Lua, so registered
commander
s can be aliased - Don't append directory to $PATH with
appendPath
if its already there - Continued input is no longer joined with a space unless explicitly wanted
- Add input to history before alias expansion. Basically, this adds the actual alias to history instead of the aliased command.
- Hilbish won't try to go interactive if it isnt launched in a TTY (terminal)
- Global preload path, require paths, default config directory and sample config directory can now be changed at compile time to help support other systems.
- Ctrl+d on a continue prompt with no input no longer causes a panic
- Actually handle the
-h
/--help
option
Hilbish v0.4.0
Hilbish v0.4
woooooooo this is a release long awaited, 69 commits (nice :)) since previous 0.3.2
- Ctrl C in the prompt now cancels/clear input (ive needed this for so long also)
- Made Hilbish act like a login shell on login
- If Hilbish is the login shell, or the
-l
/--login
flags are used, Hilbish will use an additional~/.hprofile.lua
file,
you can use this to set environment variables once on login
- If Hilbish is the login shell, or the
-c
has been added to run a single command (this works exactly like being in the prompt would, so Lua works as well)-i
(also--interactive
) has been added to force Hilbish to be an interactive shell in cases where it usually wont be (like with-c
)- Use readline in continue prompt
- Added a
mulitline
hook that's thrown when in the continue/multiline prompt - Fix makefile adding Hilbish to
/etc/shells
on everymake install
- Added
appendPath
function to append a directory to$PATH
~
will be expanded to$HOME
as well
- A utility
string.split
function is now addedstring.split(str, delimiter)
- A getopt-like library is now used for command line flag parsing
cd
builtin now supports using environment variables- This means you can now
cd $NVM_DIR
as an example
- This means you can now
- Function arguments are now more strictly typed (
prompt(nil)
wouldnt work now) - Added a
_user
variable to easily get current user's name - BREAKING Change: Lunacolors has replaced ansikit for formatting colors, which means the format function has been removed from ansikit and moved to Lunacolors.
- Users must replace ansikit with
lunacolors
in their config files
- Users must replace ansikit with
- Other general code/style changes
Since Lunacolors is a submodule, you may just want to completely reclone Hilbish recursively and then update (rerun make install
)
Or instead of recloning, run git submodule update --init --recursive
in Hilbish's git directory
Hilbish v0.3.2
Hilbish v0.3.1
- Fix
%u
in prompt format being full name and instead make it actually username