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

fix: output corruption when control sequence left in buffer #1

Merged
merged 2 commits into from
Jul 14, 2024

Conversation

StepY1aoZz
Copy link
Owner

@StepY1aoZz StepY1aoZz commented Jul 14, 2024

This PR fixed issues c-bata#119, openGemini/openGemini#519 and c-bata#223.

When users input too fast (a common case is scrolling mouse in tmux), more than one key code was read from STDIN. If there is any control key (i.e. UP,DOWN,DELETE) in it, they will be regarded as normal characters, and further output to the terminal. Also, the method calculating the length of current line returns a wrong value, which caused a part of current output cannot be erased.

This PR removed all control sequences in input before they were stored into buffer or output to the terminal.

Example

old-ezgif com-video-to-gif-converter
BEFORE
new-ezgif com-video-to-gif-converter
AFTER

@StepY1aoZz StepY1aoZz self-assigned this Jul 14, 2024
@StepY1aoZz StepY1aoZz merged commit 61a5759 into master Jul 14, 2024
@StepY1aoZz StepY1aoZz changed the title Fix corruption fix: output corruption when control sequence left in buffer 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.

1 participant