ArthurSonzogni / FTXUI

:computer: C++ Functional Terminal User Interface. :heart:
MIT License
6.73k stars 401 forks source link

Arrow keys not working they way they should on Microsoft terminal #141

Closed DavidLazarescu closed 3 years ago

DavidLazarescu commented 3 years ago

When switching between input fields the arrow key sometimes paste in symbols (text doesnt anymore and mouse movement either, thats fixed). When switching between checkboxes and pressing ENTER while switching between them, the arrow keys dont work anymore either (or the switching functionallity doesnt work anymore)

EDIT: When mouse selecting is enabled (When you can select stuff with your mouse e.g. buttons), symbols also get copied in. Just the text part was fixed in the previous fix

ArthurSonzogni commented 3 years ago

This sounds like again a problem with Microsoft's terminal. What should I do to reproduce? Should I reuse your project: https://github.com/Creapermann/PW-Manager

What symbols do you received? Last time, it was 1;1;R

DavidLazarescu commented 3 years ago

This sounds like again a problem with Microsoft's terminal. What should I do to reproduce? Should I reuse your project: https://github.com/Creapermann/PW-Manager

What symbols do you received? Last time, it was 1;1;R

Yes, you can reuse my project. As i mentioned, you successfully fixed the bug of symbols getting pasted in and this part works all fine now. But there are 2 more things, when i am selecting a input field and moving my mouse around, a lot of symbols (i guess the mouse position) get pasted in (this only happens when selecting components like buttons or input fields is turned on). Also when using the arrow keys to switch between input fields, symbols are also getting pasted in. https://streamable.com/w66ehk

DavidLazarescu commented 3 years ago

@ArthurSonzogni hey, i am kinda stuck with my project caused by this bug. Could you maybe take a look on it in the next time?

ArthurSonzogni commented 3 years ago

I am currently on vacation. Most likely, I will take a look next week.

Le mar. 20 juil. 2021 à 19:19, Creapermann @.***> a écrit :

@ArthurSonzogni https://github.com/ArthurSonzogni hey, i am kinda stuck with my project caused by this bug. Could you maybe take a look on it in the next time?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ArthurSonzogni/FTXUI/issues/141#issuecomment-883561140, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEJ4QX3WN2F7TWSNXWORS3TYWVY5ANCNFSM47ZLX43A .

DavidLazarescu commented 3 years ago

I am currently on vacation. Most likely, I will take a look next week. Le mar. 20 juil. 2021 à 19:19, Creapermann @.***> a écrit : @ArthurSonzogni https://github.com/ArthurSonzogni hey, i am kinda stuck with my project caused by this bug. Could you maybe take a look on it in the next time? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#141 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEJ4QX3WN2F7TWSNXWORS3TYWVY5ANCNFSM47ZLX43A .

Thanks!

DavidLazarescu commented 3 years ago

@ArthurSonzogni, hey i just wanted to add, that mouse movement is also leading to symbols getting pasted in.

ArthurSonzogni commented 3 years ago

I took a look today. I tried the different FTXUI examples. For instance: ./example/component/input.cpp

which contains 3 ftxui::Input stacked vertically. Nothing seems wrong.

Can you reproduce your issue on some FTXUI examples? (I can't build your project)

DavidLazarescu commented 3 years ago

Here is what happens: https://streamable.com/tohe1s

My code is on my github under the project PW-Manager (The older verisons have the same problems and use cmake, you should be able to compile them).

You previously perfectly fixed the problem that symbols are getting pasted in when writing or deleting, but the exactly same happens with all the arrow keys (left, right, up and down) and when moving the mouse as you can see.

Please text me if you need any info, i just want to resolve this problem. Thanks a lot for your help

DavidLazarescu commented 3 years ago

@ArthurSonzogni the specific Code i used for this example is in PW-Manager/src/View/UI_EditNote.cpp. I tried to Stick to the docs, if there is anything wrong with the Code, please tell me.

Thanks in advance!

DavidLazarescu commented 3 years ago

@ArthurSonzogni, i rewrote some stuff to be pretty much exactly as the docs, still the same problem.

ArthurSonzogni commented 3 years ago

Could you write a minimal example using only FTXUI? This would help. I can't compile your code on WIndows, and can't reproduce your problem on any of the FTXUI examples.

DavidLazarescu commented 3 years ago

Could you write a minimal example using only FTXUI? This would help. I can't compile your code on WIndows, and can't reproduce your problem on any of the FTXUI examples.

What do you mean by a minimal example?

ArthurSonzogni commented 3 years ago

A simple minimal .cpp file reproducing the problem. Something that wouldn't require me to build your project.

Le dim. 15 août 2021 à 12:45, Creapermann @.***> a écrit :

Could you write a minimal example using only FTXUI? This would help. I can't compile your code on WIndows, and can't reproduce your problem on any of the FTXUI examples.

What do you mean by a minimal example?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ArthurSonzogni/FTXUI/issues/141#issuecomment-899030970, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEJ4QW3IIHACPDXK466XJ3T46LFHANCNFSM47ZLX43A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

DavidLazarescu commented 3 years ago

@ArthurSonzogni, i was writing the minimal example when i realized that in the example (directly in the main()), everything worked the way it should. Then i moved the minimal example into another file, then called this file directly from the main() and it still worked all fine.

If you could take a look at my code (at https://github.com/Creapermann/PW-Manager/blob/main/PW-Manager/src/Shared.h), you can see that i m using one screen instance shared across all the files, to render on it: inline ftxui::ScreenInteractive screen = ftxui::ScreenInteractive::Fullscreen();

I m pretty sure that this is where the error is, i think that when i am switching from the start window to the login window (by selecting login from the menu https://github.com/Creapermann/PW-Manager/blob/main/PW-Manager/src/View/UI_Start.cpp), i should somehow stop the rendering from the UI_Start.cpp file on the screen, because else there are multiple things rendering at once? I am not really sure about the technical details of this, but when calling the minimal example (which is in an extra file), from the UI_Start.cpp file (by selecting login in the menu), i am getting the described errors

DavidLazarescu commented 3 years ago

@ArthurSonzogni is there maybe any function which i d need to call to stop rendering at one place?

ArthurSonzogni commented 3 years ago

Yes, this should be the reason. You are calling screen::Loop within another screen::Loop. This is very likely the problem. This isn't supported.

I guess I should make a patch to support it, or detect reentrance and abort with an error.

DavidLazarescu commented 3 years ago

Yes, this should be the reason. You are calling screen::Loop within another screen::Loop. This is very likely the problem. This isn't supported.

I guess I should make a patch to support it, or detect reentrance and abort with an error.

Awesome! Could you give me a guess when you would be able to implement and test this?

Thanks for your help and responses!

ArthurSonzogni commented 3 years ago

I guess next week.

ArthurSonzogni commented 3 years ago

Hi @Creapermann, Could you try if this problem would be fixed when applying patch: https://github.com/ArthurSonzogni/FTXUI/pull/196

Commit: a1de490b8d2b0edb9e73c44958039f7f98a1b256

DavidLazarescu commented 3 years ago

Hi @Creapermann, Could you try if this problem would be fixed when applying patch:

196

Commit: a1de490

It works perfectly fine. Thanks for your help