Use shell job for terminal callback

Fixes #2529
This commit is contained in:
Zachary Yedidia
2022-08-19 15:46:01 -07:00
parent 3d6b0c6dd6
commit 810133d5a8
3 changed files with 7 additions and 6 deletions

View File

@@ -128,7 +128,13 @@ func (t *Terminal) Close() {
// call the lua function that the user has given as a callback
if t.getOutput {
if t.callback != nil {
t.callback(t.output.String())
Jobs <- JobFunction{
Function: func(out string, args []interface{}) {
t.callback(out)
},
Output: t.output.String(),
Args: nil,
}
}
}
}