mirror of https://github.com/Hilbis/Hilbish
feat: add signal hooks for sigint and sigwinch (#80)
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…
Reference in New Issue