micro
micro copied to clipboard
micro: Don't forward nil events into the sub event handler
Currently the Redraw()
performed by the UpdateDiff()
will bring the raw pane into trouble. According to https://github.com/zyedidia/micro/issues/2991#issuecomment-1777596853 it's possible to have the redraw event without a parallel tcell
event and this can lead to event pointer de-references in the sub event handler.
Fixes #2991
One more reason to merge this PR: #3011
is there any reason this is still being held up?
@zyedidia ping.
Hey so I'm bisecting a regression to this PR. It seems that the change here is breaking existing behavior when an interactive shell is used. To reproduce it:
- Install this plugin: https://github.com/samdmarshall/micro-fzf-plugin
- Execute
fzf
command - Even though the plugin is configured so we don't wait for terminal output, micro will always prompt with the message
Press enter to continue
So maybe there is a corner case that is not handled here? Or am I doing things the wrong way?
Thanks!
Yeah, this is a regression, thanks for reporting. We missed that since commit b68461cf72cb the terminal code has been (slightly hackily) relying on nil events as notifications to close the terminal:
https://github.com/zyedidia/micro/commit/b68461cf72cb913c40dd60a77b2cb2fcc27aec0f#diff-f4c689c96c13af20e2e9fc3cfdb39b4549de701266748f0acaac5c5b4ce92fd6R113
so now micro doesn't close the terminal automatically, so you see this Press enter to close
instead.
I think we can fix it in a better way. I'll try to fix it shortly.
Fixed by #3386
Thanks! I can confirm that #3386 indeed fixes the issue.