@@ -226,10 +226,14 @@ func registerAPI(L *lua.LState, runner *Runner) {
226226 return 1
227227 }))
228228
229- runAsyncFn := L .NewFunction (func (L * lua.LState ) int {
229+ jjAsyncFn := L .NewFunction (func (L * lua.LState ) int {
230230 args := argsFromLua (L )
231231 return yieldStep (L , step {cmd : runner .ctx .RunCommand (args )})
232232 })
233+ jjInteractiveFn := L .NewFunction (func (L * lua.LState ) int {
234+ args := argsFromLua (L )
235+ return yieldStep (L , step {cmd : runner .ctx .RunInteractiveCommand (args , nil )})
236+ })
233237 jjFn := L .NewFunction (func (L * lua.LState ) int {
234238 args := argsFromLua (L )
235239 out , err := runner .ctx .RunCommandImmediate (args )
@@ -262,7 +266,8 @@ func registerAPI(L *lua.LState, runner *Runner) {
262266 root := L .NewTable ()
263267 root .RawSetString ("revisions" , revisionsTable )
264268 root .RawSetString ("revset" , revsetTable )
265- root .RawSetString ("jj_async" , runAsyncFn )
269+ root .RawSetString ("jj_async" , jjAsyncFn )
270+ root .RawSetString ("jj_interactive" , jjInteractiveFn )
266271 root .RawSetString ("jj" , jjFn )
267272 root .RawSetString ("flash" , flashFn )
268273 root .RawSetString ("copy_to_clipboard" , copyToClipboardFn )
@@ -271,7 +276,8 @@ func registerAPI(L *lua.LState, runner *Runner) {
271276 // but also expose at the top level for convenience
272277 L .SetGlobal ("revisions" , revisionsTable )
273278 L .SetGlobal ("revset" , revsetTable )
274- L .SetGlobal ("jj_async" , runAsyncFn )
279+ L .SetGlobal ("jj_async" , jjAsyncFn )
280+ L .SetGlobal ("jj_interactive" , jjInteractiveFn )
275281 L .SetGlobal ("jj" , jjFn )
276282 L .SetGlobal ("flash" , flashFn )
277283 L .SetGlobal ("copy_to_clipboard" , copyToClipboardFn )
0 commit comments