Commit Graph

153 Commits (fb3cedb161f95ee1d4df5b847e5ea4e0910395e6)

Author SHA1 Message Date
TorchedSammy 3805f13369
feat: throw hilbish.exit hook (closes #99) 2022-03-06 10:23:32 -04:00
TorchedSammy f1dfd59c4c
fix: add back prompt global var
fixes an issue with multiline prompt overriding user's prompt
permanently
2022-03-05 15:46:38 -04:00
TorchedSammy 6b9bbb615d
fix: handle prompt properly and remove global 2022-03-04 21:54:47 -04:00
TorchedSammy 36cd4d4123
fix: custom handle ctrl c from readline 2022-02-28 18:32:57 -04:00
TorchedSammy d355d02b93
fix: only notify ctrl c signal on windows 2022-02-28 16:15:08 -04:00
TorchedSammy d9d2152e04
fix: add full command after complete prompt to history 2022-02-27 19:12:58 -04:00
TorchedSammy 0b5bbcc73c
refactor!: remove .hprofile.lua
same reason as not using ~/.hilbishrc.lua, and also
the fact that users can now just check if
`hilbish.login` is true in their config which is
more organized
2022-02-26 12:14:26 -04:00
TorchedSammy 2a0cd1464a
fix: dont copy default conf to user dir
doing this prevents problems in later releases with breaking
changes (though this shouldnt be the case anymore)
2022-02-23 22:20:11 -04:00
TorchedSammy f05ab921d7
refactor!: use better default paths
~/.hilbishrc.lua has been removed and will no longer be loaded.
instead, $XDG_CONFIG_HOME/hilbish/init.lua is to be used

the history path has been changed to a more suited one.
on linux, it is in $XDG_DATA_HOME/hilbish/.hilbish-history,
or otherwise ~/.local/share/hilbish/.hilbish-history
2022-02-23 22:19:54 -04:00
TorchedSammy cb3d0a2e8e
fix: use os agnostic function to get config dir 2022-02-23 22:01:35 -04:00
TorchedSammy 209abfac77
fix: change default hist path to use hist name instead of config name 2022-02-23 21:29:37 -04:00
TorchedSammy 8c802a6e6b
feat: dont put input in history if it starts with a space 2022-01-27 16:28:29 -04:00
TorchedSammy 9cf03e37c4
fix: change hooks from signals to signal
drop the s, dont remember when i added it
it makes more sense and its what the docs have anyway
2022-01-26 15:18:54 -04:00
TorchedSammy e0b84aaff7
feat: emit sigusr1 and 2 signal hooks 2022-01-26 15:18:09 -04:00
TorchedSammy bcc249a4bd
feat: add aliases interface (closes #87 and #86)
500th commit!
adds the `hilbish.aliases` interface
it allows you to add, delete and get all aliases

there was also a slight refactor with alias resolving in this commit,
there is a single resolve function instead of duplicate code.
with consideration this could be exported to lua side,
but i see no reason for it
2021-12-14 20:54:23 -04:00
TorchedSammy bcfbb20685
fix: dont export lua init 2021-12-08 23:31:48 -04:00
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