mirror of https://github.com/Hilbis/Hilbish
Compare commits
12 Commits
1e884e7c89
...
84dce8c537
Author | SHA1 | Date |
---|---|---|
sammyette | 84dce8c537 | |
TorchedSammy | 3345c51064 | |
TorchedSammy | a7e450904c | |
TorchedSammy | 23efc8e54d | |
TorchedSammy | 1d4c8a7645 | |
TorchedSammy | 7272e035d9 | |
TorchedSammy | 8a215ad742 | |
TorchedSammy | 6e69ee20f6 | |
TorchedSammy | bc15da2f1a | |
TorchedSammy | dd9e827735 | |
TorchedSammy | 3636efe7f8 | |
TorchedSammy | 053914ec45 |
|
@ -12,16 +12,14 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
goos: [linux, windows, darwin]
|
goos: [linux, windows, darwin]
|
||||||
goarch: ["386", amd64, arm64]
|
goarch: ["386", amd64, arm64]
|
||||||
exclude:
|
exclude:
|
||||||
- goarch: "386"
|
- goarch: "386"
|
||||||
goos: darwin
|
goos: darwin
|
||||||
- goarch: arm64
|
- goarch: arm64
|
||||||
goos: windows
|
goos: windows
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
|
|
12
CHANGELOG.md
12
CHANGELOG.md
|
@ -1,6 +1,6 @@
|
||||||
# 🎀 Changelog
|
# 🎀 Changelog
|
||||||
|
|
||||||
## [1.1.0] - 2021-03-17
|
## [1.1.0] - 2022-03-17
|
||||||
### Added
|
### Added
|
||||||
- `hilbish.vimAction` hook (`doc vimMode actions`)
|
- `hilbish.vimAction` hook (`doc vimMode actions`)
|
||||||
- `command.not-executable` hook (will replace `command.no-perm` in a future release)
|
- `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 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
|
- Fix prompt being set to the continue prompt even when exited
|
||||||
|
|
||||||
## [1.0.4] - 2021-03-12
|
## [1.0.4] - 2022-03-12
|
||||||
### Fixed
|
### Fixed
|
||||||
- Panic when history directory doesn't exist
|
- Panic when history directory doesn't exist
|
||||||
|
|
||||||
## [1.0.3] - 2021-03-12
|
## [1.0.3] - 2022-03-12
|
||||||
### Fixed
|
### Fixed
|
||||||
- Removed duplicate executable suggestions
|
- Removed duplicate executable suggestions
|
||||||
- User input is added to history now instead of what's ran by Hilbish
|
- User input is added to history now instead of what's ran by Hilbish
|
||||||
- Formatting issue with prompt on no input
|
- Formatting issue with prompt on no input
|
||||||
|
|
||||||
## [1.0.2] - 2021-03-06
|
## [1.0.2] - 2022-03-06
|
||||||
### Fixed
|
### Fixed
|
||||||
- Cases where Hilbish's history directory doesn't exist will no longer cause a panic
|
- 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
|
### Fixed
|
||||||
- Using `hilbish.appendPath` will no longer result in string spam (debugging thing left being)
|
- Using `hilbish.appendPath` will no longer result in string spam (debugging thing left being)
|
||||||
- Prompt gets set properly on startup
|
- Prompt gets set properly on startup
|
||||||
|
|
||||||
## [1.0.0] - 2021-03-06
|
## [1.0.0] - 2022-03-06
|
||||||
### Added
|
### Added
|
||||||
- MacOS is now officialy supported, default compile time vars have been added
|
- MacOS is now officialy supported, default compile time vars have been added
|
||||||
for it
|
for it
|
||||||
|
|
49
README.md
49
README.md
|
@ -2,7 +2,7 @@
|
||||||
<img src="./assets/hilbish-flower.png" width=128><br>
|
<img src="./assets/hilbish-flower.png" width=128><br>
|
||||||
<img src="./assets/hilbish-text.png" width=256><br>
|
<img src="./assets/hilbish-text.png" width=256><br>
|
||||||
<blockquote>
|
<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>
|
</blockquote>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/Rosettea/Hilbish?style=flat-square">
|
<img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/Rosettea/Hilbish?style=flat-square">
|
||||||
|
@ -14,12 +14,25 @@
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
Hilbish is a Unix-y shell which uses Lua for scripting. Things like the prompt,
|
Hilbish is a extensible shell (framework). It was made to be very customizable
|
||||||
general configuration and such are done with Lua.
|
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
|
The motivation for choosing Lua was that its simpler and better to use
|
||||||
platforms Hilbish can be compiled for. It can also act as a Lua REPL if you want
|
than old shell script. It's fine for basic interactive shell uses,
|
||||||
it to be.
|
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
|
# Screenshots
|
||||||
<div align="center">
|
<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
|
### Prerequisites
|
||||||
- [Go 1.17+](https://go.dev)
|
- [Go 1.17+](https://go.dev)
|
||||||
|
|
||||||
#### Build
|
### Build
|
||||||
First, clone Hilbish. The recursive is required, as some Lua libraries
|
First, clone Hilbish. The recursive is required, as some Lua libraries
|
||||||
are submodules.
|
are submodules.
|
||||||
```sh
|
```sh
|
||||||
|
@ -76,13 +89,27 @@ make build
|
||||||
|
|
||||||
After you did all that, run `sudo make install` to install Hilbish globally.
|
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
|
# Contributing
|
||||||
Any kind of contributions to Hilbish are welcome!
|
Any kind of contributions are welcome! Hilbish is very easy to contribute to.
|
||||||
Read [CONTRIBUTING.md](CONTRIBUTING.md) before getting started.
|
Read [CONTRIBUTING.md](CONTRIBUTING.md) as a guideline to doing so.
|
||||||
|
|
||||||
**Thanks to everyone below who's contributed!**
|
**Thanks to everyone below who's contributed!**
|
||||||
<a href="https://github.com/Hilbis/Hilbish/graphs/contributors">
|
<a href="https://github.com/Rosettea/Hilbish/graphs/contributors">
|
||||||
<img src="https://contrib.rocks/image?repo=Hilbis/Hilbish" />
|
<img src="https://contrib.rocks/image?repo=Rosettea/Hilbish" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
*Made with [contributors-img](https://contrib.rocks).*
|
*Made with [contributors-img](https://contrib.rocks).*
|
||||||
|
|
1
api.go
1
api.go
|
@ -483,6 +483,7 @@ func hlinputMode(L *lua.LState) int {
|
||||||
// Accepted values for mode are hybrid (the default), hybridRev (sh first then Lua),
|
// 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
|
// sh, and lua. It also accepts a function, to which if it is passed one
|
||||||
// will call it to execute user input instead.
|
// will call it to execute user input instead.
|
||||||
|
// --- @param mode string|function
|
||||||
func hlrunnerMode(L *lua.LState) int {
|
func hlrunnerMode(L *lua.LState) int {
|
||||||
mode := L.CheckAny(1)
|
mode := L.CheckAny(1)
|
||||||
switch mode.Type() {
|
switch mode.Type() {
|
||||||
|
|
|
@ -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.
|
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
|
The exit code has to be a number, it will be 0 otherwise and the error can be
|
||||||
`nil` to indicate no error.
|
`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
|
||||||
|
|
|
@ -74,7 +74,8 @@ function hilbish.run(cmd) end
|
||||||
--- Accepted values for mode are hybrid (the default), hybridRev (sh first then Lua),
|
--- 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
|
--- sh, and lua. It also accepts a function, to which if it is passed one
|
||||||
--- will call it to execute user input instead.
|
--- 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
|
--- Runs the `cb` function after `time` in milliseconds
|
||||||
--- @param cb function
|
--- @param cb function
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 99 KiB |
|
@ -78,3 +78,9 @@ func (h *fileHistory) Len() int {
|
||||||
func (h *fileHistory) Dump() interface{} {
|
func (h *fileHistory) Dump() interface{} {
|
||||||
return h.items
|
return h.items
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (h *fileHistory) clear() {
|
||||||
|
h.items = []string{}
|
||||||
|
h.f.Truncate(0)
|
||||||
|
h.f.Sync()
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue