Commit Graph

975 Commits (4eea793e69673aa8a7ffd981337e296f13e9ab8d)

Author SHA1 Message Date
TorchedSammy 3d525aa7da
fix: dont allow overrides on hilbish table 2022-04-21 20:39:38 -04:00
TorchedSammy 37e1b12b81
feat: add hilbish.completion.call to call a completer 2022-04-21 20:39:06 -04:00
TorchedSammy abfd4e5196
fix(util): SetField on a table with a metatable causing panic 2022-04-21 20:33:32 -04:00
TorchedSammy bd35e3b871
refactor: use foreach function to loop over lua tables 2022-04-21 14:01:59 -04:00
TorchedSammy 86aa40af64 docs: [ci] generate new docs 2022-04-21 16:19:31 +00:00
TorchedSammy a89d3e59d6
docs: fix typo in hilbish.inputMode doc (closes #147) 2022-04-21 12:19:11 -04:00
TorchedSammy 1458ecdcab
fix: file completions changes
changed the way file completions are handed
completely, which fixes #130 and makes the
full name appear in the completion menu instead
of it being cut off
2022-04-20 13:06:46 -04:00
ym555 6ccb9ebeff
fix(readline): take into account character width (#145)
first step towards unicode support yay
2022-04-20 08:18:34 -04:00
Will Eccles e34ab5314a
fix: make macOS config path match Linux (#143)
Also moves some variables around in vars_*.go to accommodate the fix.
2022-04-19 22:12:05 -04:00
TorchedSammy 0ae31123b9
fix: make expand home actually expand and not do the opposite 2022-04-19 22:05:48 -04:00
TorchedSammy 7a17d7931f
fix: use load from source in DoFile function instead of load chunk 2022-04-19 21:25:52 -04:00
TorchedSammy d4084a82ba
fix: expandHome function using hist dir instead of passed arg 2022-04-19 21:23:48 -04:00
TorchedSammy 9d69b63a0f
chore: update golua (closes #142) 2022-04-19 14:37:57 -04:00
TorchedSammy b83c09a2b3
fix(readline): check stdin error properly 2022-04-19 10:30:04 -04:00
TorchedSammy bee8d6e9e6
fix(readline): input going to next line if its longer than terminal width 2022-04-18 22:42:27 -04:00
TorchedSammy 48cb62282d
fix(readline): input getting cut off on enter 2022-04-18 22:36:54 -04:00
TorchedSammy 1e48a3e03d
fix(readline): home and end buttons not putting the cursor in the right place 2022-04-18 16:04:56 -04:00
TorchedSammy 4e8aa7ed1d
fix(readline): use invert for completion highlight instead of hardcoded colors 2022-04-17 23:39:53 -04:00
TorchedSammy 919a52a630
fix: handle syntax error in aliased command
if an alias is something which isn't valid syntax,
specifically if hilbish cant split up the input
properly to execute, it will report the error to
the user. the previous behaviour was a panic since
on error the args slice will be of length 0

this is basically an edge case and fixes a bug
which shouldnt happen normally
2022-04-17 22:58:29 -04:00
TorchedSammy b0c950a96a
fix: make sure user input is saved to history without alias expansion (4th same regression woo) 2022-04-17 22:57:31 -04:00
TorchedSammy c4438579f6
build: remove all from install target 2022-04-14 10:11:20 -04:00
buffet 59e81d3996
build: improve makefile 2022-04-14 10:05:35 -04:00
Renzix 7f161e6683
feat: added forward/backward word keybinds (#139)
Added emacsForwardWord and emacsBackwardWord which is used by M-f and
M-b directly. Also added M-d to ctrl delete and removed the bad old
funcion in favor of the fancy new one. Lastly I added alt delete which
deletes with emacsBackwardWord. Works identically to gnu readline

Co-authored-by: Renzix <DanielDeBruno@renzix.com>
2022-04-14 07:42:46 -04:00
TorchedSammy ded0be275f
chore: bump version to v2.0.0 2022-04-13 20:50:29 -04:00
TorchedSammy e3fdf84f5c
fix!: make path to script the 0th arg instead of 1st
makes more sense, brings some lua parity
this means that user passed args start from 1
instead of 2
2022-04-13 20:19:28 -04:00
TorchedSammy 194e4e01b7
fix: don't insert any unhandled control keys 2022-04-13 19:36:18 -04:00
TorchedSammy e5c9b85008
feat: add ctrl _ to undo 2022-04-13 16:58:36 -04:00
TorchedSammy e044aeb5ed docs: [ci] generate new docs 2022-04-13 14:14:06 +00:00
sammyette 0a2046e985
feat: add right prompt (#140)
* feat: add right prompt (closes #111)

* chore: add comment for set right prompt function

* fix: add 1 space at the end of right prompt to fix character cut off

* docs: update doc for prompt function
2022-04-13 10:13:46 -04:00
TorchedSammy 626b036b4b
fix!: add complete input to history, including continued input
this introduces a breaking change to runner functions.
they are now required to return 3 values, the first
being the user's input, and the 2 others that it was
before. the `hilbish.runner` functions respectively
have been updated, so if you just return from those
there will be no difference
2022-04-13 10:12:17 -04:00
sammyette ce625aca0c
feat: add ctrl delete to forward delete word (#138)
* feat: add ctrl delete to forward delete word (closes #124)

* fix: make delete word function accurately

* fix: make ctrl delete work on st
2022-04-12 23:08:44 -04:00
TorchedSammy 1715a1f626
feat: make ctrl d delete char below cursor if line isnt empty 2022-04-12 21:02:01 -04:00
TorchedSammy f002eca258
fix: dont prompt for continued input on incomplete input when not interactive (closes #137) 2022-04-12 19:43:12 -04:00
TorchedSammy 2814f44163
fix: typo in timer create function 2022-04-12 19:41:50 -04:00
TorchedSammy ea7517be05 docs: [ci] generate new docs 2022-04-12 23:37:39 +00:00
TorchedSammy 508fd5f8a2
docs: update docs for timer related functions 2022-04-12 19:37:15 -04:00
TorchedSammy c95ff42dee
feat: add timer pool and api (closes #135)
adds a map (but lets call it a pool) of all
running timers. this makes us able to keep
track of all running intervals and timeouts.
it also means hilbish can wait for them to
be done before exiting (it only waits when
non interactive).

this introduces the `hilbish.timers` interface,
documented by `doc timers`. the `hilbish.interval`
and `hilbish.timeout` functions return a timer
object now.
2022-04-12 19:31:48 -04:00
TorchedSammy c342f4f6f5
fix: handle when stdin is in nonblocking mode (closes #136) 2022-04-08 10:46:25 -04:00
TorchedSammy 393fe3962f
chore: update golua 2022-04-05 22:50:14 -04:00
TorchedSammy 8ae22127c0
fix: remove virt g handling at command exit 2022-04-05 07:41:11 -04:00
TorchedSammy 8f942f6f60 docs: [ci] generate new docs 2022-04-05 01:35:10 +00:00
TorchedSammy b712efd278
fix(docgen): make functions that take varargs have the signature 2022-04-04 21:34:46 -04:00
TorchedSammy ee4d97ff9a
fix: put input in history instead of resolved input ran by hilbish
ive fixed this like 3 times and regressed it
2022-04-04 21:21:46 -04:00
TorchedSammy 9ce861b080
refactor: set runner options in a better way and move out exec handler 2022-04-04 21:20:02 -04:00
TorchedSammy 69d38d7048 docs: [ci] generate new docs 2022-04-04 10:40:25 +00:00
sammyette 0fc5f457ad
refactor!: support lua 5.4 (#129)
major rewrite which changes the library hilbish uses for it's lua vm
this one implements lua 5.4, and since that's a major version bump,
it's a breaking change. introduced here also is a fix for `hilbish.login`
not being the right value

* refactor: start work on lua 5.4

lots of commented out code

ive found a go lua library which implements lua 5.4
and found an opportunity to start working on it.
this commit basically removes everything and just leaves
enough for the shell to be "usable" and able to start.
there are no builtins or libraries (besides the `hilbish` global)

* fix: call cont next in prompt function

this continues execution of lua, very obvious
fixes an issue with code stopping at the prompt function

* fix: handle errors in user config

* fix: handle panic in lua input if it is incorrect

* feat: implement bait

* refactor: use util funcs to run lua where possible

* refactor: move arg handle function to util

* feat: implement commander

* feat: implement fs

* feat: add hilbish module functions used by prelude

* chore: use custom fork of golua

* fix: make sure args to setenv are strings in prelude

* feat: implement completions

* chore: remove comment

* feat: implement terminal

* feat: implement hilbish.interval

* chore: update lunacolors

* chore: update golua

* feat: implement aliases

* feat: add input mode

* feat: implement runner mode

* style: use comma separated cases instead of fallthrough

* feat: implement syntax highlight and hints

* chore: add comments to document util functions

* chore: fix dofile comment doc

* refactor: make loader functions for go modules unexported

* feat: implement job management

* feat: add hilbish properties

* feat: implement all hilbish module functions

* feat: implement history interface

* feat: add completion interface

* feat: add module description docs

* feat: implement os interface

* refactor: use hlalias for add function in hilbish.alias interface

* feat: make it so hilbish.run can return command output

* fix: set hilbish.exitCode to last command exit code

* fix(ansikit): flush on io.write

* fix: deregister commander if return isnt number

* feat: run script when provided path

* fix: read file manually in DoFile to avoid shebang

* chore: add comment for reason of unreading byte

* fix: remove prelude error printing

* fix: add names at chunk load for context in errors

* fix: add newline at the beginning of file buffer when there is shebang

this makes the line count in error messages line up properly

* fix: remove extra newline after error
2022-04-04 06:40:02 -04:00
TorchedSammy 64bf7024d2
docs: fix hilbish typo 2022-04-03 21:43:13 -04:00
Renzix 0ebd8d9035
feat: added alt backspace keybinding (#132)
Co-authored-by: Renzix <DanielDeBruno@renzix.com>
2022-03-29 22:15:23 -04:00
Renzix 52caedc1f1
feat: delete key on st and fix: delete key crash on xterm (#131)
* fix: delete key on st

* fix: delete key crash on xterm

Co-authored-by: Renzix <DanielDeBruno@renzix.com>
2022-03-29 20:35:51 -04:00
TorchedSammy 34ae8ade7b
chore: tidy go modules 2022-03-29 15:28:39 -04:00