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

Cutie Select broken #26

Closed
Theproccy opened this issue Feb 1, 2022 · 14 comments
Closed

Cutie Select broken #26

Theproccy opened this issue Feb 1, 2022 · 14 comments

Comments

@Theproccy
Copy link
Contributor

cutie.select is not selecting on use of the arrow keys.

e.g. on the press of the up arrow key cutie will treat that as a press of the return key and advance the program without changing selection.

I reverted to readchar 3.0.4 and the error did not persist and cutie now works as expected.

IDE: pycharm 2021.2 community edition with terminal emulation turned on.
Running python 3.9 although the issue persists on 3.7 when using the latest version of readchar.

@C0D3D3V
Copy link

C0D3D3V commented Feb 1, 2022

What OS are you using?

@Theproccy
Copy link
Contributor Author

What OS are you using?

Windows 10

@Kamik423
Copy link
Owner

Kamik423 commented Mar 3, 2022

As far as I am aware this is not an issue with cutie but rather reachar / PyCharm. See magmax/python-readchar#51

Do you agree that this is what is happening?

@Theproccy
Copy link
Contributor Author

As far as I am aware this is not an issue with cutie but rather reachar / PyCharm. See magmax/python-readchar#51

Do you agree that this is what is happening?

It works perfectly with the previous version of readchar in PyCharm. So it is the latest update to readchar that has caused this break.

Having you looked at the readchar release notes, the the 3. 0. 5. Update was meant to fix arrow keys on Windows it's possible that this has broken readchar on Windows and hence is causing the issues.

My recommendation for a fix would be to make the the requirements. txt specified version 3.0.4 then cuti will work as intended.
Will file a pull request as well as this.

@C0D3D3V
Copy link

C0D3D3V commented Mar 12, 2022

There seems to be two thread about similar problems with readchar magmax/python-readchar#65
magmax/python-readchar#66

Windows is just so error prone, it's unbelievable. I would recommend you to use Linux. I also found out earlier that the keycode map of readchar is not that true.

Windows support of readchar is just poor, because not all versions are supported correctly.

When I last tested it under winfows 10 it still worked though, I'll test it again soon.

you can force the old readchar version in your projects for now, i see no reason to force this for everyone (But I will also make a few tests)

@Theproccy
Copy link
Contributor Author

Theproccy commented Mar 12, 2022

the issue is similar but as my use for that library is a requirement of this one I do not need to use it apart from this I neither understand nor am interested in the tiny changes I just want this library to work for people.

My suggested fix is not a force it is just specified the previous version in the retirements text so it goes from
readchar
to
readchar == 3.0.4
so by default, it would work on Windows platforms. The release details on readchar v3.0.5 are "Fix Windows problem with backspace and arrows codes." as it has broken cutie for me and there are no additional benefits that could be found as this is only a small update. I feel like updating the requirements so that it would use the previous version would not be noticed by anyone and cause cuite to work on windows by default and therefore resolve this issue.

regarding the Linux issue. I do plan on running Linux at the end of win 10 life as I am not a fan of win 11 but to do that I need RTX support and also SteelSeries engine support. I don't like windows and would love to run Linux but the main use for my PC is videogames and they are already a pain to get working properly on my PC (i cant alt tab rainbow 6 siege because it won't display again) and also the lack of support for Linux by Nvidia and video games as a whole is a deal-breaker. Next pc I dual boot at the least.

@C0D3D3V
Copy link

C0D3D3V commented Mar 12, 2022

I just tested cutie with readchar 3.0.5 in a CMD and powershell on windows 10 and @Theproccy is correct, version 3.0.5 breaks the list selection.

I will also force version 3.0.4 in my project, but leave the decision if you want to force the version in general to you @Kamik423 .

@Cube707
Copy link

Cube707 commented Apr 19, 2022

I have adressed this and the windows side of readchar in generall within magmax/python-readchar#71, but it's still waiting to be merged.

It would be interesting if your issues are also fixed by this PR and if yes, you might want to voice that so it gets merged finally

@Theproccy
Copy link
Contributor Author

This does resolve the issue that I was experiencing. I will certainly recommend that your PR gets processed.

Till your PR is merged however I will have to persist with using an older version.

@Kamik423
Copy link
Owner

I am a bit uncomfortable with pinning a specific version as python version management is a mess and it might conflict with other packages also requiring readchar. If you are adamant that we should pin it then I can still do it.

But would it now make more sense to wait for the readchar PR? Then everyone experiencing your issue can just update that.

@Theproccy
Copy link
Contributor Author

readchar 3.0.5 has the following as its release notes:

"Fix Windows problem with backspace and arrows codes."

However, it completely breaks cutie select. The only changes are to the 4 scan codes for the arrow keys and the scan code for backspace.

At this point i think we have these options:

  1. readchar == 3.0.4 (force the last version that was known to work with no issues)
  2. readchar != 3.0.5 (therefore when the next release happens it will automatically update.)
  3. Fork readchar pull in cube707's code and bundle it with cutie

I will amend my pull request to option 2.

I don't believe that the readchar pull request will be processed anytime soon as has been silent since febuary.

@Theproccy
Copy link
Contributor Author

Pull request #27 has been amended

@Cube707
Copy link

Cube707 commented Jul 24, 2022

readchar just releases a new version that should fix this. Please confirm

@Theproccy
Copy link
Contributor Author

Theproccy commented Jul 24, 2022

readchar just releases a new version that should fix this. Please confirm

It was fixed by update 3.0.6 and has not been broken by 3.1.0.

It was fixed by the custom reqirments.txt that just excludes the one broken version and so got auto-updated. I still recommend that that is pulled in to ensure that there are no future problems with the previous version.

Kamik423 added a commit that referenced this issue Sep 18, 2022
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 a pull request may close this issue.

4 participants