chore: merge from master
|
@ -1,10 +1,8 @@
|
||||||
name: Build website
|
name: Build website
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
- push
|
||||||
branches:
|
- pull_request
|
||||||
- master
|
|
||||||
- docs-refactor
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
|
@ -21,11 +19,29 @@ jobs:
|
||||||
hugo-version: 'latest'
|
hugo-version: 'latest'
|
||||||
extended: true
|
extended: true
|
||||||
|
|
||||||
|
- name: Set branch name
|
||||||
|
id: branch
|
||||||
|
run: echo "::set-output name=BRANCH_NAME::${GITHUB_REF##*/}"
|
||||||
|
|
||||||
|
- name: Fix base URL
|
||||||
|
if: steps.branch.outputs.BRANCH_NAME != 'master' && github.repository_owner == 'Rosettea'
|
||||||
|
run: sed -i "s%baseURL = 'https://rosettea.github.io/Hilbish/'%baseURL = 'https://rosettea.github.io/Hilbish/versions/${{ steps.branch.outputs.BRANCH_NAME }}'%" website/config.toml
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: 'cd website && hugo --minify'
|
run: 'cd website && hugo --minify'
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
|
if: steps.branch.outputs.BRANCH_NAME == 'master' && github.repository_owner == 'Rosettea'
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
publish_dir: ./website/public
|
publish_dir: ./website/public
|
||||||
|
keep_files: true
|
||||||
|
- name: Deploy
|
||||||
|
if: steps.branch.outputs.BRANCH_NAME != 'master' && github.repository_owner == 'Rosettea'
|
||||||
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
publish_dir: ./website/public
|
||||||
|
destination_dir: versions/${{ steps.branch.outputs.BRANCH_NAME }}
|
||||||
|
keep_files: true
|
||||||
|
|
22
CHANGELOG.md
|
@ -1,5 +1,27 @@
|
||||||
# 🎀 Changelog
|
# 🎀 Changelog
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
### Added
|
||||||
|
- Made a few additions to the sink type:
|
||||||
|
- `read()` method for retrieving input (so now the `in` sink of commanders is useful)
|
||||||
|
- `flush()` and `autoFlush()` related to flushing outputs
|
||||||
|
- `pipe` property to check if a sink with input is a pipe (like stdin)
|
||||||
|
- Add fuzzy search to history search (enable via `hilbish.opts.fuzzy = true`)
|
||||||
|
- Show indexes on cdr list
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Replaced `sed` in-place editing with `grep` and `mv` for compatibility with BSD utils
|
||||||
|
|
||||||
|
## [2.1.2] - 2022-04-10
|
||||||
|
### Removed
|
||||||
|
- Bad april fools code ;(
|
||||||
|
|
||||||
|
## [2.1.1] - 2022-04-01
|
||||||
|
### Added
|
||||||
|
- Validation checks for command input
|
||||||
|
- Improved runtime performance
|
||||||
|
- Validate Lua code
|
||||||
|
|
||||||
## [2.1.0] - 2022-02-10
|
## [2.1.0] - 2022-02-10
|
||||||
### Added
|
### Added
|
||||||
- Documented custom userdata types (Job and Timer Objects)
|
- Documented custom userdata types (Job and Timer Objects)
|
||||||
|
|
44
README.md
|
@ -1,45 +1,35 @@
|
||||||
<div align="center">
|
<img src="./assets/hilbish-logo-and-text.png" width=512><br>
|
||||||
<img src="./assets/hilbish-flower.png" width=128><br>
|
<blockquote>
|
||||||
<img src="./assets/hilbish-text.png" width=256><br>
|
🌓 The Moon-powered shell! A comfy and extensible shell for Lua fans! 🌺 ✨
|
||||||
<blockquote>
|
</blockquote>
|
||||||
🌺 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">
|
|
||||||
<img alt="GitHub commits since latest release (by date)" src="https://img.shields.io/github/commits-since/Rosettea/Hilbish/latest?style=flat-square">
|
|
||||||
<img alt="GitHub contributors" src="https://img.shields.io/github/contributors/Rosettea/Hilbish?style=flat-square"><br>
|
|
||||||
<a href="https://github.com/Rosettea/Hilbish/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22"><img src="https://img.shields.io/github/issues/Hilbis/Hilbish/help%20wanted?style=flat-square&color=green" alt="help wanted"></a>
|
|
||||||
<a href="https://github.com/Rosettea/Hilbish/blob/master/LICENSE"><img alt="GitHub license" src="https://img.shields.io/github/license/Rosettea/Hilbish?style=flat-square"></a>
|
|
||||||
<a href="https://discord.gg/3PDdcQz"><img alt="Discord" src="https://img.shields.io/discord/732357621503229962?color=blue&style=flat-square"></a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
Hilbish is a extensible shell (framework). It was made to be very customizable
|
<img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/Rosettea/Hilbish?style=flat-square"><img alt="GitHub commits since latest release (by date)" src="https://img.shields.io/github/commits-since/Rosettea/Hilbish/latest?style=flat-square"><img alt="GitHub contributors" src="https://img.shields.io/github/contributors/Rosettea/Hilbish?style=flat-square"><br>
|
||||||
via the Lua programming language. It aims to be easy to use for the casual
|
<a href="https://github.com/Rosettea/Hilbish/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22"><img src="https://img.shields.io/github/issues/Hilbis/Hilbish/help%20wanted?style=flat-square&color=green" alt="help wanted"></a>
|
||||||
people but powerful for those who want to tinker more with their shell,
|
<a href="https://github.com/Rosettea/Hilbish/blob/master/LICENSE"><img alt="GitHub license" src="https://img.shields.io/github/license/Rosettea/Hilbish?style=flat-square"></a>
|
||||||
the thing used to interface with most of the system.
|
<a href="https://discord.gg/3PDdcQz"><img alt="Discord" src="https://img.shields.io/discord/732357621503229962?color=blue&style=flat-square"></a>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
Hilbish is an extensible shell designed to be highly customizable.
|
||||||
|
It is configured in Lua and provides a good range of features.
|
||||||
|
It aims to be easy to use for anyone but powerful enough for
|
||||||
|
those who need it.
|
||||||
|
|
||||||
The motivation for choosing Lua was that its simpler and better to use
|
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,
|
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
|
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!
|
and aims to be infinitely configurable. If something isn't, open an issue!
|
||||||
|
|
||||||
# Table of Contents
|
|
||||||
- [Screenshots](#Screenshots)
|
|
||||||
- [Getting Hilbish](#Getting-Hilbish)
|
|
||||||
- [Contributing](#Contributing)
|
|
||||||
|
|
||||||
# Screenshots
|
# Screenshots
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<img src="gallery/terminal.png"><br><br>
|
<img src="gallery/tab.png">
|
||||||
<img src="gallery/tab.png"><br><br>
|
|
||||||
<img src="gallery/pillprompt.png">
|
<img src="gallery/pillprompt.png">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
# Getting Hilbish
|
# Getting Hilbish
|
||||||
**NOTE:** Hilbish is not guaranteed to work properly on Windows, starting
|
**NOTE:** Hilbish is not guaranteed to work properly on Windows, starting
|
||||||
from the 2.0 version. It will still be able to compile, but functionality
|
from the 2.0 version. It will still be able to compile, but functionality
|
||||||
may be lacking.
|
may be lacking. If you want to contribute to make the situation better,
|
||||||
|
comment on the Windows discussion.
|
||||||
|
|
||||||
You can check the [install page](https://rosettea.github.io/Hilbish/install/)
|
You can check the [install page](https://rosettea.github.io/Hilbish/install/)
|
||||||
on the website for distributed binaries from GitHub or other package repositories.
|
on the website for distributed binaries from GitHub or other package repositories.
|
||||||
|
|
|
@ -34,4 +34,4 @@ tasks:
|
||||||
- rm -vrf
|
- rm -vrf
|
||||||
"{{.DESTDIR}}{{.BINDIR}}/hilbish"
|
"{{.DESTDIR}}{{.BINDIR}}/hilbish"
|
||||||
"{{.DESTDIR}}{{.LIBDIR}}"
|
"{{.DESTDIR}}{{.LIBDIR}}"
|
||||||
- sed -i '/hilbish/d' /etc/shells
|
- grep -v 'hilbish' /etc/shells > /tmp/shells.hilbish_uninstall && mv /tmp/shells.hilbish_uninstall /etc/shells
|
||||||
|
|
8
api.go
|
@ -639,6 +639,14 @@ func hlhinter(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||||
// reality could set the input of the prompt to *display* anything. The
|
// reality could set the input of the prompt to *display* anything. The
|
||||||
// callback is passed the current line and is expected to return a line that
|
// callback is passed the current line and is expected to return a line that
|
||||||
// will be used as the input display.
|
// will be used as the input display.
|
||||||
|
// Note that to set a highlighter, one has to override this function.
|
||||||
|
// Example:
|
||||||
|
// ```
|
||||||
|
// function hilbish.highlighter(line)
|
||||||
|
// return line:gsub('"%w+"', function(c) return lunacolors.green(c) end)
|
||||||
|
// end
|
||||||
|
// ```
|
||||||
|
// This code will highlight all double quoted strings in green.
|
||||||
// --- @param line string
|
// --- @param line string
|
||||||
func hlhighlighter(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
func hlhighlighter(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||||
return c.Next(), nil
|
return c.Next(), nil
|
||||||
|
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 18 KiB |
|
@ -49,6 +49,14 @@ Line highlighter handler. This is mainly for syntax highlighting, but in
|
||||||
reality could set the input of the prompt to *display* anything. The
|
reality could set the input of the prompt to *display* anything. The
|
||||||
callback is passed the current line and is expected to return a line that
|
callback is passed the current line and is expected to return a line that
|
||||||
will be used as the input display.
|
will be used as the input display.
|
||||||
|
Note that to set a highlighter, one has to override this function.
|
||||||
|
Example:
|
||||||
|
```
|
||||||
|
function hilbish.highlighter(line)
|
||||||
|
return line:gsub('"%w+"', function(c) return lunacolors.green(c) end)
|
||||||
|
end
|
||||||
|
```
|
||||||
|
This code will highlight all double quoted strings in green.
|
||||||
|
|
||||||
### hinter(line, pos)
|
### hinter(line, pos)
|
||||||
The command line hint handler. It gets called on every key insert to
|
The command line hint handler. It gets called on every key insert to
|
||||||
|
@ -109,6 +117,16 @@ A sink is a structure that has input and/or output to/from
|
||||||
a desination.
|
a desination.
|
||||||
|
|
||||||
### Methods
|
### Methods
|
||||||
|
#### autoFlush(auto)
|
||||||
|
Sets/toggles the option of automatically flushing output.
|
||||||
|
A call with no argument will toggle the value.
|
||||||
|
|
||||||
|
#### flush()
|
||||||
|
Flush writes all buffered input to the sink.
|
||||||
|
|
||||||
|
#### read() -> string
|
||||||
|
Reads input from the sink.
|
||||||
|
|
||||||
#### write(str)
|
#### write(str)
|
||||||
Writes data to a sink.
|
Writes data to a sink.
|
||||||
|
|
||||||
|
|
|
@ -79,6 +79,14 @@ function hilbish.goro(fn) end
|
||||||
--- reality could set the input of the prompt to *display* anything. The
|
--- reality could set the input of the prompt to *display* anything. The
|
||||||
--- callback is passed the current line and is expected to return a line that
|
--- callback is passed the current line and is expected to return a line that
|
||||||
--- will be used as the input display.
|
--- will be used as the input display.
|
||||||
|
--- Note that to set a highlighter, one has to override this function.
|
||||||
|
--- Example:
|
||||||
|
--- ```
|
||||||
|
--- function hilbish.highlighter(line)
|
||||||
|
--- return line:gsub('"%w+"', function(c) return lunacolors.green(c) end)
|
||||||
|
--- end
|
||||||
|
--- ```
|
||||||
|
--- This code will highlight all double quoted strings in green.
|
||||||
--- @param line string
|
--- @param line string
|
||||||
function hilbish.highlighter(line) end
|
function hilbish.highlighter(line) end
|
||||||
|
|
||||||
|
@ -180,6 +188,18 @@ function hilbish.jobs:foreground() end
|
||||||
--- @param cmd string
|
--- @param cmd string
|
||||||
function hilbish.runner.lua(cmd) end
|
function hilbish.runner.lua(cmd) end
|
||||||
|
|
||||||
|
--- Sets/toggles the option of automatically flushing output.
|
||||||
|
--- A call with no argument will toggle the value.
|
||||||
|
--- @param auto boolean|nil
|
||||||
|
function hilbish:autoFlush(auto) end
|
||||||
|
|
||||||
|
--- Flush writes all buffered input to the sink.
|
||||||
|
function hilbish:flush() end
|
||||||
|
|
||||||
|
--- Reads input from the sink.
|
||||||
|
--- @returns string
|
||||||
|
function hilbish:read() end
|
||||||
|
|
||||||
--- Writes data to a sink.
|
--- Writes data to a sink.
|
||||||
function hilbish:write(str) end
|
function hilbish:write(str) end
|
||||||
|
|
||||||
|
|
1
go.mod
|
@ -8,6 +8,7 @@ require (
|
||||||
github.com/chuckpreslar/emission v0.0.0-20170206194824-a7ddd980baf9
|
github.com/chuckpreslar/emission v0.0.0-20170206194824-a7ddd980baf9
|
||||||
github.com/maxlandon/readline v0.1.0-beta.0.20211027085530-2b76cabb8036
|
github.com/maxlandon/readline v0.1.0-beta.0.20211027085530-2b76cabb8036
|
||||||
github.com/pborman/getopt v1.1.0
|
github.com/pborman/getopt v1.1.0
|
||||||
|
github.com/sahilm/fuzzy v0.1.0
|
||||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a
|
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a
|
||||||
golang.org/x/term v0.0.0-20220411215600-e5f449aeb171
|
golang.org/x/term v0.0.0-20220411215600-e5f449aeb171
|
||||||
mvdan.cc/sh/v3 v3.5.1
|
mvdan.cc/sh/v3 v3.5.1
|
||||||
|
|
2
go.sum
|
@ -49,6 +49,8 @@ github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJ
|
||||||
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||||
github.com/rogpeppe/go-internal v1.8.1-0.20210923151022-86f73c517451 h1:d1PiN4RxzIFXCJTvRkvSkKqwtRAl5ZV4lATKtQI0B7I=
|
github.com/rogpeppe/go-internal v1.8.1-0.20210923151022-86f73c517451 h1:d1PiN4RxzIFXCJTvRkvSkKqwtRAl5ZV4lATKtQI0B7I=
|
||||||
github.com/rogpeppe/go-internal v1.8.1-0.20210923151022-86f73c517451/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o=
|
github.com/rogpeppe/go-internal v1.8.1-0.20210923151022-86f73c517451/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o=
|
||||||
|
github.com/sahilm/fuzzy v0.1.0 h1:FzWGaw2Opqyu+794ZQ9SYifWv2EIXpwP4q8dY1kDAwI=
|
||||||
|
github.com/sahilm/fuzzy v0.1.0/go.mod h1:VFvziUEIMCrT6A6tw2RFIXPXXmzXbOsSHF0DOI8ZK9Y=
|
||||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
|
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
|
||||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 h1:w8s32wxx3sY+OjLlv9qltkLU5yvJzxjjgiHWLjdIcw4=
|
golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 h1:w8s32wxx3sY+OjLlv9qltkLU5yvJzxjjgiHWLjdIcw4=
|
||||||
|
|
2
lua.go
|
@ -68,7 +68,7 @@ func luaInit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add more paths that Lua can require from
|
// Add more paths that Lua can require from
|
||||||
err := util.DoString(l, "package.path = package.path .. " + requirePaths)
|
_, err := util.DoString(l, "package.path = package.path .. " + requirePaths)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintln(os.Stderr, "Could not add Hilbish require paths! Libraries will be missing. This shouldn't happen.")
|
fmt.Fprintln(os.Stderr, "Could not add Hilbish require paths! Libraries will be missing. This shouldn't happen.")
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ commander.register('bg', function(_, sinks)
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
local err = job.background()
|
local err = job:background()
|
||||||
if err then
|
if err then
|
||||||
sinks.out:writeln('bg: ' .. err)
|
sinks.out:writeln('bg: ' .. err)
|
||||||
return 2
|
return 2
|
||||||
|
|
|
@ -10,7 +10,7 @@ cdr: change directory to one which has been recently visied
|
||||||
|
|
||||||
usage: cdr <index>
|
usage: cdr <index>
|
||||||
|
|
||||||
to get a list of recent directories, use {green}{underline}cdr list{reset}]])
|
to get a list of recent directories, use {green}cdr list{reset}]])
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -20,7 +20,10 @@ to get a list of recent directories, use {green}{underline}cdr list{reset}]])
|
||||||
sinks.out:writeln 'No directories have been visited.'
|
sinks.out:writeln 'No directories have been visited.'
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
sinks.out:writeln(table.concat(recentDirs, '\n'))
|
for idx, d in ipairs(dirs.recentDirs) do
|
||||||
|
if d:find(hilbish.home, 1, true) then d = fs.join('~', d:sub(hilbish.home:len() + 1)) end
|
||||||
|
sinks.out:writeln(lunacolors.format(string.format('{cyan}%d{reset} %s', idx, d)))
|
||||||
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ commander.register('fg', function(_, sinks)
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
local err = job.foreground() -- waits for job; blocks
|
local err = job:foreground() -- waits for job; blocks
|
||||||
if err then
|
if err then
|
||||||
sinks.out:writeln('fg: ' .. err)
|
sinks.out:writeln('fg: ' .. err)
|
||||||
return 2
|
return 2
|
||||||
|
|
|
@ -16,7 +16,7 @@ setmetatable(hilbish.opts, {
|
||||||
|
|
||||||
local function setupOpt(name, default)
|
local function setupOpt(name, default)
|
||||||
opts[name] = default
|
opts[name] = default
|
||||||
require('nature.opts.' .. name)
|
pcall(require, 'nature.opts.' .. name)
|
||||||
end
|
end
|
||||||
|
|
||||||
local defaultOpts = {
|
local defaultOpts = {
|
||||||
|
@ -25,7 +25,8 @@ local defaultOpts = {
|
||||||
greeting = string.format([[Welcome to {magenta}Hilbish{reset}, {cyan}%s{reset}.
|
greeting = string.format([[Welcome to {magenta}Hilbish{reset}, {cyan}%s{reset}.
|
||||||
The nice lil shell for {blue}Lua{reset} fanatics!
|
The nice lil shell for {blue}Lua{reset} fanatics!
|
||||||
]], hilbish.user),
|
]], hilbish.user),
|
||||||
motd = true
|
motd = true,
|
||||||
|
fuzzy = false
|
||||||
}
|
}
|
||||||
|
|
||||||
for optsName, default in pairs(defaultOpts) do
|
for optsName, default in pairs(defaultOpts) do
|
||||||
|
|
|
@ -71,10 +71,9 @@ func (g *CompletionGroup) init(rl *Instance) {
|
||||||
// The rx parameter is passed, as the shell already checked that the search pattern is valid.
|
// The rx parameter is passed, as the shell already checked that the search pattern is valid.
|
||||||
func (g *CompletionGroup) updateTabFind(rl *Instance) {
|
func (g *CompletionGroup) updateTabFind(rl *Instance) {
|
||||||
|
|
||||||
suggs := make([]string, 0)
|
suggs := rl.Searcher(rl.search, g.Suggestions)
|
||||||
|
|
||||||
// We perform filter right here, so we create a new completion group, and populate it with our results.
|
// We perform filter right here, so we create a new completion group, and populate it with our results.
|
||||||
for i := range g.Suggestions {
|
/*for i := range g.Suggestions {
|
||||||
if rl.regexSearch == nil { continue }
|
if rl.regexSearch == nil { continue }
|
||||||
if rl.regexSearch.MatchString(g.Suggestions[i]) {
|
if rl.regexSearch.MatchString(g.Suggestions[i]) {
|
||||||
suggs = append(suggs, g.Suggestions[i])
|
suggs = append(suggs, g.Suggestions[i])
|
||||||
|
@ -82,7 +81,7 @@ func (g *CompletionGroup) updateTabFind(rl *Instance) {
|
||||||
// this is a list so lets also check the descriptions
|
// this is a list so lets also check the descriptions
|
||||||
suggs = append(suggs, g.Suggestions[i])
|
suggs = append(suggs, g.Suggestions[i])
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
// We overwrite the group's items, (will be refreshed as soon as something is typed in the search)
|
// We overwrite the group's items, (will be refreshed as soon as something is typed in the search)
|
||||||
g.Suggestions = suggs
|
g.Suggestions = suggs
|
||||||
|
|
|
@ -112,8 +112,10 @@ type Instance struct {
|
||||||
modeAutoFind bool // for when invoked via ^R or ^F outside of [tab]
|
modeAutoFind bool // for when invoked via ^R or ^F outside of [tab]
|
||||||
searchMode FindMode // Used for varying hints, and underlying functions called
|
searchMode FindMode // Used for varying hints, and underlying functions called
|
||||||
regexSearch *regexp.Regexp // Holds the current search regex match
|
regexSearch *regexp.Regexp // Holds the current search regex match
|
||||||
|
search string
|
||||||
mainHist bool // Which history stdin do we want
|
mainHist bool // Which history stdin do we want
|
||||||
histInfo []rune // We store a piece of hist info, for dual history sources
|
histInfo []rune // We store a piece of hist info, for dual history sources
|
||||||
|
Searcher func(string, []string) []string
|
||||||
|
|
||||||
//
|
//
|
||||||
// History -----------------------------------------------------------------------------------
|
// History -----------------------------------------------------------------------------------
|
||||||
|
@ -229,6 +231,25 @@ func NewInstance() *Instance {
|
||||||
rl.HintFormatting = "\x1b[2m"
|
rl.HintFormatting = "\x1b[2m"
|
||||||
rl.evtKeyPress = make(map[string]func(string, []rune, int) *EventReturn)
|
rl.evtKeyPress = make(map[string]func(string, []rune, int) *EventReturn)
|
||||||
rl.TempDirectory = os.TempDir()
|
rl.TempDirectory = os.TempDir()
|
||||||
|
rl.Searcher = func(needle string, haystack []string) []string {
|
||||||
|
suggs := make([]string, 0)
|
||||||
|
|
||||||
|
var err error
|
||||||
|
rl.regexSearch, err = regexp.Compile("(?i)" + string(rl.tfLine))
|
||||||
|
if err != nil {
|
||||||
|
rl.RefreshPromptLog(err.Error())
|
||||||
|
rl.infoText = []rune(Red("Failed to match search regexp"))
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, hay := range haystack {
|
||||||
|
if rl.regexSearch == nil { continue }
|
||||||
|
if rl.regexSearch.MatchString(hay) {
|
||||||
|
suggs = append(suggs, hay)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return suggs
|
||||||
|
}
|
||||||
|
|
||||||
// Registers
|
// Registers
|
||||||
rl.initRegisters()
|
rl.initRegisters()
|
||||||
|
|
|
@ -94,7 +94,7 @@ func (rl *Instance) getTabSearchCompletion() {
|
||||||
rl.getCurrentGroup()
|
rl.getCurrentGroup()
|
||||||
|
|
||||||
// Set the info for this completion mode
|
// Set the info for this completion mode
|
||||||
rl.infoText = append([]rune("Completion search: "), rl.tfLine...)
|
rl.infoText = append([]rune("Completion search: " + UNDERLINE + BOLD), rl.tfLine...)
|
||||||
|
|
||||||
for _, g := range rl.tcGroups {
|
for _, g := range rl.tcGroups {
|
||||||
g.updateTabFind(rl)
|
g.updateTabFind(rl)
|
||||||
|
@ -102,7 +102,7 @@ func (rl *Instance) getTabSearchCompletion() {
|
||||||
|
|
||||||
// If total number of matches is zero, we directly change the info, and return
|
// If total number of matches is zero, we directly change the info, and return
|
||||||
if comps, _, _ := rl.getCompletionCount(); comps == 0 {
|
if comps, _, _ := rl.getCompletionCount(); comps == 0 {
|
||||||
rl.infoText = append(rl.infoText, []rune(DIM+RED+" ! no matches (Ctrl-G/Esc to cancel)"+RESET)...)
|
rl.infoText = append(rl.infoText, []rune(RESET+DIM+RED+" ! no matches (Ctrl-G/Esc to cancel)"+RESET)...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
package readline
|
package readline
|
||||||
|
|
||||||
import (
|
|
||||||
"regexp"
|
|
||||||
)
|
|
||||||
|
|
||||||
// FindMode defines how the autocomplete suggestions display
|
// FindMode defines how the autocomplete suggestions display
|
||||||
type FindMode int
|
type FindMode int
|
||||||
|
|
||||||
|
@ -30,12 +26,7 @@ func (rl *Instance) updateTabFind(r []rune) {
|
||||||
rl.tfLine = append(rl.tfLine, r...)
|
rl.tfLine = append(rl.tfLine, r...)
|
||||||
|
|
||||||
// The search regex is common to all search modes
|
// The search regex is common to all search modes
|
||||||
var err error
|
rl.search = string(rl.tfLine)
|
||||||
rl.regexSearch, err = regexp.Compile("(?i)" + string(rl.tfLine))
|
|
||||||
if err != nil {
|
|
||||||
rl.RefreshPromptLog(err.Error())
|
|
||||||
rl.infoText = []rune(Red("Failed to match search regexp"))
|
|
||||||
}
|
|
||||||
|
|
||||||
// We update and print
|
// We update and print
|
||||||
rl.clearHelpers()
|
rl.clearHelpers()
|
||||||
|
|
|
@ -14,6 +14,7 @@ var (
|
||||||
// effects
|
// effects
|
||||||
BOLD = "\033[1m"
|
BOLD = "\033[1m"
|
||||||
DIM = "\033[2m"
|
DIM = "\033[2m"
|
||||||
|
UNDERLINE = "\033[4m"
|
||||||
RESET = "\033[0m"
|
RESET = "\033[0m"
|
||||||
// colors
|
// colors
|
||||||
RED = "\033[31m"
|
RED = "\033[31m"
|
||||||
|
|
21
rl.go
|
@ -7,8 +7,9 @@ import (
|
||||||
|
|
||||||
"hilbish/util"
|
"hilbish/util"
|
||||||
|
|
||||||
"github.com/maxlandon/readline"
|
|
||||||
rt "github.com/arnodel/golua/runtime"
|
rt "github.com/arnodel/golua/runtime"
|
||||||
|
"github.com/maxlandon/readline"
|
||||||
|
"github.com/sahilm/fuzzy"
|
||||||
)
|
)
|
||||||
|
|
||||||
type lineReader struct {
|
type lineReader struct {
|
||||||
|
@ -24,6 +25,24 @@ func newLineReader(prompt string, noHist bool) *lineReader {
|
||||||
rl: rl,
|
rl: rl,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
regexSearcher := rl.Searcher
|
||||||
|
rl.Searcher = func(needle string, haystack []string) []string {
|
||||||
|
fz, _ := util.DoString(l, "return hilbish.opts.fuzzy")
|
||||||
|
fuzz, ok := fz.TryBool()
|
||||||
|
if !fuzz || !ok {
|
||||||
|
return regexSearcher(needle, haystack)
|
||||||
|
}
|
||||||
|
|
||||||
|
matches := fuzzy.Find(needle, haystack)
|
||||||
|
suggs := make([]string, 0)
|
||||||
|
|
||||||
|
for _, match := range matches {
|
||||||
|
suggs = append(suggs, match.Str)
|
||||||
|
}
|
||||||
|
|
||||||
|
return suggs
|
||||||
|
}
|
||||||
|
|
||||||
// we don't mind hilbish.read rl instances having completion,
|
// we don't mind hilbish.read rl instances having completion,
|
||||||
// but it cant have shared history
|
// but it cant have shared history
|
||||||
if !noHist {
|
if !noHist {
|
||||||
|
|
106
sink.go
|
@ -1,8 +1,10 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bufio"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"os"
|
||||||
|
|
||||||
"hilbish/util"
|
"hilbish/util"
|
||||||
|
|
||||||
|
@ -15,9 +17,11 @@ var sinkMetaKey = rt.StringValue("hshsink")
|
||||||
// A sink is a structure that has input and/or output to/from
|
// A sink is a structure that has input and/or output to/from
|
||||||
// a desination.
|
// a desination.
|
||||||
type sink struct{
|
type sink struct{
|
||||||
writer io.Writer
|
writer *bufio.Writer
|
||||||
reader io.Reader
|
reader *bufio.Reader
|
||||||
|
file *os.File
|
||||||
ud *rt.UserData
|
ud *rt.UserData
|
||||||
|
autoFlush bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func setupSinkType(rtm *rt.Runtime) {
|
func setupSinkType(rtm *rt.Runtime) {
|
||||||
|
@ -25,15 +29,35 @@ func setupSinkType(rtm *rt.Runtime) {
|
||||||
|
|
||||||
sinkMethods := rt.NewTable()
|
sinkMethods := rt.NewTable()
|
||||||
sinkFuncs := map[string]util.LuaExport{
|
sinkFuncs := map[string]util.LuaExport{
|
||||||
|
"flush": {luaSinkFlush, 1, false},
|
||||||
|
"read": {luaSinkRead, 1, false},
|
||||||
|
"autoFlush": {luaSinkAutoFlush, 2, false},
|
||||||
"write": {luaSinkWrite, 2, false},
|
"write": {luaSinkWrite, 2, false},
|
||||||
"writeln": {luaSinkWriteln, 2, false},
|
"writeln": {luaSinkWriteln, 2, false},
|
||||||
}
|
}
|
||||||
util.SetExports(l, sinkMethods, sinkFuncs)
|
util.SetExports(l, sinkMethods, sinkFuncs)
|
||||||
|
|
||||||
sinkIndex := func(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
sinkIndex := func(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||||
|
s, _ := sinkArg(c, 0)
|
||||||
|
|
||||||
arg := c.Arg(1)
|
arg := c.Arg(1)
|
||||||
val := sinkMethods.Get(arg)
|
val := sinkMethods.Get(arg)
|
||||||
|
|
||||||
|
if val != rt.NilValue {
|
||||||
|
return c.PushingNext1(t.Runtime, val), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
keyStr, _ := arg.TryString()
|
||||||
|
|
||||||
|
switch keyStr {
|
||||||
|
case "pipe":
|
||||||
|
val = rt.BoolValue(false)
|
||||||
|
if s.file != nil {
|
||||||
|
fileInfo, _ := s.file.Stat();
|
||||||
|
val = rt.BoolValue(fileInfo.Mode() & os.ModeCharDevice == 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return c.PushingNext1(t.Runtime, val), nil
|
return c.PushingNext1(t.Runtime, val), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,6 +65,25 @@ func setupSinkType(rtm *rt.Runtime) {
|
||||||
l.SetRegistry(sinkMetaKey, rt.TableValue(sinkMeta))
|
l.SetRegistry(sinkMetaKey, rt.TableValue(sinkMeta))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// #member
|
||||||
|
// read() -> string
|
||||||
|
// --- @returns string
|
||||||
|
// Reads input from the sink.
|
||||||
|
func luaSinkRead(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||||
|
if err := c.Check1Arg(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
s, err := sinkArg(c, 0)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
str, _ := s.reader.ReadString('\n')
|
||||||
|
|
||||||
|
return c.PushingNext1(t.Runtime, rt.StringValue(str)), nil
|
||||||
|
}
|
||||||
|
|
||||||
// #member
|
// #member
|
||||||
// write(str)
|
// write(str)
|
||||||
// Writes data to a sink.
|
// Writes data to a sink.
|
||||||
|
@ -59,6 +102,9 @@ func luaSinkWrite(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
s.writer.Write([]byte(data))
|
s.writer.Write([]byte(data))
|
||||||
|
if s.autoFlush {
|
||||||
|
s.writer.Flush()
|
||||||
|
}
|
||||||
|
|
||||||
return c.Next(), nil
|
return c.Next(), nil
|
||||||
}
|
}
|
||||||
|
@ -81,22 +127,74 @@ func luaSinkWriteln(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
s.writer.Write([]byte(data + "\n"))
|
s.writer.Write([]byte(data + "\n"))
|
||||||
|
if s.autoFlush {
|
||||||
|
s.writer.Flush()
|
||||||
|
}
|
||||||
|
|
||||||
|
return c.Next(), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// #member
|
||||||
|
// flush()
|
||||||
|
// Flush writes all buffered input to the sink.
|
||||||
|
func luaSinkFlush(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||||
|
if err := c.Check1Arg(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
s, err := sinkArg(c, 0)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
s.writer.Flush()
|
||||||
|
|
||||||
|
return c.Next(), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// #member
|
||||||
|
// autoFlush(auto)
|
||||||
|
// Sets/toggles the option of automatically flushing output.
|
||||||
|
// A call with no argument will toggle the value.
|
||||||
|
// --- @param auto boolean|nil
|
||||||
|
func luaSinkAutoFlush(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
||||||
|
s, err := sinkArg(c, 0)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
v := c.Arg(1)
|
||||||
|
if v.Type() != rt.BoolType && v.Type() != rt.NilType {
|
||||||
|
return nil, fmt.Errorf("#1 must be a boolean")
|
||||||
|
}
|
||||||
|
|
||||||
|
value := !s.autoFlush
|
||||||
|
if v.Type() == rt.BoolType {
|
||||||
|
value = v.AsBool()
|
||||||
|
}
|
||||||
|
|
||||||
|
s.autoFlush = value
|
||||||
|
|
||||||
return c.Next(), nil
|
return c.Next(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func newSinkInput(r io.Reader) *sink {
|
func newSinkInput(r io.Reader) *sink {
|
||||||
s := &sink{
|
s := &sink{
|
||||||
reader: r,
|
reader: bufio.NewReader(r),
|
||||||
}
|
}
|
||||||
s.ud = sinkUserData(s)
|
s.ud = sinkUserData(s)
|
||||||
|
|
||||||
|
if f, ok := r.(*os.File); ok {
|
||||||
|
s.file = f
|
||||||
|
}
|
||||||
|
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
func newSinkOutput(w io.Writer) *sink {
|
func newSinkOutput(w io.Writer) *sink {
|
||||||
s := &sink{
|
s := &sink{
|
||||||
writer: w,
|
writer: bufio.NewWriter(w),
|
||||||
|
autoFlush: true,
|
||||||
}
|
}
|
||||||
s.ud = sinkUserData(s)
|
s.ud = sinkUserData(s)
|
||||||
|
|
||||||
|
|
|
@ -26,13 +26,14 @@ func SetFieldProtected(module, realModule *rt.Table, field string, value rt.Valu
|
||||||
}
|
}
|
||||||
|
|
||||||
// DoString runs the code string in the Lua runtime.
|
// DoString runs the code string in the Lua runtime.
|
||||||
func DoString(rtm *rt.Runtime, code string) error {
|
func DoString(rtm *rt.Runtime, code string) (rt.Value, error) {
|
||||||
chunk, err := rtm.CompileAndLoadLuaChunk("<string>", []byte(code), rt.TableValue(rtm.GlobalEnv()))
|
chunk, err := rtm.CompileAndLoadLuaChunk("<string>", []byte(code), rt.TableValue(rtm.GlobalEnv()))
|
||||||
|
var ret rt.Value
|
||||||
if chunk != nil {
|
if chunk != nil {
|
||||||
_, err = rt.Call1(rtm.MainThread(), rt.FunctionValue(chunk))
|
ret, err = rt.Call1(rtm.MainThread(), rt.FunctionValue(chunk))
|
||||||
}
|
}
|
||||||
|
|
||||||
return err
|
return ret, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// DoFile runs the contents of the file in the Lua runtime.
|
// DoFile runs the contents of the file in the Lua runtime.
|
||||||
|
|
5
vars.go
|
@ -11,8 +11,9 @@ var (
|
||||||
|
|
||||||
// Version info
|
// Version info
|
||||||
var (
|
var (
|
||||||
ver = "v2.1.0"
|
ver = "v2.2.0"
|
||||||
releaseName = "Pansy"
|
releaseName = "Poppy"
|
||||||
|
|
||||||
gitCommit string
|
gitCommit string
|
||||||
gitBranch string
|
gitBranch string
|
||||||
)
|
)
|
||||||
|
|
|
@ -8,11 +8,11 @@ description: 'Something Unique. Hilbish is the new interactive shell for Lua fan
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<h1 class="fw-light">Something Unique.</h1>
|
<h1 class="fw-light">Something Unique.</h1>
|
||||||
<p>
|
<p>
|
||||||
<strong>Hilbish</strong> is the new interactive shell for Lua fans.<br>
|
<strong>🌺 Hilbish</strong> is the new Moon-powered interactive shell for Lua fans!<br>
|
||||||
Extensible, scriptable, configurable: All in Lua.
|
Extensible, scriptable, configurable: All in Lua. ✨
|
||||||
</p>
|
</p>
|
||||||
<a href="install" class="btn btn-primary">Install</a>
|
<a href="install" class="btn btn-primary">Install</a>
|
||||||
<a href="https://github.com/Rosettea/Hilbish" class="btn btn-secondary" target="_blank">Github</a>
|
<a href="https://github.com/Rosettea/Hilbish" class="btn btn-secondary" target="_blank">GitHub</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
@ -108,14 +108,28 @@ description: 'Something Unique. Hilbish is the new interactive shell for Lua fan
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
|
<h1 class="fw-light">Screenshots</h1>
|
||||||
|
<div class="row row-cols-1 row-cols-md-2 g-4">
|
||||||
|
<div class="col">
|
||||||
|
<img src="/Hilbish/pillprompt.png">
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<img src="/Hilbish/default.png">
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<img src="/Hilbish/tab.png">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br>
|
||||||
|
|
||||||
<h1 class="fw-light">Why not just Lua?</h1>
|
<h1 class="fw-light">Why not just Lua?</h1>
|
||||||
<p>
|
<p>
|
||||||
Hilbish is your interactive shell as well as a just a Lua interpreter
|
Hilbish is your interactive shell as well as a just a Lua interpreter
|
||||||
and enhanced REPL.<br>
|
and enhanced REPL.<br>
|
||||||
</p>
|
</p>
|
||||||
<ul class="list-group" style="max-width: 64em;">
|
<ul class="list-group">
|
||||||
<li class="list-group-item"><i class="fa-solid fa-battery-full"></i> Batteries included Lua runtime that's also your user shell!</li>
|
<li class="list-group-item"><i class="fa-solid fa-battery-full"></i> Batteries included Lua runtime that's also your user shell!</li>
|
||||||
<li class="list-group-item"><i class="fa-solid fa-network-wired"></i> Hilbish is easily cross platform. It has OS agnostic interfaces for easy cross platform Lua code.</li>
|
<li class="list-group-item"><i class="fa-solid fa-network-wired"></i> Provides cross-platform and OS agnostic APIs to ensure your Lua code works everywhere Hilbish does, as expected.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
@ -123,11 +137,10 @@ description: 'Something Unique. Hilbish is the new interactive shell for Lua fan
|
||||||
<h1 class="fw-light">Try It Today!</h1>
|
<h1 class="fw-light">Try It Today!</h1>
|
||||||
<p>
|
<p>
|
||||||
Hilbish is known to run on the 3 major platforms (Windows, MacOS, Linux)
|
Hilbish is known to run on the 3 major platforms (Windows, MacOS, Linux)
|
||||||
but likely builds on other Unixes!
|
but likely builds on other Unixes! Windows doesn't work as well as it should,
|
||||||
<br>
|
so if you're a Windows user,
|
||||||
Windows doesn't work as well as it should, so if you're a Windows user,
|
|
||||||
<a href="https://github.com/Rosettea/Hilbish/discussions/165">say something</a>!
|
<a href="https://github.com/Rosettea/Hilbish/discussions/165">say something</a>!
|
||||||
<ul class="list-group" style="max-width: 64em;">
|
<ul class="list-group">
|
||||||
<li class="list-group-item"><i class="fa-solid fa-cloud-arrow-down"></i> <a href="/Hilbish/install" style="text-decoration: none;"><strong>Download</strong></a> the binary</li>
|
<li class="list-group-item"><i class="fa-solid fa-cloud-arrow-down"></i> <a href="/Hilbish/install" style="text-decoration: none;"><strong>Download</strong></a> the binary</li>
|
||||||
<li class="list-group-item"><i class="fa-solid fa-screwdriver-wrench"></i> <a href="https://github.com/Rosettea/Hilbish#manual-build" style="text-decoration: none;"><strong>Build</strong></a> from source</li>
|
<li class="list-group-item"><i class="fa-solid fa-screwdriver-wrench"></i> <a href="https://github.com/Rosettea/Hilbish#manual-build" style="text-decoration: none;"><strong>Build</strong></a> from source</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -0,0 +1,66 @@
|
||||||
|
---
|
||||||
|
title: "Improving Hilbish's Branding"
|
||||||
|
date: 2023-04-13T22:15:31-04:00
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
|
||||||
|
Happy birthday Hilbish! As of last month, Hilbish is now 2 years old.
|
||||||
|
Unfortunately I missed the official date, but I will still make a more
|
||||||
|
focused post on the date (19st).
|
||||||
|
|
||||||
|
I decided to fix up this website and Hilbish's logo, so that can
|
||||||
|
be thought of as something for the 2 years milestone?
|
||||||
|
|
||||||
|
# Logo
|
||||||
|
Hilbish's old logo was.. not that good. It definitely functioned
|
||||||
|
as a logo, but the yellow part of it looked ugly (sorry old logo).
|
||||||
|
|
||||||
|
<img src="https://safe.kashima.moe/4c6e9q484pcy.png" width=256>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
You would have definitely seen the new logo, since it is currently
|
||||||
|
in use on the navigation bar and footer. Here it is in a bigger view:
|
||||||
|
|
||||||
|
<img src="https://safe.kashima.moe/oy72vpev2yi4.png" width=256>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
# Website
|
||||||
|
Ever since this website was first made, from the release of v2.0, it has
|
||||||
|
been doing it's job of being a website good enough, but there were a few issues.
|
||||||
|
|
||||||
|
# Padding
|
||||||
|
Padding is very important! The edges of your screen need space to do nothing,
|
||||||
|
after all. On mobile or screens small enough, there would not be enough space
|
||||||
|
for the auto margin to fill, and since there was no padding besides that,
|
||||||
|
it means things would look a bit cramped. This was simple to fix.
|
||||||
|
|
||||||
|
Here it is before:
|
||||||
|
![Before](https://safe.kashima.moe/nupzzalt2oa4.png)
|
||||||
|
|
||||||
|
and after:
|
||||||
|
![After](https://safe.kashima.moe/r0ox4nazfi0q.png)
|
||||||
|
|
||||||
|
# Docs Navigation
|
||||||
|
On the docs page, the pages are on the left on desktop. Since
|
||||||
|
phones are too small to have this content on the side, it stays at the top.
|
||||||
|
This is a bit counter intuitive since it brings in extra scrolling
|
||||||
|
when navigating to every page for docs and just doesn't look that good.
|
||||||
|
|
||||||
|
A few months ago I made it collapse with the site wide navigation, but it
|
||||||
|
was not hidden by default. So a few improvements were made:
|
||||||
|
- Make the doc navigation hidden by default on mobile, just like site wide navigation
|
||||||
|
- Make doc navigation have the same look as site wide navigation
|
||||||
|
|
||||||
|
Here's a before:
|
||||||
|
![](https://safe.kashima.moe/krn0a6qwegdj.png)
|
||||||
|
|
||||||
|
and after:
|
||||||
|
![](https://safe.kashima.moe/sk11ighz47yb.png)
|
||||||
|
|
||||||
|
Looks a lot better now.
|
||||||
|
|
||||||
|
# Other Changes
|
||||||
|
If you haven't noticed, I have made other changes to the website.
|
||||||
|
This includes:
|
||||||
|
- Borders! Something this simple makes the website look a lot better, especially on mobile.
|
||||||
|
- More padding and margin everywhere. Home, doc pages, blog post listing.
|
|
@ -0,0 +1,38 @@
|
||||||
|
---
|
||||||
|
title: "v2.1.1 Release"
|
||||||
|
date: 2023-04-01T18:15:42-04:00
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
|
||||||
|
> The release with full changelogs and prebuilt binaries can be
|
||||||
|
seen at the [v2.1.1](https://github.com/Rosettea/Hilbish/releases/tag/v2.1.1)
|
||||||
|
tag.
|
||||||
|
|
||||||
|
Welcome to a fresh new release of Hilbish! Some people (or none) may be awaiting
|
||||||
|
the long coming v2.2 release with lots of features, but I *needed* to push
|
||||||
|
out this little bug fix (wink) release.
|
||||||
|
|
||||||
|
# Bug Fixes
|
||||||
|
## Validation checks for command input
|
||||||
|
When running this version, you may have noticed an odd message that sometimes
|
||||||
|
comes up when running commands. This is from the new TMOLI42SH
|
||||||
|
(The Meaning of Life is 42 String Hash) input validation scheme.
|
||||||
|
|
||||||
|
## Improved runtime code
|
||||||
|
Commands now have a chance of taking exactly 2-3s ~~more~~ less time of running due to
|
||||||
|
improvements in the code for shell runners!!!!!
|
||||||
|
|
||||||
|
## Validate lua code
|
||||||
|
Hilbish already threw an error when Lua code was not valid in syntax, but there was the
|
||||||
|
need for an extra validation scheme (called OpTTCLC - Opinion based Turing Test to Check Lua Code)
|
||||||
|
which results in less time wasted running invalid and TERRIBLE Lua code.
|
||||||
|
|
||||||
|
# Features
|
||||||
|
There is only 1 new feature in this glorious release.
|
||||||
|
|
||||||
|
## Fix your mistakes for the future
|
||||||
|
If you run a command that does not exist, Hilbish will say goodbye.
|
||||||
|
|
||||||
|
# Closing
|
||||||
|
Hope you enjoy this new release! It took a lot of effort to create this new version
|
||||||
|
while I was busy doing completely nothing. :)))
|
|
@ -0,0 +1,15 @@
|
||||||
|
---
|
||||||
|
title: "v2.1.2 Release"
|
||||||
|
date: 2023-04-10T12:27:41-04:00
|
||||||
|
draft: false
|
||||||
|
---
|
||||||
|
|
||||||
|
> The release with full changelogs and prebuilt binaries can be
|
||||||
|
seen at the [v2.1.2](https://github.com/Rosettea/Hilbish/releases/tag/v2.1.2)
|
||||||
|
tag.
|
||||||
|
|
||||||
|
This release reverts the April Fool's code additions in v2.1.1. It is
|
||||||
|
functionally equal to v2.1.0. Nice!
|
||||||
|
|
||||||
|
A real release will come possibly in a few days or next week, so stay tuned for
|
||||||
|
the good and feature-filled release of v2.2!
|
|
@ -5,7 +5,7 @@ weight: -40
|
||||||
menu: docs
|
menu: docs
|
||||||
---
|
---
|
||||||
|
|
||||||
Hilbish has a wide range of features to enhance the user's experience and
|
Hilbish has a wide range of features to enhance the user's experience
|
||||||
is always adding new ones. If there is something missing here or something
|
new ones are always being added. If there is something missing here or
|
||||||
you would like to see, please [start a discussion](https://github.com/Rosettea/Hilbish/discussions)
|
something you would like to see, please [start a discussion](https://github.com/Rosettea/Hilbish/discussions)
|
||||||
or comment on any existing ones which match your request.
|
or comment on any existing ones which match your request.
|
||||||
|
|
|
@ -15,3 +15,7 @@ In some cases, someone might want to switch to just shell script to avoid
|
||||||
it while interactive but still have a Lua config, or go full Lua to use
|
it while interactive but still have a Lua config, or go full Lua to use
|
||||||
Hilbish as a REPL. This also allows users to add alternative languages,
|
Hilbish as a REPL. This also allows users to add alternative languages,
|
||||||
instead of either like Fennel.
|
instead of either like Fennel.
|
||||||
|
|
||||||
|
Runner mode can also be used to handle specific kinds of input before
|
||||||
|
evaluating like normal, which is how [Link.hsh](https://github.com/TorchedSammy/Link.hsh)
|
||||||
|
handles links.
|
||||||
|
|
|
@ -15,9 +15,10 @@ To exit, you can either run the `exit` command or hit Ctrl+D.
|
||||||
There are a few ways to make Hilbish your default shell. A simple way is
|
There are a few ways to make Hilbish your default shell. A simple way is
|
||||||
to make it your user/login shell.
|
to make it your user/login shell.
|
||||||
|
|
||||||
{{< warning `It is not recommended to set Hilbish as your login shell. That is expected to be a
|
{{< warning `It is not recommended to set Hilbish as your login shell. That
|
||||||
POSIX compliant shell, which Hilbish is not. At most, there will just be a
|
is expected to be a POSIX compliant shell, which Hilbish is not. Though if
|
||||||
few variables missing in your environment` >}}
|
you still decide to do it, there will just be a few variables missing in
|
||||||
|
your environment` >}}
|
||||||
|
|
||||||
To do that, simply run `chsh -s /usr/bin/hilbish`.
|
To do that, simply run `chsh -s /usr/bin/hilbish`.
|
||||||
Some distros (namely Fedora) might have `lchsh` instead, which is used like `lchsh <user>`.
|
Some distros (namely Fedora) might have `lchsh` instead, which is used like `lchsh <user>`.
|
||||||
|
|
|
@ -15,7 +15,12 @@ have breaking changes.
|
||||||
For the latest **stable release**, check here: https://github.com/Rosettea/Hilbish/releases/latest
|
For the latest **stable release**, check here: https://github.com/Rosettea/Hilbish/releases/latest
|
||||||
For a **development build**: https://nightly.link/Rosettea/Hilbish/workflows/build/master
|
For a **development build**: https://nightly.link/Rosettea/Hilbish/workflows/build/master
|
||||||
|
|
||||||
|
## Compiling
|
||||||
|
To read the steps for compiling Hilbish, head over to the [GitHub repository.](https://github.com/Rosettea/Hilbish#build)
|
||||||
|
|
||||||
## Package Repositories
|
## Package Repositories
|
||||||
|
Methods of installing Hilbish for your Linux distro.
|
||||||
|
|
||||||
### Fedora (COPR)
|
### Fedora (COPR)
|
||||||
An official COPR is offered to install Hilbish easily on Fedora.
|
An official COPR is offered to install Hilbish easily on Fedora.
|
||||||
Enable the repo:
|
Enable the repo:
|
||||||
|
|
After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 99 KiB |
|
@ -1,8 +1,17 @@
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<div class="container py-3 row">
|
<style>
|
||||||
<div class="container" style="width: 240px;">
|
@media (min-width: 768px) {
|
||||||
<div class="p-3 col">
|
.sidenav {
|
||||||
<ul class="nav nav-pills mb-auto-collapse" id="navbarSupportedContent">
|
width: 240px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="row">
|
||||||
|
<nav class="navbar-expand-md bg-light sidenav border-end">
|
||||||
|
<div class="container">
|
||||||
|
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||||
|
<nav class="navbar navbar-expand-md bg-light sidenav col" style="margin-top: -20px;">
|
||||||
|
<ul class="navbar-nav me-auto mb-2 mb-lg-0 flex-column col mt-4">
|
||||||
{{ $currentPage := . }}
|
{{ $currentPage := . }}
|
||||||
{{ range .Site.Menus.docs.ByWeight.Reverse }}
|
{{ range .Site.Menus.docs.ByWeight.Reverse }}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
|
@ -23,9 +32,12 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-3 col">
|
</nav>
|
||||||
|
|
||||||
|
<container class="col mt-2" style="padding-left: 20px; padding-right: 20px;">
|
||||||
<div>
|
<div>
|
||||||
<h1>{{ .Title }}</h1>
|
<h1>{{ .Title }}</h1>
|
||||||
<p><em>
|
<p><em>
|
||||||
|
@ -47,7 +59,7 @@
|
||||||
Want to help improve this page? <a href="https://github.com/Rosettea/Hilbish/issues/new/choose">Create an issue.</a>
|
Want to help improve this page? <a href="https://github.com/Rosettea/Hilbish/issues/new/choose">Create an issue.</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</container>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<main>
|
<main class="mt-4 mb-4">
|
||||||
<div class="row row-cols-1 row-cols-md-1 g-4">
|
<div class="row row-cols-1 row-cols-md-1 g-4">
|
||||||
{{ range where .Site.RegularPages "Section" "in" "blog" }}
|
{{ range where .Site.RegularPages "Section" "in" "blog" }}
|
||||||
<div class="col d-flex justify-content-center">
|
<div class="col d-flex justify-content-center">
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
<main style="max-width: 80em; margin: auto;">
|
<div>
|
||||||
|
<main style="padding-left: 20px; padding-right: 20px; padding-top: 15px; max-width: 84em; margin: auto;">
|
||||||
{{.Content}}
|
{{.Content}}
|
||||||
</main>
|
</main>
|
||||||
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
|
@ -1,24 +1,11 @@
|
||||||
<footer class="footer mt-auto mt-auto py-3 bg-light row">
|
<footer class="footer mt-auto mt-auto py-3 bg-light row border-top">
|
||||||
<div class="col mb-3">
|
<div class="col mb-3">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col mb-3">
|
<div class="col mb-3">
|
||||||
<a href="/Hilbish" class="d-flex align-items-center mb-3 link-dark text-decoration-none">
|
<a href="/Hilbish" class="d-flex align-items-center mb-3 link-dark text-decoration-none">
|
||||||
<img src="/Hilbish/hilbish-flower.png" alt="" height="48" class="d-inline-block align-text-top">
|
<img src="/Hilbish/hilbish-logo-and-text.png" alt="" height="48" class="d-inline-block align-text-top" style="margin-left: -20px">
|
||||||
</a>
|
</a>
|
||||||
<p class="text-muted">
|
|
||||||
Rosettea © 2022
|
|
||||||
<br>
|
|
||||||
Made with <i class="fa-solid fa-heart" style="color: #f6345b;"></i>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col mb-3"></div>
|
|
||||||
<div class="col mb-3"></div>
|
|
||||||
<div class="col mb-3"></div>
|
|
||||||
|
|
||||||
<div class="col mb-3">
|
|
||||||
<h5>Hilbish</h5>
|
|
||||||
<ul class="nav flex-column">
|
<ul class="nav flex-column">
|
||||||
<li class="nav-item mb-2"><a href="/Hilbish" class="nav-link p-0 text-muted">Home</a></li>
|
<li class="nav-item mb-2"><a href="/Hilbish" class="nav-link p-0 text-muted">Home</a></li>
|
||||||
<li class="nav-item mb-2"><a href="/Hilbish/docs/faq" class="nav-link p-0 text-muted">FAQ</a></li>
|
<li class="nav-item mb-2"><a href="/Hilbish/docs/faq" class="nav-link p-0 text-muted">FAQ</a></li>
|
||||||
|
@ -29,4 +16,16 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col mb-3"></div>
|
<div class="col mb-3"></div>
|
||||||
|
|
||||||
|
<div class="col mb-3"></div>
|
||||||
|
<div class="col mb-3"></div>
|
||||||
|
<div class="col mb-3">
|
||||||
|
<p class="text-muted mt-4">
|
||||||
|
Rosettea © 2022-2023
|
||||||
|
<br>
|
||||||
|
Made with <i class="fa-solid fa-heart" style="color: #f6345b;"></i>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col mb-3"></div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
<header>
|
<header>
|
||||||
<nav class="navbar navbar-expand-md sticky-top bg-light">
|
<nav class="navbar navbar-expand-md sticky-top bg-light border-bottom">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<a class="navbar-brand" href="/Hilbish">
|
<a class="navbar-brand" href="/Hilbish">
|
||||||
<img src="/Hilbish/hilbish-flower.png" alt="" height="24" class="d-inline-block align-text-top">
|
<img src="/Hilbish/hilbish-logo-and-text.png" alt="" height="48">
|
||||||
Hilbish
|
|
||||||
</a>
|
</a>
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
|
|