Skip to content

Comments

Fix termpane not closing automatically after terminal job finished#3386

Merged
dmaluka merged 1 commit intomicro-editor:masterfrom
dmaluka:termpane-noclose-fix
Jul 15, 2024
Merged

Fix termpane not closing automatically after terminal job finished#3386
dmaluka merged 1 commit intomicro-editor:masterfrom
dmaluka:termpane-noclose-fix

Conversation

@dmaluka
Copy link
Collaborator

@dmaluka dmaluka commented Jul 14, 2024

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 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.

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.
@dmaluka dmaluka merged commit 1f71667 into micro-editor:master Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants