BUG: Lua VM has no CPU/memory limits
Describe the bug
The plugin Lua VM (plugin/plugin.go) has no execution time limit or memory cap. A plugin containing an infinite loop (while true do end) or excessive memory allocation will freeze the entire TUI with no way to recover other than killing the process.
To reproduce
- Create a plugin file
~/.config/matcha/plugins/freeze.lua:
local matcha = require("matcha")
matcha.on("startup", function()
while true do end
end)
- Start matcha
- The TUI freezes permanently
Expected behavior
Plugin execution should have a timeout (e.g. 5 seconds per hook call) and/or a memory limit. When exceeded, the plugin should be terminated with an error logged and a user notification. Consider using gopher-lua's context cancellation support or an instruction count hook.
OS
All platforms
This has had no activity for 30 days. It will be closed in 14 days unless updated. Comment or remove the stale label to keep it open.
Closing due to inactivity. Reopen if still relevant.