Skip to content

Conversation

@jitingcn
Copy link

@jitingcn jitingcn commented Mar 6, 2022

The default key combinations of many terminal emulators did not match the information in terminfo. To maintain compatibility, the key bindings in the comprehensive list should always be set by default.

This cloud fixes ruby/irb#330 home/end/delete key bindings in some cases.

The default key combinations of many terminal emulators did not match the
information in terminfo. To maintain compatibility, the key bindings in
the comprehensive list should always be set by default.

This cloud fixes ruby/irb#330 home/end/delete key bindings in some cases.
Ref: ruby/irb#330
@sshock
Copy link
Contributor

sshock commented Mar 6, 2022

A combination of #521 to put the terminal in keypad transmit mode and #434 to add a few key bindings that were missing (in particular the delete key), should be enough to fix it so most terminal emulators, including xterm, will work properly again using just terminfo key bindings and not needing the comprehensive lists.

Nevertheless, as near as I can tell this fix can only help not hurt, so I am totally in favor of merging this PR as well.

@dirkjonker
Copy link

dirkjonker commented Apr 1, 2022

Can confirm that this fixes the following issue I have with the delete key:

  • it inputs ^[[3~ instead of deleting a character

My situation:

  • I'm on macOS 12.2.1
  • with an external keyboard (Logitech MX keys)
  • issue occurs with both the default Terminal.app and with Kitty terminal

@nobu
Copy link
Member

nobu commented Sep 1, 2022

Could you add tests?

@sshock
Copy link
Contributor

sshock commented Oct 24, 2022

I added some pretty comprehensive tests in my PR (#434), so once that is merged we could probably go ahead with this one too. At most all we would need to do for tests is copy some of the asserts from my test_ansi_without_terminfo.rb into test_ansi_with_terminfo.rb, since those bindings will now exist even when terminfo is enabled.

@sshock
Copy link
Contributor

sshock commented Jul 11, 2023

Reminder to probably close this out if we move forward with #567.

@jitingcn jitingcn closed this Jul 11, 2023
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 this pull request may close these issues.

In macOS, home and end keys no longer work

4 participants