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

on_enter callback doesn't work #337

Closed
brokensword2018 opened this issue Feb 16, 2022 · 12 comments
Closed

on_enter callback doesn't work #337

brokensword2018 opened this issue Feb 16, 2022 · 12 comments
Assignees

Comments

@brokensword2018
Copy link

Normally, it works well。
in ubuntu, when I use bind command to start my program based on FTXUI. the on_enter callback of input doesn,t work.
like this. add "bind -x '"\C-g":<my_program>" to ~/.bashrc. so I can use 'ctrl+g' to start my program.

@ArthurSonzogni
Copy link
Owner

ArthurSonzogni commented Feb 16, 2022

What are you trying to achieve with bind, and ctrl+g?

@brokensword2018
Copy link
Author

my program based on FTXUI, I use ctrl+g to start my program

@ArthurSonzogni
Copy link
Owner

Could you execute the example:
https://arthursonzogni.com/FTXUI/examples/?file=component/print_key_press
Using your "bind"?

And see what is sent for the "enter" and "space" characters?

@ArthurSonzogni
Copy link
Owner

@brokensword2018 ?

@brokensword2018
Copy link
Author

@brokensword2018 ?

enter is ( 13 ) -> (special)
space is ( 32 ) -> character( )

@ArthurSonzogni
Copy link
Owner

It seems to be working fine.
If you believe this is a bug in FTXUI, could you post a reproducer?

It is probably an issue with you program. I can't really say what, because you haven't posted it.

@brokensword2018
Copy link
Author

@brokensword2018 ?

enter is ( 13 ) -> (special) space is ( 32 ) -> character( )

@brokensword2018
Copy link
Author

brokensword2018 commented Feb 21, 2022

It seems to be working fine. If you believe this is a bug in FTXUI, could you post a reproducer?

It is probably an issue with you program. I can't really say what, because you haven't posted it.

https://github.com/brokensword2018/ftxui-starter you can use this to reproduce the problem .
add
bind -x '"\C-m":the abs path of ftxui-starter'
to ~/.bashrc , then source ~/.bashrc, and press ctrl + m.
use the way to start the program, there no "press enter" in 1.log。
and a strang thing is that press enter will start the program.

@brokensword2018
Copy link
Author

It seems to be working fine. If you believe this is a bug in FTXUI, could you post a reproducer?
It is probably an issue with you program. I can't really say what, because you haven't posted it.

https://github.com/brokensword2018/ftxui-starter you can use this to reproduce the problem . add bind -x '"\C-m":' to ~/.bashrc , then source ~/.bashrc, and press ctrl + m. use the way to start the program, there no "press enter" int 1.log。 and enter will start the program.

os : Ubuntu 20.04.3 LTS

@ArthurSonzogni
Copy link
Owner

Thanks!
I can reproduce.

Instead of sending "10" (New line) when pressing Enter, it sounds like we get "13" (Carriage Return) when going through "bind". I am not sure why bind works this way.

@ArthurSonzogni
Copy link
Owner

I think what I can do, is converting 10/13 code into one of the two. This would make Window / non-Window consistent. This would also make Linux / Linux+Bind consistent.

@ArthurSonzogni ArthurSonzogni self-assigned this Feb 28, 2022
@brokensword2018
Copy link
Author

good job! waitting for you to fix this problem.

ArthurSonzogni added a commit that referenced this issue Mar 3, 2022
This resolves:
#337
ArthurSonzogni added a commit that referenced this issue Mar 3, 2022
This resolves:
#337
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

2 participants