2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-04-21 21:13:22 +00:00

Compare commits

...

8 Commits

Author SHA1 Message Date
10e5aceb0e
Merge a24bca32580f88bc63a1ff15dfacc86673f03a59 into 8731b1a7d12654b95795f7eeab7634bcfffd340f 2025-01-16 01:03:47 +01:00
8731b1a7d1
chore: revert "chore: revert "chore: add 2.4 motd (work in progress)""
revertception
This reverts commit 7fc3f4a569405c86675978341a0c008069b994b9.
2024-12-29 21:44:05 -04:00
4743222044
chore: forward master in sync to v2.3.4 2024-12-28 19:58:00 -04:00
14a600f922
chore: bump version related things 2024-12-28 19:56:17 -04:00
13e6d180f8
fix: use global env variables when executing 2024-12-28 19:53:26 -04:00
CelestialCrafter
836f941e16
fix: handle completion info check error (#330)
* fix: handle completion info check error
fixes Rosettea/Hilbish#329

* make changelog more descriptive
2024-12-28 19:53:19 -04:00
a02cd1d7ef
fix: use global env variables when executing 2024-12-28 19:50:06 -04:00
a24bca3258
fix!: get/set env variables via env table
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'
2024-05-02 22:09:04 -04:00
6 changed files with 17 additions and 53 deletions

View File

@ -4,8 +4,10 @@
### Added ### Added
- Forward/Right arrow key will fill in hint text (#327) - Forward/Right arrow key will fill in hint text (#327)
## [2.3.4] - 2024-12-28
### Fixed ### Fixed
- Skip over file and prevent panic if info cannot be retrieved during file completion (due to permission error or anything else) - Skip over file and prevent panic if info cannot be retrieved during file completion (due to permission error or anything else)
- Apply environment variables properly after 2.3 shell interpreter changes
## [2.3.3] - 2024-11-04 ## [2.3.3] - 2024-11-04
### Fixed ### Fixed
@ -787,6 +789,7 @@ This input for example will prompt for more input to complete:
First "stable" release of Hilbish. First "stable" release of Hilbish.
[2.3.4]: https://github.com/Rosettea/Hilbish/compare/v2.3.3...v2.3.4
[2.3.3]: https://github.com/Rosettea/Hilbish/compare/v2.3.2...v2.3.3 [2.3.3]: https://github.com/Rosettea/Hilbish/compare/v2.3.2...v2.3.3
[2.3.2]: https://github.com/Rosettea/Hilbish/compare/v2.3.1...v2.3.2 [2.3.2]: https://github.com/Rosettea/Hilbish/compare/v2.3.1...v2.3.2
[2.3.1]: https://github.com/Rosettea/Hilbish/compare/v2.3.0...v2.3.1 [2.3.1]: https://github.com/Rosettea/Hilbish/compare/v2.3.0...v2.3.1

20
exec.go
View File

@ -434,26 +434,8 @@ func execHandle(bg bool) interp.ExecHandlerFunc {
// sh/interp but with our job handling // sh/interp but with our job handling
env := hc.Env env := hc.Env
envList := make([]string, 0, 64) envList := os.Environ()
env.Each(func(name string, vr expand.Variable) bool { env.Each(func(name string, vr expand.Variable) bool {
if name == "PATH" {
pathEnv := os.Getenv("PATH")
envList = append(envList, "PATH="+pathEnv)
return true
}
if !vr.IsSet() {
// If a variable is set globally but unset in the
// runner, we need to ensure it's not part of the final
// list. Seems like zeroing the element is enough.
// This is a linear search, but this scenario should be
// rare, and the number of variables shouldn't be large.
for i, kv := range envList {
if strings.HasPrefix(kv, name+"=") {
envList[i] = ""
}
}
}
if vr.Exported && vr.Kind == expand.String { if vr.Exported && vr.Kind == expand.String {
envList = append(envList, name+"="+vr.String()) envList = append(envList, name+"="+vr.String())
} }

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

@ -24,6 +24,7 @@ require 'nature.opts'
require 'nature.vim' require 'nature.vim'
require 'nature.runner' require 'nature.runner'
require 'nature.hummingbird' require 'nature.hummingbird'
require 'nature.env'
local shlvl = tonumber(os.getenv 'SHLVL') local shlvl = tonumber(os.getenv 'SHLVL')
if shlvl ~= nil then if shlvl ~= nil then
@ -32,36 +33,6 @@ else
os.setenv('SHLVL', '0') os.setenv('SHLVL', '0')
end 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 do
local startSearchPath = hilbish.userDir.data .. '/hilbish/start/?/init.lua;' local startSearchPath = hilbish.userDir.data .. '/hilbish/start/?/init.lua;'
.. hilbish.userDir.data .. '/hilbish/start/?.lua' .. hilbish.userDir.data .. '/hilbish/start/?.lua'

View File

@ -2,9 +2,7 @@ local bait = require 'bait'
local lunacolors = require 'lunacolors' local lunacolors = require 'lunacolors'
hilbish.motd = [[ hilbish.motd = [[
Wait ... {magenta}2.3{reset} is basically the same as {red}2.2?{reset} {magenta}Hilbish{reset} blooms in the {blue}midnight.{reset}
Erm.. {blue}Ctrl-C works for Commanders,{reset} {cyan}and the sh runner has some fixes.{reset}
Just trust me bro, this is an important bug fix release. {red}- 🌺 sammyette{reset}
]] ]]
bait.catch('hilbish.init', function() bait.catch('hilbish.init', function()

View File

@ -11,7 +11,7 @@ var (
// Version info // Version info
var ( var (
ver = "v2.3.3" ver = "v2.3.4"
releaseName = "Alyssum" releaseName = "Alyssum"
gitCommit string gitCommit string