ArthurSonzogni / FTXUI

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

backspace is not working in some terminal (kmscon) #4

Closed codehz closed 3 years ago

codehz commented 5 years ago

(but working in native linux console)

use examples/utils/print_key_press will print

( 8 ) -> ? )

but ascii 8 is backspace...

ArthurSonzogni commented 5 years ago

Thanks!

Are you sure you typed "BackSpace" and not "Del"?

Maybe this is related to: http://www.macfreek.nl/memory/Backspace_and_Delete_key_reversed

I made the "input" component to accept both the BackSpace and the Delete key. I also fixed a few bugs.

codehz commented 5 years ago

yes, I can confirm that I typed same key in xterm. (ncurses use terminfo for cross-terminal compatiable)

ArthurSonzogni commented 5 years ago

I tried kmscon.

I tried two thing:

terminal_configuration_new.c_cc[VERASE] = "code for backspace"

and

"code for backspace = " = terminal_configuration_old.c_cc[VERASE]

None of them seems to work. I don't know why.

I am using termios in src/ftxui/component/screen_interactive.cpp and the event code for backspace is defined in: src/ftxui/component/screen_interactive.cpp

ArthurSonzogni commented 3 years ago

Closing this old issue. This is a problem for kmscon. I opened: https://github.com/dvdhrm/kmscon/issues/136 but didn't get an answer within 2 years.

ArthurSonzogni commented 1 year ago

I added this patch: https://github.com/ArthurSonzogni/FTXUI/pull/510