Commit Graph

49 Commits (d844b8dc227a1d06840d717f21fb873d5f12ab52)

Author SHA1 Message Date
sammyette c6c81ddece
feat: add notification/message interface (#239)
details in #219
2023-07-10 19:03:30 -04:00
sammyette 3eae0f07be
feat: add fuzzy searching for completion and history search (#247)
* feat: add fuzzy searching for completion and history search

* feat: add fuzzy opt for fuzzy history searching

* chore: add fuzzy opt to changelog
2023-07-10 00:06:29 -04:00
sammyette cbc5e81c9d
feat: show indexes on cdr list and change home to tilde (#253)
* feat: show indexes on cdr list and change home to tilde

* fix: remove underline in cdr help page
2023-07-09 18:43:21 -04:00
sammyette 013fa30658
fix: correct job management commands to call with colon 2023-02-19 15:11:55 -04:00
sammyette 7bfd7b12c4
fix(commands/doc): only highlight real headings 2023-02-10 17:03:03 -04:00
sammyette 6dbb39d404
chore: change motd for 2.1 (closes #237) 2023-02-07 10:46:47 -04:00
sammyette cdd07a4981
fix(commands/doc): run stat in pcall 2023-02-05 13:02:50 -04:00
sammyette 2f6ab5fd92
feat: add sink for commanders to write output/read input (#232)
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
2023-01-20 19:07:42 -04:00
sammyette 088e326bd1
fix(commands/doc): properly block out index doc 2023-01-20 18:43:46 -04:00
sammyette 6530d48b00
docs: document types properly (#227) 2023-01-18 06:39:26 -04:00
sammyette d99e056a76
feat: add function to get current runner name 2023-01-17 22:04:54 -04:00
sammyette a6bcfdfca9
feat(commands/doc): return 1 exit code when doc not found 2023-01-07 14:02:21 -04:00
sammyette 4e023703b6
feat(commands/doc): use local docs directory if hilbish branch is found 2023-01-07 14:01:57 -04:00
sammyette 354f257c03
feat(commands/doc): make it easier to get interface docs 2023-01-07 13:54:08 -04:00
sammyette 887260cd8a
fix: print error on event error and dont release hook (closes #226) 2023-01-07 07:39:36 -04:00
sammyette c2db9e65fa
fix(commands/cd): set oldpwd when cd-ing with no args (fixes #225) 2022-12-28 19:18:04 -04:00
sammyette 1a2d29aee7
fix: list subdocs for hilbish module 2022-12-20 01:42:58 -04:00
sammyette b46bd0059e
fix: fixes for doc command
- get docs properly for hilbish module and its interfaces
- deal with negative numbers causing yaml metadata parsing to fail
- change from index to _index to match hugo
2022-12-20 01:38:19 -04:00
sammyette e5eefb1d2d
refactor!: rework docs and doc command (#218)
changes the actual file format of docs to markup since that's basically what we have been
using in the first place.

the docgen command has been modified to write markdown headings with the function name and
yaml metadata for easy consumption by hugo for the website.

all other docs have been moved to markdown as well this is the main reason this is a "breaking" change
users will have to reinstall hilbish (task uninstall and task install) to remove the old plaintext docs
2022-12-15 00:00:54 -04:00
sammyette 0a49e1a4ef
feat: print command errors via hook
this allows users to remove the handlers and print
a custom message to their liking
2022-12-13 12:57:27 -04:00
TorchedSammy 26ff6c9a46
fix(nature/completions): get command name properly for custom completions 2022-12-05 23:15:35 -04:00
sammy 0d32a10ca3
feat: add builtins clear, exec and cat (#208)
* feat: add clear and exec command

* docs: add builtins to changelog

* feat: add cat command
2022-10-14 19:15:40 -04:00
TorchedSammy 068a5b5149
feat(bait): add error hook and hooks function (closes #205)
an `error` hook is now thrown when an event in lua
throws an error (errors from go side should not happen)
it includes the event name, handler, and error message

a hooks function has also been added. it returns a table
of handlers for a specific event.
2022-10-11 17:41:13 -04:00
TorchedSammy 7db2a2c826
fix: check if there is cmd input before attempting to add to history (closes #206) 2022-10-10 18:11:09 -04:00
TorchedSammy 7108523a4c
fix: remove logging of autostart modules 2022-09-17 14:08:15 -04:00
TorchedSammy ee34ccdbc3
fix: check if key in _G is string before trying to getenv 2022-09-17 10:48:34 -04:00
TorchedSammy 959030f70d
refactor: automatically load all nature commands 2022-09-02 23:01:39 -04:00
TorchedSammy 2e192be2e1
refactor: setup autocd opt in a better way
with the previous commit allowing users to override
hilbish.runner.sh and it being ran by hilbish, the
code for the autocd opt can just override that
function and do the autocd functionality instead
of reimplementing a hybrid runner.

this means that if any other custom runner wants
autocd functionality they can have it with the sh runner
2022-08-30 23:08:22 -04:00
TorchedSammy 20870b9004
fix: only print motd when interactive 2022-08-17 18:05:20 -04:00
TorchedSammy 09a8b41063
chore!: remove guide command (closes #188) 2022-07-13 16:04:57 -04:00
sammy 349380ae6b
feat: lua backed history (#187)
* 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
2022-07-13 16:02:09 -04:00
TorchedSammy 6eea5bce47
feat: add motd (closes #185) 2022-07-09 17:54:21 -04:00
TorchedSammy a106f4aea0
refactor!: move hilbish.greeting to an opt (closes #184) 2022-07-09 17:15:13 -04:00
TorchedSammy 362bb14d7e
feat: auto start lua modules (closes #167) 2022-06-20 17:07:15 -04:00
sammyette 226605a996
feat: allow runners to specify if they want more input (#162)
* 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
2022-06-02 22:33:30 -04:00
sammyette 3990d370fa
feat: extend hilbish.runner interface to allow multiple runners (#159) 2022-05-28 19:06:18 -04:00
TorchedSammy 61271dc70c
fix: load bg command on init 2022-05-24 19:26:35 -04:00
sammyette 8697344f98
feat: implement job foregrounding/backgrounding (#155) 2022-05-24 19:15:02 -04:00
sammyette d2f16dfbbf
feat: job enhancements (#153)
* 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
2022-05-21 20:53:36 -04:00
TorchedSammy cb88db8cfc
feat: add hilbish.vim interface (closes #114) 2022-05-13 20:52:48 -04:00
TorchedSammy 15035c02cb
fix(doc): check if modmt exists before trying to get module prop docs 2022-05-08 16:02:24 -04:00
Renzix dd678a4a75
fix: Not loading nature module on some systems (#150) 2022-05-08 16:01:06 -04:00
TorchedSammy c890b86e08
feat: add hilbish.opts and autocd opt
this adds `hilbish.opts`, a table to set
simple options akin to shopt or setopt on
other shells. this commit specifically also
includes the autocd opt, which functions the
way you expect it to

to set opts, simply do `hilbish.opts.name = val`,
where `name` is the opt you want to set and `val`
being the opt setting.

ie: `hilbish.opts.autocd = true` to turn on autocd
2022-04-30 21:22:37 -04:00
TorchedSammy a8406657f9
fix: remove nature hook handles
since it was only for command exec errors,
and theyre handled runner side now, we dont
have to handle it via hooks anymore
2022-04-30 21:05:21 -04:00
TorchedSammy 0642ddda36
fix: push home dir to recent dirs with correct function 2022-04-30 20:28:47 -04:00
TorchedSammy 3bad452f95
fix: load completions by default 2022-04-24 09:00:06 -04:00
TorchedSammy 2790982ad1
fix: no command completions if query/line is an alias
basically, i have a `c` alias which is `git commit`,
this would resolve to `git commit` literally to try
and complete `commit`, which wouldnt match.
this fixes that, and instead itll suggest commands
that start with `c`. if there is a space after and
completion is requested, itll use the alias properly
2022-04-24 00:06:19 -04:00
TorchedSammy 4a4c4d8c74
refactor: rewrite completion handler in lua 2022-04-23 23:59:03 -04:00
TorchedSammy 9e596dc271
refactor: (re)organize and change prelude path and structure
prelude is no longer. it is now nature.
organized the single file prelude into multiple
source files and renamed it to nature. this is coming
after thought that it can turn into a general hilbish
lua core, with user facing modules as well.

this introduces the `nature.dirs` module, to interact
and get recently changed to directories and last/old
cwd.
2022-04-23 00:03:50 -04:00