Rosettea / Hilbish

🌓 The Moon-powered shell! A comfy and extensible shell for Lua fans! 🌺 ✨

Home Page:https://rosettea.github.io/Hilbish/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feat: add function for commanders to stop execution

TorchedSammy opened this issue · comments

idea: pass some kind of self arg to commanders which provides an exit command. this is kind of an alternative to a return with exit code

(would be a breaking change - but shouldnt be one)
example:

local commander = require 'commander'

commander.register('test', function(self, args)
    self:exit(2)
end)

This would probably not work properly unless the function is somehow run in a seperate thread. Also the example provided is completely incompatible with the current function(args, sink) currently used. It might be better to make sending an EOF to sink.out stop monitoring the function, or make a sink closable

i don't remember why i thought of this in the first place, so i think i'm just gonna close.