Project

General

Profile

Bug #6262

[readline] reverse-i-search with multibyte chars

Added by Nobuhiro IMAI almost 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
ruby -v:
ruby 2.0.0dev (2012-04-05 trunk 35241) [x86_64-linux]
Backport:
2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN
[ruby-dev:45493]

Description

=begin
以下のように、C-r にマルチバイト文字を渡すとバイトの切れ端が返ってきます。
IM を介すので、うまく動いてもインクリメンタルサーチにはならないのですが、
履歴が検索できるようになるとありがたいです。

# encoding: UTF-8
require "readline"

RUBY_DESCRIPTION # => "ruby 2.0.0dev (2012-04-05 trunk 35241) [x86_64-linux]"
Readline::VERSION # => "6.2"
IO.pipe do |r, w|
Readline.input = r
(w << "\crあ").reopen(IO::NULL)
Readline.readline # => "\x81\x82"
end

ちなみに、Emacs のバッファ上で xmpfilter を実行すると、

# >> (reverse-i-search)`': \201H\201\202

という raw-text になって、\343 はどっかに行ってしまって、
よく分からないことになっています。参考まで。
=end


Related issues

Related to Ruby trunk - Bug #6601: [readline] Alt-* commands do not work in reverse-i-search Closed 06/17/2012

Associated revisions

Revision 36132
Added by Yui NARUSE over 3 years ago

Add test for [Bug #6262]

Revision 36132
Added by Yui NARUSE over 3 years ago

Add test for [Bug #6262]

History

#1 [ruby-dev:45500] Updated by Yusuke Endoh almost 4 years ago

  • Status changed from Open to Assigned
  • Assignee set to Kouji Takao

#2 [ruby-dev:45766] Updated by Nobuhiro IMAI over 3 years ago

=begin
r36123 でこちらの挙動も直っているように思います。

# encoding: UTF-8
require "readline"

RUBY_DESCRIPTION # => "ruby 2.0.0dev (2012-06-18 trunk 36125) [x86_64-linux]"
Readline::VERSION # => "6.2"
Readline::HISTORY << "あん"
Readline::HISTORY << "いん"
Readline::HISTORY << "うん"
IO.pipe do |r, w|
Readline.input = r
w << "\crん\n\n"
w << "\crあん"
w.reopen(IO::NULL)
2.times do
Readline.readline("", true) # => "うん", "あん"
end
end

問題なさそうなら、クローズしておいていただけるでしょうか。
=end

#3 Updated by Yui NARUSE over 3 years ago

  • Status changed from Assigned to Closed

Also available in: Atom PDF