Maybe I should work on trying to fix this in the emacs lua-mode if possible.
Hi!
The thing you describe looks like something wrong with with lua subprocess started from within emacs. Please, create an issue at the bugtracker [1] so that I won't forget about it in future. I'll see what I can do, probably, there _is_ a workaround for that.