mirror of
https://github.com/sammy-ette/Hilbish
synced 2025-08-10 02:52:03 +00:00
* docs: add changelog.md * fix: Fix formatting in a section * fix: changelog.md - remove stray line (l143) and bullet point (l34)
9.6 KiB
9.6 KiB
🎀 Changelog
This is the changelog for the Hilbish shell made in Go and Lua.
0.5.1 - 2021-06-16
Added
- Add
~/.config/hilbishas a require path
Changed
cdhook is only thrown after directory has actually changed
Fixed
- Handle error in commander properly, preventing a panic from Lua
0.5.0 - 2021-06-12
An absolutely massive release. Probably the biggest yet, includes a bunch of fixes and new features and convenient additions to the Lua API.
Added
-nflag, which checks Lua for syntax errors without running itexec(command)function, acts like theexecbuiltin in sh- Example:
exec 'awesome'in an .xinitrc file with Hilbish as shebang
- Example:
- Commands from commander can now
returnan exit code
commander.register('false', function()
return 1
end)
When false is run, it will have the exit code of 1, this is shorter/easier than throwing the command.exit hook and can work if the functionality of that changes
- Added
-cdescription argsvariable, 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
- Hilbish can now be used with Hilbiline if compiled to do so (currently only for testing purposes)
goro(func)runs afunction in a goroutine. With channels that gopher-lua also provides, one can do parallelism and concurrency in Lua (but go style).coroutineno those dont exist they dont mattergorois easier
cd -will change to the previous directoryhilbish.cwd()gets the current working directorytimeout(func, time)works exactly like thesetTimeoutfunction in JavaScript. It will runfuncafter a period oftimein milliseconds.interval(func, time)works exactly like thesetIntervalfunction in JavaScripit. It will runfunceverytimemillisecondshilbish.homeis a crossplatform Lua alternative to get the home directory easily.commander.deregister(cmdName)de-registers any command defined with commander.
Changed
- Breaking Change: Move
_userand_verto a globalhilbishtable- Accessing username and Hilbish version is now done with
hilbish.userandhilbish.ver
- Accessing username and Hilbish version is now done with
hilbish.run(cmd)runs cmd with Hilbish's sh interpreter. Using this function instead ofos.executeensures that sh syntax works everywhere Hilbish does.hilbish.flag(flag)checks if flag has been passed to Hilbish.- Aliases now work with every command and not only the first one
- Therefore
alias1; alias2works now
- Therefore
command.not-foundhook$SHLVLis now incremented in Hilbish. If not a valid number, it will be changed to 1fs.mkdircan now make directories recursively if the 2nd argument is set totruefs.mkdir('path/to/dir', true)
- Hilbish runs a
preload.luafile in the current directory first, then falls back to the global preload. Before the order was reversed. - Check if aliased command is defined in Lua, so registered
commanders can be aliased - Add input to history before alias expansion. Basically, this adds the actual alias to history instead of the aliased command.
- Global preload path, require paths, default config directory and sample config directory can now be changed at compile time to help support other systems.
Fixed
cdnow exits with code1instead of the error code if it occurs- Don't append directory to $PATH with
appendPathif its already there - Continued input is no longer joined with a space unless explicitly wanted
- Hilbish won't try to go interactive if it isn't launched in a TTY (terminal)
- Ctrl+D on a continue prompt with no input no longer causes a panic
- Actually handle the
-h/--helpoption
0.4.0 - 2021-05-01
Added
- Ctrl C in the prompt now cancels/clear input (I've needed this for so long also)
- Made Hilbish act like a login shell on login
- If Hilbish is the login shell, or the
-l/--loginflags are used, Hilbish will use an additional~/.hprofile.luafile, you can use this to set environment variables once on login
- If Hilbish is the login shell, or the
-chas 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
mulitlinehook that's thrown when in the continue/multiline prompt - Added
appendPathfunction to append a directory to$PATH~will be expanded to$HOMEas well
- A utility
string.splitfunction is now addedstring.split(str, delimiter)
- Added a
_uservariable to easily get current user's name
Changed
- 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
lunacolorsin their config files
- Users must replace ansikit with
- A getopt-like library is now used for command line flag parsing
cdbuiltin now supports using environment variables- This means you can now
cd $NVM_DIRas an example
- This means you can now
- Function arguments are now more strictly typed (
prompt(nil)wouldnt work now) - Other general code/style changes
Fixed
- Fix makefile adding Hilbish to
/etc/shellson everymake install
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
0.3.2 - 2021-04-10
Added
- Add more functions to
ansikitmodule - Add functions
statandmkdirtofsmodule -Cflag to define path to config- Add require path
~/.local/share/hilbish/libs
Changed
- Continue to new line if output doesnt end with it
Observed:
0.3.1 - 2021-04-06
Fixed
- Fix
%uin prompt format being full name and instead make it actually username
0.3.0 - 2021-04-05
Added
- Added a
multipromptfunction to change the prompt of the multiline/continuation/newline prompt _vervariable to get Hilbish's version from Lua
Changed
- BREAKING Change: Removed Bait hooks
command.successandcommand.fail, there is now the single hookcommand.exit, with a single argument passed which the exit code of the command. Use this to determine if a command has failed or not (failure is code != 0) - BREAKING Change: The Ansikit function
texthas been renamed toformat. fs.cdnow throws an exception instead of silently failing, which you should handle withpcall- Enhancements to the
cdcommand:- With no arguments will move to $HOME
- Now throws a cd hook, with a single hook arg being the arguments to the command
- Now works for directories with spaces
- Lua input now throws a success hook if it succeeded
- Command history is now saved to
~/.hilbish-history - Globals defined in Lua that are strings will be defined as an env variable (#16)
- Input ending with
\will now go to a newline exitcommand is now written in Lua
Fixed
- Input is now trimmed
- Internals are slightly cleaned up and codebase split up
- Hilbish will now fall back to a builtin minimal config if the user's config has syntax errors on loading
- Commands defined in Lua now report the error to the user cleanly instead of panicking if it has occured
0.2.0 - 2021-03-31
Added
- Hooks (events) are the new and main thing in v0.2, you can now listen for hooks or cast out (emit) custom ones, via the bait package
^^to refer to the previous command. It's for the lazy hands like me, so I can do something likeENV=VAR ^^- Way more (more like any) comments in the core code.
Changed
- Prompt has been changed to have printf-like verbs to format. This makes it easier on the user's side to configure, and doesn't require hooks to change it for things like current directory.
- Default prompt's changed and the triangle changes color based on if command failed or not.
0.1.2 - 2021-03-24
Added
- Add Lua input to history
0.1.1 - 2021-03-24
Added
- Go to new line if sh input is incomplete
> for i in {1..5}
This input for example will prompt for more input to complete:
0.1.0 - 2021-03-24
Added
- Tab complete files
- Makefile installation
- sh support
0.0.12 - 2021-03-21
First "stable" release of Hilbish.