Open karlp opened 6 years ago
emm... I am not familiar with that io.stdout:setvbuf 'no'
, Should it be added to the top of the script?
well, if I run my script (with just #!/usr/bin/lua) from the console, then I get console output as it's printed, or line buffered at least.
When I run the same script inside intellij, I get no output until the script completes, (after, in this case, ~20 seconds) then the entire output is printed in one hit. I'm just trying to get the script output window in intellij to behave better.
ok, I'll test it
I looked into it further....
Working as expected, with lua 5.3
#!/usr/bin/lua
function sleep(n) -- seconds
local t0 = os.clock()
while os.clock() - t0 <= n do end
end
print("before sleep args", ...)
sleep(3)
print("ending application")
Failing, with lua-5.1
#!/usr/bin/lua-5.1 <<<<< only difference
function sleep(n) -- seconds
local t0 = os.clock()
while os.clock() - t0 <= n do end
end
print("before sleep args", ...)
sleep(3)
print("ending application")
In both cases, the intellij/emmylua run config is: program: myscript.lua entryfile: [blank] parameters: command line arguments to my script (prints with "before sleep args")
I'm trying to set vbuf off for a script I'm working on, and I know I had this working before, but i've installed a clean computer, and can't figure it out... I want to run with lua-5.1, so I have the following options for the runconfig
That works for running a script with no options.
But to get options for my own script, I have it like so
But now I get buffered IO, and the run window doesn't show any console output until the process terminates.
Any ideas/tips?