Bug #6262

[readline] reverse-i-search with multibyte chars

Added by Nobuhiro IMAI over 3 years ago. Updated about 3 years ago.

[ruby-dev:45493]
Status:Closed
Priority:Normal
Assignee:Kouji Takao
ruby -v:ruby 2.0.0dev (2012-04-05 trunk 35241) [x86_64-linux] Backport:

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 about 3 years ago

Add test for [Bug #6262]

Revision 36132
Added by Yui NARUSE about 3 years ago

Add test for [Bug #6262]

History

#1 Updated by Yusuke Endoh over 3 years ago

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

#2 Updated by Nobuhiro IMAI about 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 about 3 years ago

  • Status changed from Assigned to Closed

Also available in: Atom PDF