pkulchenko / ZeroBraneStudio

Lightweight Lua-based IDE for Lua with code completion, syntax highlighting, live coding, remote debugger, and code analyzer; supports Lua 5.1, 5.2, 5.3, 5.4, LuaJIT and other Lua interpreters on Windows, macOS, and Linux
http://studio.zerobrane.com/
Other
2.62k stars 516 forks source link

Console window input problems #1179

Open madmaxoft opened 7 months ago

madmaxoft commented 7 months ago

I've noticed some problems when using a custom Lua interpreter that expects console input, on Linux.

Normally, when ZBS runs an interpreter in debug mode and uses the console window to display the interpreter output, there's an indicator on the bottom-most line; setting the cursor there and typing sends the input to the interpreter's stdin upon pressing Enter. This usually works fine, but:

  1. If the interpreter outputs more lines while the user is typing, the text the user typed disappears and won't be sent to the interpreter.
  2. If the user starts another script that outputs to the console window (while the interpreter is running), the indicator on the bottom-most line is removed and text cannot be typed and sent to the interpreter. If the interpreter outputs more lines after this, the indicator comes back and again text can be typed and sent to the interpreter.

These seem 100% reproducible. I've encountered this while developing a plugin for Cuberite, using the Cuberite interpreter (note that I'm using the package from PR https://github.com/pkulchenko/ZeroBranePackage/pull/85 ) which also adds an "InfoDump" menu item that outputs into the console window (for case 2). Specifically for Cuberite, this is only observed on Linux, because it uses the console window only on Linux.

My OS is KDE Neon 6.0 with KDE Plasma 6.0.3, on X11, if this is relevant.