mirror of
https://github.com/Hilbis/Hilbish
synced 2025-04-01 19:23:24 +00:00
feat: add signal hooks for sigint and sigwinch (#80)
This commit is contained in:
parent
94a8b4ad47
commit
af4c3885ae
7
lua.go
7
lua.go
@ -59,6 +59,13 @@ func LuaInit() {
|
||||
hooks = bait.New()
|
||||
l.PreloadModule("bait", hooks.Loader)
|
||||
|
||||
// Add Ctrl-C handler
|
||||
hooks.Em.On("signal.sigint", func() {
|
||||
if !interactive {
|
||||
os.Exit(0)
|
||||
}
|
||||
})
|
||||
|
||||
l.SetGlobal("complete", l.NewFunction(hshcomplete))
|
||||
|
||||
// Add more paths that Lua can require from
|
||||
|
Loading…
x
Reference in New Issue
Block a user