Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

micro: Don't forward nil events into the sub event handler #2992

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

JoeKar
Copy link
Collaborator

@JoeKar JoeKar commented Oct 24, 2023

Currently the Redraw() performed by the UpdateDiff() will bring the raw pane into trouble. According to #2991 (comment) 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

@JoeKar JoeKar force-pushed the fix/crash-in-rawpane branch from 1950fb3 to ce63f74 Compare November 1, 2023 21:13
@dmaluka
Copy link
Collaborator

dmaluka commented Nov 7, 2023

One more reason to merge this PR: #3011

@octoshrimpy
Copy link

is there any reason this is still being held up?

@dmaluka
Copy link
Collaborator

dmaluka commented Jan 22, 2024

@zyedidia ping.

@JoeKar JoeKar merged commit 0de1633 into zyedidia:master Mar 12, 2024
3 checks passed
@JoeKar JoeKar deleted the fix/crash-in-rawpane branch March 12, 2024 17:35
@xxuejie
Copy link

xxuejie commented Jul 9, 2024

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:

So maybe there is a corner case that is not handled here? Or am I doing things the wrong way?

Thanks!

@dmaluka
Copy link
Collaborator

dmaluka commented Jul 10, 2024

Yeah, this is a regression, thanks for reporting. We missed that since commit b68461c the terminal code has been (slightly hackily) relying on nil events as notifications to close the terminal:

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

@dmaluka
Copy link
Collaborator

dmaluka commented Jul 14, 2024

Fixed by #3386

@xxuejie
Copy link

xxuejie commented Jul 15, 2024

Thanks! I can confirm that #3386 indeed fixes the issue.

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.

micro crashes when the raw buffer contains more than 1000 lines
4 participants