my absolutely terrible april fools release was made on a separate branch. this pr merges the fixes on master so history can be synced up. (and mainly to get the 2.1.2 blog post)
* feat: add read method to sinks
* feat: add manual flush method for sinks
* fix: add flush as sink method and fix arg amount for read
* feat: add pipe property to sinks to see if stdin sink is a pipe
* feat: add method autoFlush to toggle/change automatic flushing
* chore: update changelog
to write output, you would usually just use the print builtin
since commanders are just lua custom commands but this does not
consider the fact of pipes or other shell operators being used
to redirect or whatever.
this adds readable/writable "sinks" which is a type for input
or output and is currently only used for commanders but can be
used for other hilbish things in the future
fixes an issue of going up and down in history results in the incorrect order of commands being inserted (nothing happens to the order in the history itself, just when navigating via arrow keys)
* fix: provide correct command when navigating history
previously, the order while navigating history
with the arrow keys would be incorrect
meaning the command you expect if you go u
then go back down would not be there
* chore: update changelog
* refactor: use custom event emitter
* fix: sigint hook emit on windows
* fix: restore correct hilbish conf file
* fix: call recoverer for go listeners
* refactor(golibs/bait): use 1 map for listeners
* feat: add once listeners, ability to remove listeners and remove listener on error
* perf: reslice listener slice instead of trying to do ordered move with append
* feat(bait): add release function to remove event listener
* perf: remove listener directly from once emit instead of using off function
* refactor: use bait event emitter on commander
* docs(golibs/bait): add doc strings for functions
* docs: set changelog
* docs(golibs/bait): add docs for lua release function
* refactor: put file history handler in line reader instance instead of global
* feat: add lua history handler in go
* feat: use lua to retrieve readline history
* refactor: handle history in lua
this also introduces a new opt: history
if it is false, command history won't get added
* fix: remove nature.history require
* docs: add changes in changelog
* fix: add comma after history opt
* build!: replace make with task
allows easy windows building (besides literally go build)
down the line because getting make on windows is dumb
and even if you do it probably wouldnt work as intended
on there
(i also find task more intuitive for simple things)
* ci: use task in build workflow instead of make
* style: remove whitespace errors in task file
* docs: add task in changelog
* docs: fix link to task
* docs: change message for task notice
* refactor!: make runners require returning a table
allows for more options for runners in the future,
and makes it so that you can avoid passing
certain args more easily.
* feat: allow runners to specify continue in return to prompt for more input
* docs: update changelog
* refactor: reorder returns of handleSh function
* refactor: move out reprompting and runner handling to functions
makes codefactor happy hopefully. this commit includes
a fix to check if after reprompt the user hits ctrl d
and just exits cleanly
any interface which has lua side objects that are from go side for its api (namely jobs) they will use userdata instead of always creating a table to represent the object. this might or might not bring lower ram usage since there is now only 1 single reference to an object instead of always creating a table to expose on lua
breaking change since methods need to be called with a colon instead of dot
* feat: add hilbish.job.add function
this is mainly to accomodate for the employer
handler (#152)
* feat!: add start function to jobs
the commit itself adds a few things but the
main purpose is to facilitate a lua side start
function that can restart the job
there is a breaking change in the hilbish.job.add
function; it is now required to provide an extra
table for arguments, since the first cmd
table isnt really what's actually ran
* fix: reuse standard files for jobs
* fix: deadlock in lua job add function and not taking proper amount of args
* fix: assign binary path to job
* feat: emit job.add hook when job is added
* chore: update modules
* fix: use setpgid on cmd procattr for background jobs
* fix: use right procattr on correct os
* fix: set bg proc attr in build tagged file
* feat: add disown function
* fix: stop jobs on exit
* feat: add disown command
* feat: add jobs.last function to get last job
* feat: make disown command get last job if id isnt suppied as arg
* chore: remove unused code
* feat: add job output
* chore: fix comments
* fix!: make exec path in job add explicit in lua side
* docs: add docs and changelogs relating to jobs