2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-07-01 08:42:04 +00:00

Compare commits

...

5 Commits

Author SHA1 Message Date
eb630b2de0
chore: change back release to moonflower 2025-06-16 17:16:45 -04:00
548de98551
chore: merge from 3.0 branch 2025-06-16 17:16:21 -04:00
0854b5a769
fix!: don't define hilbish.completion, without the s at the end
the interface is hilbish.completions (s at the end)
2025-04-23 19:36:50 -04:00
2ca99fe831
fix!: get/set env variables via env table (#294)
this removes the old "virtual global table" which allows
getting environment variables via just their names in lua.

this means:
an environment variable (like TERM) would need to be accessed
via the `env` table instead of just using TERM in lua.

`TERM` -> `env.TERM`
they can also be set via `env.VARIABLE = 'value'
2025-04-23 19:33:09 -04:00
8793a733a6
chore: change ver info to 3.0 2025-04-23 19:31:11 -04:00
4 changed files with 17 additions and 38 deletions

1
api.go
View File

@ -104,7 +104,6 @@ func hilbishLoad(rtm *rt.Runtime) (rt.Value, func()) {
// hilbish.completion table
hshcomp := completionLoader(rtm)
// TODO: REMOVE "completion" AND ONLY USE "completions" WITH AN S
mod.Set(rt.StringValue("completion"), rt.TableValue(hshcomp))
mod.Set(rt.StringValue("completions"), rt.TableValue(hshcomp))
// hilbish.runner table

10
nature/env.lua Normal file
View File

@ -0,0 +1,10 @@
env = {}
setmetatable(env, {
__index = function(_, k)
return os.getenv(k)
end,
__newindex = function(_, k, v)
os.setenv(k, tostring(v))
end
})

View File

@ -27,6 +27,7 @@ require 'nature.opts'
require 'nature.vim'
require 'nature.runner'
require 'nature.hummingbird'
require 'nature.env'
require 'nature.abbr'
require 'nature.editor'
@ -37,36 +38,6 @@ else
os.setenv('SHLVL', '0')
end
do
local virt_G = { }
setmetatable(_G, {
__index = function (_, key)
local got_virt = virt_G[key]
if got_virt ~= nil then
return got_virt
end
if type(key) == 'string' then
virt_G[key] = os.getenv(key)
end
return virt_G[key]
end,
__newindex = function (_, key, value)
if type(value) == 'string' then
os.setenv(key, value)
virt_G[key] = value
else
if type(virt_G[key]) == 'string' then
os.setenv(key, '')
end
virt_G[key] = value
end
end,
})
end
do
local startSearchPath = hilbish.userDir.data .. '/hilbish/start/?/init.lua;'
.. hilbish.userDir.data .. '/hilbish/start/?.lua'

13
vars.go
View File

@ -2,16 +2,16 @@ package main
// String vars that are free to be changed at compile time
var (
defaultHistDir = ""
defaultHistDir = ""
commonRequirePaths = "';./libs/?/init.lua;./?/init.lua;./?/?.lua'"
prompt string
prompt string
multilinePrompt = "> "
)
// Version info
var (
ver = "v2.4.0"
ver = "v3.0.0"
releaseName = "Moonflower"
gitCommit string
@ -20,10 +20,9 @@ var (
// Flags
var (
running bool // Is a command currently running
running bool // Is a command currently running
interactive bool
login bool // Are we the login shell?
noexecute bool // Should we run Lua or only report syntax errors
login bool // Are we the login shell?
noexecute bool // Should we run Lua or only report syntax errors
initialized bool
)