local-lua-debugger-vscode icon indicating copy to clipboard operation
local-lua-debugger-vscode copied to clipboard

TIC-80 support

Open lua-rocks opened this issue 3 years ago • 3 comments

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 avatar Jan 02 '22 16:01 lua-rocks

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 avatar Jan 02 '22 16:01 lua-rocks

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

lua-rocks avatar Jan 02 '22 16:01 lua-rocks

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.

tomblind avatar Jan 07 '22 23:01 tomblind