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

kdash reacts to key-down and key-up events and jumps two records at the time #390

Closed
ppasieka opened this issue Oct 3, 2023 · 4 comments

Comments

@ppasieka
Copy link

ppasieka commented Oct 3, 2023

Describe the bug
Attempt to navigate through any resource lists (pods, services, etc.) is hindered because the kdash reacts to key-down and key-up events. This results in the selection bar moving two rows at a time.

To Reproduce
Open kdash and navigate with j,k or arrow up/down

Expected behavior
Pressing navigational buttons (j, k) or (arrow up/down) should move one row at a time

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS and OS version: Windows 10
  • Terminal name and version Windows terminal 1.17.11461.0
  • Shell name and version PowerShell 7.3.7
  • Kubectl Client Version v1.25.6
  • Kubectl Server Version v1.25.6
  • KDash version 0.4.4
@deepu105
Copy link
Contributor

deepu105 commented Oct 6, 2023

Probbaly is happening only on Windows as I dont see it on Linux. I would have to check but will take time

@deepu105
Copy link
Contributor

deepu105 commented Oct 6, 2023

any help to debug would be appreciated as well

@tired-old-man
Copy link

The problem is with changes in crossterm library.
They introduced the kind to KeyEvent. It can have two values: Press and Release.

crossterm-rs/crossterm#745
crossterm-rs/crossterm@318f810

Since you upgraded the crossterm library in version 0.3.7 this begin to happen.

You can see the same issue on ratatui.
ratatui-org/ratatui#347

The suggestion is to check for key press kind:

To fix this, check KeyEvent.kind == KeyEventKind.Press (on windows).

I'm not sure if it is that simple of a fix and how/will it affect other platforms.

@deepu105
Copy link
Contributor

deepu105 commented Nov 1, 2023

Thank you @tired-old-man

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

No branches or pull requests

3 participants