Compare commits

...

12 Commits

Author SHA1 Message Date
sammyette 84dce8c537
docs: change short description back to block quote 2022-03-22 22:04:33 -04:00
TorchedSammy 3345c51064
docs: add newline after short description 2022-03-22 22:01:22 -04:00
TorchedSammy a7e450904c
docs: add more info to readme 2022-03-22 21:59:34 -04:00
TorchedSammy 23efc8e54d
docs: update image for readme gallery 2022-03-22 21:19:36 -04:00
TorchedSammy 1d4c8a7645
feat: make history clear function work again 2022-03-22 19:01:29 -04:00
TorchedSammy 7272e035d9
ci: remove fetch-depth 0 setting for checkout 2022-03-22 18:41:26 -04:00
TorchedSammy 8a215ad742
docs: rename vimMode to vim-mode 2022-03-22 18:39:22 -04:00
TorchedSammy 6e69ee20f6
chore: merge 2022-03-22 18:38:26 -04:00
TorchedSammy bc15da2f1a
docs: add more docs for runner mode interface 2022-03-22 18:38:13 -04:00
TorchedSammy dd9e827735 docs: [ci] generate new docs 2022-03-22 22:33:52 +00:00
TorchedSammy 3636efe7f8
docs: add doc for mode param of runnerMode function 2022-03-22 18:33:11 -04:00
TorchedSammy 053914ec45
docs: fix dates for changelog versions 2022-03-22 17:19:23 -04:00
11 changed files with 63 additions and 23 deletions

View File

@ -12,16 +12,14 @@ jobs:
matrix:
goos: [linux, windows, darwin]
goarch: ["386", amd64, arm64]
exclude:
exclude:
- goarch: "386"
goos: darwin
goos: darwin
- goarch: arm64
goos: windows
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v2
with:

View File

@ -1,6 +1,6 @@
# 🎀 Changelog
## [1.1.0] - 2021-03-17
## [1.1.0] - 2022-03-17
### Added
- `hilbish.vimAction` hook (`doc vimMode actions`)
- `command.not-executable` hook (will replace `command.no-perm` in a future release)
@ -16,26 +16,26 @@
- Fix removal of dot in the beginning of folders/files that have them for file complete
- Fix prompt being set to the continue prompt even when exited
## [1.0.4] - 2021-03-12
## [1.0.4] - 2022-03-12
### Fixed
- Panic when history directory doesn't exist
## [1.0.3] - 2021-03-12
## [1.0.3] - 2022-03-12
### Fixed
- Removed duplicate executable suggestions
- User input is added to history now instead of what's ran by Hilbish
- Formatting issue with prompt on no input
## [1.0.2] - 2021-03-06
## [1.0.2] - 2022-03-06
### Fixed
- Cases where Hilbish's history directory doesn't exist will no longer cause a panic
## [1.0.1] - 2021-03-06
## [1.0.1] - 2022-03-06
### Fixed
- Using `hilbish.appendPath` will no longer result in string spam (debugging thing left being)
- Prompt gets set properly on startup
## [1.0.0] - 2021-03-06
## [1.0.0] - 2022-03-06
### Added
- MacOS is now officialy supported, default compile time vars have been added
for it

View File

@ -2,7 +2,7 @@
<img src="./assets/hilbish-flower.png" width=128><br>
<img src="./assets/hilbish-text.png" width=256><br>
<blockquote>
🌺 The flower shell. A comfy and nice little shell for Lua users and fans!
🌺 The flower shell. A comfy and nice little shell for Lua fans!
</blockquote>
<p align="center">
<img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/Rosettea/Hilbish?style=flat-square">
@ -14,12 +14,25 @@
</p>
</div>
Hilbish is a Unix-y shell which uses Lua for scripting. Things like the prompt,
general configuration and such are done with Lua.
Hilbish is a extensible shell (framework). It was made to be very customizable
via the Lua programming language. It aims to be easy to use for the casual
people but powerful for those who want to tinker more with their shell,
the thing used to interface with most of the system.
For interactive use, it uses a library to run sh which works on all
platforms Hilbish can be compiled for. It can also act as a Lua REPL if you want
it to be.
The motivation for choosing Lua was that its simpler and better to use
than old shell script. It's fine for basic interactive shell uses,
but that's the only place Hilbish has shell script; everything else is Lua
and aims to be infinitely configurable. If something isn't, open an issue!
# Table of Contents
- [Screenshots](#Screenshots)
- [Installation](#Installation)
- [Prebuilt Bins](#Prebuilt-binaries)
- [AUR](#AUR)
- [Nixpkgs](#Nixpkgs)
- [Manual Build](#Manual-Build)
- [Getting Started](#Getting-Started)
- [Contributing](#Contributing)
# Screenshots
<div align="center">
@ -54,7 +67,7 @@ If you're new to nix you should probably read up on how to do that [here](https:
### Prerequisites
- [Go 1.17+](https://go.dev)
#### Build
### Build
First, clone Hilbish. The recursive is required, as some Lua libraries
are submodules.
```sh
@ -76,13 +89,27 @@ make build
After you did all that, run `sudo make install` to install Hilbish globally.
# Getting Started
At startup, you should see a message which says to run a `guide` command.
This guide is a *very* simple and basic step through text of what Hilish is
and where to find documentation.
Documentation is primarily viewed via the in shell `doc` command.
Autogenerated function docs and general docs about other things are included
there, so be sure to read it.
Using Hilbish is the same as using any other Linux shell, with an addition
that you can also run Lua. Hilbish can also act as an enhanced Lua REPL
via `hilbish.runnerMode 'lua'`. To switch back to normal, use
`hilbish.runnerMode 'hybrid'`.
# Contributing
Any kind of contributions to Hilbish are welcome!
Read [CONTRIBUTING.md](CONTRIBUTING.md) before getting started.
Any kind of contributions are welcome! Hilbish is very easy to contribute to.
Read [CONTRIBUTING.md](CONTRIBUTING.md) as a guideline to doing so.
**Thanks to everyone below who's contributed!**
<a href="https://github.com/Hilbis/Hilbish/graphs/contributors">
<img src="https://contrib.rocks/image?repo=Hilbis/Hilbish" />
<a href="https://github.com/Rosettea/Hilbish/graphs/contributors">
<img src="https://contrib.rocks/image?repo=Rosettea/Hilbish" />
</a>
*Made with [contributors-img](https://contrib.rocks).*

1
api.go
View File

@ -483,6 +483,7 @@ func hlinputMode(L *lua.LState) int {
// Accepted values for mode are hybrid (the default), hybridRev (sh first then Lua),
// sh, and lua. It also accepts a function, to which if it is passed one
// will call it to execute user input instead.
// --- @param mode string|function
func hlrunnerMode(L *lua.LState) int {
mode := L.CheckAny(1)
switch mode.Type() {

View File

@ -31,3 +31,10 @@ and also provides the sh and Lua runner functions that Hilbish itself uses.
A runner function is expected to return 2 values: the exit code, and an error.
The exit code has to be a number, it will be 0 otherwise and the error can be
`nil` to indicate no error.
## Functions
These are the functions for the `hilbish.runner` interface
+ setMode(mode) > The same as `hilbish.runnerMode`
+ sh(input) -> code, err > Runs `input` in Hilbish's sh interpreter
+ lua(input) -> code, err > Evals `input` as Lua code

View File

@ -74,7 +74,8 @@ function hilbish.run(cmd) end
--- Accepted values for mode are hybrid (the default), hybridRev (sh first then Lua),
--- sh, and lua. It also accepts a function, to which if it is passed one
--- will call it to execute user input instead.
function hilbish.runnerMode() end
--- @param mode string|function
function hilbish.runnerMode(mode) end
--- Runs the `cb` function after `time` in milliseconds
--- @param cb function

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 99 KiB

View File

@ -78,3 +78,9 @@ func (h *fileHistory) Len() int {
func (h *fileHistory) Dump() interface{} {
return h.items
}
func (h *fileHistory) clear() {
h.items = []string{}
h.f.Truncate(0)
h.f.Sync()
}

2
rl.go
View File

@ -271,6 +271,6 @@ func (lr *lineReader) luaAllHistory(L *lua.LState) int {
}
func (lr *lineReader) luaClearHistory(l *lua.LState) int {
fileHist.clear()
return 0
}