Word boundaries in irb

I am using Terminal on Snow Leopard.

On the command line, if I typed foo.bar.baz.bang.quuz.quux , when I press option-B, it moves the cursor back word by word - it stops in each period, because it counts the period of word boundaries. Similarly, the -F option moves forward word by word.

In irb (0.9.5, ruby ​​1.8.7), the -B and -F options also have this behavior, but this period is no longer considered a word boundary, which makes these shortcuts much less useful.

How can i change this?

EDIT: Curious and curious: on an EC2 instance that has the same versions of irb and ruby, the period is considered as a word boundary.

+5
source share
3 answers

Could this make a difference here?
http://jorgebernal.info/2009/11/18/fixing-snow-leopard-ruby-readline/

In any case, make sure that the -B / F option is actually related to forwarding and the return word in your inputrc files, as John pointed out.

Also, word boundaries are determined by your locale (see the "locale" command), or rather LC_CTYPE (character classification). I don't think the problem is here, but you can check and compare your locale settings just in case.

+1
source

I think this is more related to the Readline module.

Word break characters are subject to change. Run this in IRB and see what characters are used in Readline using:

 Readline.basic_word_break_characters 

Readline is part of the ruby ​​standard library: http://ruby-doc.org/stdlib/libdoc/readline/rdoc/index.html

+3
source

Readline also uses the following configuration files:

  • /etc. / INPUTRC
  • ~ / .inputrc (or the file name specified by the INPUTRC environment variable)

This can lead to different behaviors on different machines (but probably not between ruby ​​versions - I think ruby ​​adds another layer of configuration on top).

+1
source

All Articles