Search code examples
buildsublimetext2moai

Live console output in Sublime Text 2


I managed to create a simple build configuration for my project that builds and also launches it. However the console freezes during the execution and it only prints the messages generated by the application after I close it. The build configuration looks like this:

{
    "cmd": ["${project_path:${folder}}/run.bat"]
}

The run.but just runs the application like this:

"%MOAI_BIN%\moai" "config\config.lua" "main.lua"

Solution

  • I had the same issue when running the Moai host from Sublime Text 2 on Mac OS X and was able to fix it by calling

    io.stdout:setvbuf("no")
    

    at the beginning of my Lua code, thanks to this snippet.