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

Fix Home and End keys on macOS #521

Closed
wants to merge 2 commits into from

Commits on Mar 18, 2023

  1. Enter and leave keyboard transmit mode

    at the beginning and end of readline (and readmultiline).
    
    This fixes Home and End keys not working on macOS:
    ruby/irb#330
    
    We need to go into keyboard_transmit mode because only then do some
    terminals (including xterm) actually send the sequences they specify in
    terminfo.
    sshock committed Mar 18, 2023
    Configuration menu
    Copy the full SHA
    7228828 View commit details
    Browse the repository at this point in the history

Commits on Mar 19, 2023

  1. Remove unneeded hack

    We already have key bindings for the arrow keys 'kcuu1', 'kcud1', 'kcuf1', and 'kcub1'.
    
    This hack only existed because the arrow keys key bindings weren't
    working (for some terminals) because reline wasn't putting the terminal
    into keypad transmit mode.
    
    The escape sequences for 'cuu', 'cud', 'cuf', and 'cub' are not what the
    terminal sends when arrow keys are pressed.  They are what you send to
    the terminal to tell it to move the cursor.
    
    It just so happens that in some terminals (well xterm at least), the
    escape sequences for 'cuu', 'cud', 'cuf', and 'cub' with the "%p1%d"
    part ommitted from the middle happen to result in the escape sequences
    for the arrow keys in normal mode, but we don't need to rely on this
    anymore.
    sshock committed Mar 19, 2023
    Configuration menu
    Copy the full SHA
    d453a2b View commit details
    Browse the repository at this point in the history