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

odd behavour on windows #166

Closed
pm100 opened this issue May 4, 2023 · 5 comments
Closed

odd behavour on windows #166

pm100 opened this issue May 4, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@pm100
Copy link
Contributor

pm100 commented May 4, 2023

I reported this bug to tui-textarea https://github.com/rhysd/tui-textarea here rhysd/tui-textarea#14

They support tui and ratatui

In their demo app (very simple) the keystrokes are duplicated on windows. It works fine using tui but fails 100% using ratatui

here is gif of the behavior

minbug

@pm100 pm100 added the bug Something isn't working label May 4, 2023
@mindoodoo
Copy link
Member

mindoodoo commented May 4, 2023

Go checkout #120 which brought up the same issue, essentially in windows you will need to match against the specific KeyPressed event, otherwise your code will also be triggered by KeyUp event (don't quote me on the event type names tho). All the examples were fixed in order to handle this explicitly in #129.

So without checking out their example, that's most likely what's happening.

@pm100
Copy link
Contributor Author

pm100 commented May 4, 2023

but it worked fine with tui, so ratatui introduced a breaking change? or was it crossterm?

@lthoerner
Copy link
Contributor

This is a crossterm issue

@mindoodoo
Copy link
Member

@pm100 I wouldn't be able to tell you without looking more into it why it changed, but this was most likely introduced by a crossterm update. However, this isn't a bug with ratatui nor crossterm and more a bug with the particular example you're looking at.

There's an open pr over on the crossterm repo aiming to make the KeyUp event opt-in, but hasn't been merged yet.

Since this isn't really a bug with ratatui, I'll close this for now.

@pm100
Copy link
Contributor Author

pm100 commented May 6, 2023

fyi - caused by crossterm-rs/crossterm#745

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants