tomblind / local-lua-debugger-vscode

Local Lua Debugger for VSCode
MIT License
104 stars 26 forks source link

[LOVE2D] white screen on startup? #46

Closed shingle-bells closed 2 years ago

shingle-bells commented 2 years ago

Hi, I'm having an issue where trying to run my Love2D project through the debugger results in freezing at a white screen on start up, with no error explaining what I did wrong. I followed the instructions pretty closely. If it's important, here's my Love project: game.zip

I call require("lldebugger").start() in main.lua.

EDIT: Here's my launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "lua-local",
            "request": "launch",
            "name": "Debug LOVE",
            "program": {
                "command": "love"
            },
            "args": [
                "${workspaceFolder}"
            ],
            "scriptRoots": [
                "${workspaceFolder}"
            ]
        }
    ]
}
tomblind commented 2 years ago

Thanks for posting the example - that made the issue easy to find.

The problem is that no output is reaching the debugger from love. This is because of the setting t.console = true in your conf.lua. This circumvents stdout and stdin and prevents communication with the debugger, so you'll want that to be false when trying to debug.

If you want to open a console window when not debugging, you could set it like this: t.console = os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") ~= "1".

shingle-bells commented 2 years ago

ah, thanks for the help! Maybe you could note this in the LOVE example in the Readme?

tomblind commented 2 years ago

will do

tomblind commented 2 years ago

README updated