Commit Graph

137 Commits (bfc141f655bb03fc8f2736c299180314bdae9412)

Author SHA1 Message Date
TorchedSammy 5c6310b1ca
refactor: dont export functions and types 2021-12-06 17:21:31 -04:00
TorchedSammy eaaf17a792
fix: make table for `args` instead of using luar 2021-12-06 16:32:42 -04:00
TorchedSammy f60f61e616
style: remove new line 2021-12-06 16:26:51 -04:00
TorchedSammy 28fcdb3122
fix: take care of readline segfault, update deps 2021-12-06 16:24:25 -04:00
TorchedSammy 4e2e8ddf94
fix: revert "fix: resize if terminal has been resized during running command and fix readline segfault"
This reverts commit d270e8f66b.
causes breakage
2021-12-06 16:07:23 -04:00
TorchedSammy d270e8f66b
fix: resize if terminal has been resized during running command and fix readline segfault 2021-12-06 15:53:51 -04:00
TorchedSammy 6ac4aa50b3
fix: check if interactive when handling signals 2021-12-06 15:45:35 -04:00
TorchedSammy 2a71fb0075
fix!: change xdg config file to init.lua 2021-12-06 15:42:04 -04:00
TorchedSammy 2e21af4d6b
refactor: use curuser to get homedir everywhere 2021-12-01 18:31:04 -04:00
TorchedSammy effd028658
fix: substitution of home dir to ~ when names in path match it
fixes edge cases like `/mnt/home/user`
2021-12-01 18:30:03 -04:00
TorchedSammy ce0b2ab955
fix: dont print extra new line on ctrl+d in continue prompt 2021-11-28 10:44:02 -05:00
TorchedSammy af4c3885ae
feat: add signal hooks for sigint and sigwinch (#80) 2021-11-22 15:13:05 -05:00
TorchedSammy 123f8992b1
feat: add tab completion api
tab complete is better than it was before!
there is a new `complete` function which allows adding custom arguments
to complete specific functions.
hilbish will now also complete executables if it's the first input
argument (this also works with ./)
if no completion is added for a command, hilbish will just complete
files
2021-11-22 11:24:31 -05:00
TorchedSammy 77cc7fe24a
fix: only resize term if not running command 2021-11-22 10:41:27 -05:00
sammyette b008d48c60
fix: handle ctrl c properly when not interactive 2021-10-18 12:12:54 -04:00
sammyette 37610ad8b0
fix: remove extra newline on exit 2021-10-17 16:47:04 -04:00
sammyette 9eabe5323d
fix: throw command.exit with 0 code if input is nothing 2021-10-13 22:51:38 -04:00
sammyette 0977110e79
feat: add default history dir to xdg dir, or fallback to home 2021-10-13 10:42:35 -04:00
sammyette b387b18923
fix: properly default config dir to xdg dir 2021-10-13 10:41:55 -04:00
L3af 400dd2944d
feat: respect xdg directories (#71)
* feat: respect xdg directories

* fix: move xdg vars to table

Co-authored-by: L3af <ohhaon@icloud.com>
2021-10-07 20:58:07 -04:00
sammyette bc4e0f835f
fix: revert "fix: reuse sh runner"
This reverts commit 822b2876e9.
this broke a few things with the shell so probably shouldnt do this yet
2021-09-25 22:46:06 -04:00
sammyette c95b0b55be
fix: runtime errors on linux
this fixes out of bounds error since we tried to split the username
for '\' which is only valid on windows, so i added it for windows only
2021-09-25 21:39:06 -04:00
sammyette a3cc8160d3 fix: trim off hostname in %u verb for windows 2021-07-08 03:44:57 -07:00
sammyette 4caeb7ec91 feat: replace ~ in preloadPath and sampleConfPath with homedir 2021-07-08 03:44:11 -07:00
sammyette 822b2876e9
fix: reuse sh runner
this makes it so env variables persist, and some other stuff
builtin cd actually works now :]
2021-06-20 21:48:07 -04:00
sammyette 81f7b77b8b
docs: fix description of -l flag 2021-06-12 10:49:22 -04:00
sammyette e6c4c32bd7
feat: handle -h option 2021-06-12 10:48:57 -04:00
sammyette efc956a04c
fix: cleanup, store lua commands in map 2021-06-11 21:37:52 -04:00
sammyette 419e327d95
fix: prompt for new input on error with ContinuePrompt
basically, dont disregard the error we get and dont return previous
input. now we try to prompt for new input without running the
previous if the function got an error
2021-06-11 18:26:34 -04:00
sammyette 7a8df8b9f2
revert: fix: return previous input on continue input error
This reverts commit 5b03b3cef4.
we shouldn't return this just to fix the panic,
instead just handle the error
2021-06-11 18:25:24 -04:00
sammyette 5b03b3cef4
fix: return previous input on continue input error
this is basically 72973eade7
but it actually works and doesnt break everything
if an error occurred with the ContinuePrompt function (in this case,
the error is simply EOL/ctrl d) then return previous input alone
2021-06-11 18:08:31 -04:00
sammyette 646cb93dec
feat: support comptime sample conf declaration 2021-06-09 20:33:30 -04:00
sammyette 13dc0cd857
feat: support comptime config dir declaration 2021-06-09 20:30:53 -04:00
sammyette be5ebd6ada
feat: add back cancel input on ctrl c 2021-06-08 21:00:01 -04:00
sammyette 86dbb97cae
feat: define lua require paths in var
this makes it able to be changed compile time, which should help
in support for systems that dont follow fhs (damn nix)
and windows as well, but that'll be first class
2021-06-08 19:16:37 -04:00
sammyette 1623f0d85d
fix: dont go interactive if not terminal (closes #48) 2021-06-01 22:14:59 -04:00
sammyette e0851809ab
feat: make readline agnostic, add hilbiline to test 2021-05-17 19:03:56 -04:00
sammyette 1ff3ff854b
fix: add input to history before alias expansion
since im stupid, normal commands that are aliased add
the expanded version to the history, and not the alias itself.
lua alias was added since im dumb and did `input` instead of `cmdString`
so now, history is handled once, in main.go
2021-05-16 20:09:47 -04:00
sammyette ef1ced4a04
refactor: make `hilbish` an already required module and add run function
idk how to explain this man
in code `hilbish` is now a module, which can also be required like
others. but it is already a global export as the variable of the same
name.
also
2021-05-16 17:13:28 -04:00
sammyette e29ba6a0d5
feat!: move username and version access to hilbish table
instead of having ugly `_user` and `_ver` variables,
`hilbish.user` and `hilbish.version` is used
2021-05-16 15:53:21 -04:00
sammyette 83591f9bba
fix: tryrun input from -c only if its provided 2021-05-16 08:42:20 -04:00
sammy b86912be56
chore: change default version to be latest release 2021-05-15 23:13:15 -04:00
sammy 4ce223e2f4
fix: dont make continued input spaced out
basically, if i had something like
> here i want to \
complete
it would return "here i want to  complete"
so now it doesnt anymore, if you want the space, do it manually
2021-05-15 22:25:29 -04:00
sammy 2c2eb8d69a
chore: remove old commented code 2021-05-15 09:21:19 -04:00
sammy 83a44954cd
fix(revert): feat: write errors and panics to tmp log file
This reverts commit 1e1b9d07b0.
why did i even do this in the first place
2021-05-15 09:04:27 -04:00
sammy 1e1b9d07b0
feat: write errors and panics to tmp log file 2021-05-15 07:32:25 -04:00
sammy 69c0ccc807
fix: make `version` a var
so now, it can be changed in compile time
2021-05-13 21:02:56 -04:00
sammy bb7f9e45f0
chore: bump version 2021-05-12 06:42:43 -04:00
sammy f9c1eced68
chore: bump version 2021-05-11 19:39:51 -04:00
sammy fd478e883f
feat: args variable (resolves #49)
anytime hilbish is ran as shebang or given a script to run,
itll provide an `args` variable which will be the args a user
provides to the script.
it includes the execute path, as most argv's do
2021-05-11 19:37:00 -04:00