Skip to content

Reline does not support convert-meta #710

Closed

Description

@tompng

When encoding is set to 7bit-encoding or convert-meta is turned on in inputrc, Readline converts byte(>= 128) to ESC + (byte & 0x7f).
Looking into the source code, it looks like Reline is trying to support it, but actually it does not.

We can either support it (if an environment using 8th bit as meta still exist), or clean up unused code.

How to reproduce

Bytes of Japanese letter あ is [227, 129, 130] which will be converted to ESC c ESC \C-a ESC \C-b.
To reproduce, type あ directly from IME or paste あ without using bracketed paste.

# ~/.inputrc
set enable-bracketed-paste off

Readline

LANG="" irb --readline
irb(main):001> Readline::VERSION
=> "8.2" # Make sure readline-ext is installed
# input "foobar\C-aあ"
irb(main):002> Foobar

Reline

LANG="" irb
irb(main):001> Encoding.default_external
=> #<Encoding:US-ASCII>
# input "foobar\C-aあ"
irb(main):002> foobar
# does not respond to keystrokes(except arrow keys)

Activity

  1. tompng commented on Jul 4, 2024

    @tompng
    MemberAuthor

    #715 will remove code from that looks like trying to support convert-meta.
    #723 will let reline work well configuring meta key binding without implementing convert-meta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions