completion_append_character=

Readline.completion_append_character = char
Class Public methods

Specifies a character to be appended on completion. Nothing will be appended if an empty string (ââ) or nil is specified.

For example:

1
2
3
4
require "readline"
 
Readline.readline("> ", true)
Readline.completion_append_character = " "

Result:

1
2
3
4
5
6
7
8
9
10
>
Input "/var/li".
 
> /var/li
Press TAB key.
 
> /var/lib
Completes "b" and appends " ". So, you can continuously input "/usr".
 
> /var/lib /usr

NOTE: Only one character can be specified. When âstringâ is specified, sets only âsâ that is the first.

1
2
3
4
require "readline"
 
Readline.completion_append_character = "string"
p Readline.completion_append_character # => "s"

Raises NotImplementedError if the using readline library does not support.

Raises SecurityError exception if $SAFE is 4.

doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.