I built my ruby like so:
brew install readline
rvm install ruby-1.9.2-head -C --with-readline-dir=/usr/local/Cellar/readline/6.2.1/
When I do tab completion it appends a space after everything. I found in the docs that there's a variable called completion_append_character. It's set to a space. If I set it to nil or any other character it still appends a space. How do I get it to stop appending a space after a completion?
I just ran into this issue myself, and I figure a late answer is better than no answer. After doing some research, this is a bug in Ruby or Readline itself, and seems to be present in every revision of Ruby I could find, which makes me think it's Readline. I was able to solve the problem with a
gem install rb-readline
and then
require 'rb-readline'
in my script. Rb-readline (Ruby Readline) is a drop-in replacement, pure Ruby implementation of Readline and does not rely on the C extension, and the Readline.completion_append_character variable is functional.
This Problem is solved in the last version of Ruby 1.9.3-p125 as you can see in Changelog:
Wed Feb 8 10:34:59 2012 TAKAO Kouji
- ext/readline/readline.c (readline_attempted_completion_function): in Readline module with GNU Readline 6 case, Readline module resets completion_append_character to " ", after it executes completion. So, Readline module stores completion_append_character, and Readline module always sets it after Readline module executes completion. [ruby-dev:43456] [Feature #4635]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With