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

Backspace does not work #52

Open
benaryorg opened this issue Oct 4, 2015 · 9 comments
Open

Backspace does not work #52

benaryorg opened this issue Oct 4, 2015 · 9 comments

Comments

@benaryorg
Copy link
Contributor

I tried to react to a Key::Backspace in my program but I did not receive it, so I displayed the event that occurred and it was read as a KeyEvent(Ctrl('h')).

I don't know if rustbox or the underlying libraries are the problem but I will investigate further.

@benaryorg
Copy link
Contributor Author

Tested using:

  • desktop
    • enlightenment (X)
    • qtile (X)
    • X
    • none (tty) Backspace works here
  • terminal
    • terminology
    • xterm

@droundy
Copy link

droundy commented Oct 4, 2015

Control h is backspace in ASCII, so perhaps a translation is in order?

On Sun, Oct 4, 2015, 5:36 AM Katze [email protected] wrote:

Tested using:

  • desktop
    • enlightenment
    • none (tty) Backspace works here
  • terminal
    • terminology
    • xterm


Reply to this email directly or view it on GitHub
#52 (comment).

@benaryorg
Copy link
Contributor Author

So if I just do it like I did in this Gist everything is fine?

@gchp
Copy link
Owner

gchp commented Oct 13, 2015

Interesting. What is the value of your $TERM environment variable?

@benaryorg
Copy link
Contributor Author

echo $TERM

prints xterm.

@gchp
Copy link
Owner

gchp commented Oct 27, 2015

Hmm. I've tried running this in a few different ways, and I always get the same result which is that Ctrl-h and backspace are different keys.

Can you give some more information on your environment, and what you are running to get this happening? Is the example in the gist above what you are using to re-produce this?

Sorry for the inconvenience!

@benaryorg
Copy link
Contributor Author

The gist above is exactly what I used to test with.

I just made a new gist containing my current test program.
It uses rustbox 0.7.2.

If I now run this and press the Backspace-key it prints Ctrl('h') instead of Key::Backspace.

It only behaves so when I run it under X (window manager, terminal and so on do not seem to matter at all).
When I use it on a tty, everything runs fine.

I am running:

  • Gentoo GNU/Linux
    • kernel: 4.2.3-gentoo
  • bash 4.3.42(1)-release
  • X.Org X Server 1.17.2

Edit: if you need any more detailed information about e.g. compile options of these programs, just tell me.

@jmacdonald
Copy link
Contributor

@benaryorg just a head's up: I ran into the same issue with xterm on Arch Linux. Installing xfce4-terminal resolved the issue (it has more robust backspace handling). I also noticed that Vim has a :fixdel command to work around this sort of thing.

I'm willing to bet termbox itself exhibits this bug, although I've not yet tested it. Might be out of scope for Rustbox to fix issues with older terminals like these?

@benaryorg
Copy link
Contributor Author

benaryorg commented Sep 30, 2016

If your delete key terminal code is wrong, but the
code for backspace is alright, you can put this in
your .vimrc:
:fixdel

I did read the whole entry of fixdel but it does seem to fix Delete and not Backspace at least from what I understood.

Furthermore the terminal I've used first (terminology) is part of the Enlightenment project which is being actively supported, to my knowledge. At least enlightenment itself keeps having releases, as do the underlying libraries efl and elementary which are also used by terminology.

Edit: But shouldn't at least xterm be supported as it is the reference terminal emulator just about everywhere.

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

4 participants