Fix termpane not closing automatically after terminal job finished#3386
Merged
dmaluka merged 1 commit intomicro-editor:masterfrom Jul 15, 2024
Merged
Fix termpane not closing automatically after terminal job finished#3386dmaluka merged 1 commit intomicro-editor:masterfrom
dmaluka merged 1 commit intomicro-editor:masterfrom
Conversation
Fix regression caused by the fix 0de1633 ("micro: Don't forward nil events into the sub event handler"): even if the terminal was started with `wait` set to false, it is not closed immediately after it finished its job, instead it shows "Press enter to close". The reason is that since the commit b68461c ("Terminal plugin callback support") the termpane code has been (slightly hackily) relying on nil events as notifications to close the terminal after it finished its job. So fix this by introducing a separate CloseTerms() function for notifying termpanes about that, decoupled from HandleEvent() which is for tcell events only.
JoeKar
approved these changes
Jul 14, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix regression caused by the fix 0de1633 ("micro: Don't forward nil events into the sub event handler") reported in #2992 (comment): even if the terminal was started with
waitset to false, it is not closed immediately after it finished its job, instead it shows "Press enter to close".The reason is that since the commit b68461c ("Terminal plugin callback support") the termpane code has been (slightly hackily) relying on nil events as notifications to close the terminal after it finished its job. So fix this by introducing a separate
CloseTerms()function for notifying termpanes about that, decoupled fromHandleEvent()which is for tcell events only.