From: Yui NARUSE Date: 2011-04-29T23:34:38+09:00 Subject: [ruby-dev:43457] [Ruby 1.9 - Feature #4635][Assigned] Readline.completion_append_character Issue #4635 has been updated by Yui NARUSE. Category set to ext Status changed from Open to Assigned Assignee set to Kouji Takao ---------------------------------------- Feature #4635: Readline.completion_append_character http://redmine.ruby-lang.org/issues/4635 Author: Nobuhiro IMAI Status: Assigned Priority: Normal Assignee: Kouji Takao Category: ext Target version: いまいです。 GNU readline library での話ですが、6 系のものを使うと TAB キーでの補完 後に Readline.completion_append_character がデフォルトの " " に戻ってし まいます。しかも、" " 以外にセットしても、補完された単語にはデフォルト の " " が付加されます。 require "readline" p RUBY_DESCRIPTION p Readline::VERSION p Readline.completion_append_character Readline.completion_proc = ->(input){[input]} IO.pipe do |r, w| Readline.output = (w << "Readline\t").reopen("/dev/null") Readline.input = r Readline.completion_append_character = nil p Readline.completion_append_character p Readline.readline p Readline.completion_append_character end Debian GNU/Linux (sid) libreadline-gplv2-dev (5.2-8) # >> "ruby 1.9.3dev (2011-04-29 trunk 31382) [x86_64-linux]" # >> "5.2" # >> " " # >> nil # >> "Readline" # >> nil Debian GNU/Linux (sid) libreadline6-dev (6.2-1) # >> "ruby 1.9.3dev (2011-04-29 trunk 31382) [x86_64-linux]" # >> "6.2" # >> " " # >> nil (nil にセットは出来るけど) # >> "Readline " (末尾にスペースが付いてしまって) # >> " " (リセットされてしまう) changelog に以下のように書いてあって、補完後にリセットされるのは意図的 なようです。Ruby の readline 側で何とかならないものでしょうか? This document details the changes between this version, readline-6.0, and the previous version, readline-5.2. (snip) f. Fixed a bug that caused the completion append character to not be reset to the default after an application-specified completion function changed it. -- Nobuhiro IMAI Key fingerprint = E57F 2482 4074 13BC 3B9A 165B C689 5B16 A620 4657 -- http://redmine.ruby-lang.org