fix(console): correct terminal_test state guard#30
Conversation
aldum
left a comment
There was a problem hiding this comment.
With compy-toys#106, these states will be collapsed anyway, let's just delete the projec_open guard.
I made a note to pay attention to this when redoing the state machine, thanks.
|
dropped project_open, gated on ready only. thanks for the compy-toys#106 note. |
|
@aldum this is a terminal test, right? How likely is it that we want to perform it while a project is open or no project is open? If our intended behavior is actually dropping the 'ready' state in the future, maybe we should drop that instead of dropping 'project_open'? Or just keep both as in the original fix. For all I know, compy-toys#106 may land in 2028, so we need a robust behavior in the meantime, and ideally not having to keep something in mind all along. Remembering something that we will use now (e.g. "only perform terminal_test when a project is open, otherwise it won't work) seems better to me than remembering something for a (possibly distant) future event. |
|
Yes, this is a terminal test, not really intended to be run when a project is running. |
|
Thanks! Should be safe to merge, then? |
The guard used ~= 'ready' or ~= 'project_open', which is always true, so terminal_test always returned early and never ran. Should be and: skip only when the state is neither ready nor project_open.