tomblind / local-lua-debugger-vscode

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

TIC-80 support #52

Open lua-rocks opened 2 years ago

lua-rocks commented 2 years ago

Your debugger is awesome, but unfortunately, it is not compatible with tic-80 because there is no access to global os:

 TIC-80 tiny computer
 version 1.0.1770-dev Pro (60e63de)
 https://tic80.com (C) 2017-2021

 loading cart...

>./run/debugger.lua:1: attempt to index a nil value (global 'os')
>

Maybe you have some idea how to fix it?

lua-rocks commented 2 years ago

if you use os only for os.execute, maybe you can replace it with something like this:

local function execute(command)
  local f = io.popen(command)
  local l = f:read("*a")
  f:close()
  return l
end

print(execute("echo $USER"))
lua-rocks commented 2 years ago

... oh, never mind, io is also not available 😢

tomblind commented 2 years ago

os is used specifically for os.getenv to read settings passed from the vscode extension. It might be possible to refactor things to not require this. But, not having io is a dealbreaker. That's required for communicating over stdio or pipes. Without that, I don't think there's any way for the debugger to work.