You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Update Reline core to stay in sync with the line_editor's completion_append_character #756
When updating Reline.completion_append_character in Reline.completion_proc, the change does not get reflected until you enter a new Reline.readline or Reline.readmultiline context. It seems like the value of Reline.completion_append_character and Reline.line_editor.completion_append_character is out of sync.
Scenario: We are updating the value of Reline.completion_append_character = ' ' inside of the completion_proc, but it's not reflecting in the line_editor
Expected Behaviour
Being able to change Reline.completion_append_character in the completion proc and have it update the line_editor.
Some configurations are hard to make stay in sync.
For example, this code updates completion_proc itself in completion_proc. It also updates basic_word_break_characters that changes completion target.
This configurations looks stayed in sync in GNU Readline but not in Reline.
However, making completion_proc and basic_word_break_characters stay in sync will significantly impairs code maintainability.
Only changing completion_append_character to be synchronized is not so hard, but I think it is not a good idea to guarantee it to be stay in sync.
In my opinion, it feel like changing completion_append_character inside completion_proc is a hack that only works in the current version of GNU Readline.
In my opinion, it feel like changing completion_append_character inside completion_proc is a hack that only works in the current version of GNU Readline.
What would be a more idiomatic Reline solution? For our use case - the scenario is: Some of our completions require a different value for completion_append_character
It looks like currently GNU Readline and RbReadline support this functionality, but it's not supported by Reline unfortunately without a patch to sync the Readline and line_editor values
As a feature request - if there was a different API to tell Reline about individual append characters as part of the completion_proc result that would be great
I think this is a bug that should be fixed an incompatibility to readline only because GNU Readline documents that rl_completion_append_character can be changed from completion function.
When a single completion alternative matches at the end of the command line, this character is appended to the inserted completion text. The default is a space character (‘ ’). Setting this to the null character (‘\0’) prevents anything being appended automatically. This can be changed in application-specific completion functions to provide the “most sensible word separator character” according to an application-specific command line syntax specification. It is set to the default before any application-specific completion function is called, and may only be changed within such a function.
rl_completion_append_character can only be set from completion function and always reset to default value before completion function is called.
Note that the documented behavior is reported as a bug in Ruby's readline binding and carefully fixed. https://bugs.ruby-lang.org/issues/4635.
I'll second this. As an example, completing file names, I want the append character to be a SPACE if we are currently on a regular file, indicating a complete path, but I want it to be the empty string if we have only completed to a directory, indicating there is more completion to do.
Activity
tompng commentedon Oct 4, 2024
Some configurations are hard to make stay in sync.
For example, this code updates completion_proc itself in completion_proc. It also updates basic_word_break_characters that changes completion target.
This configurations looks stayed in sync in GNU Readline but not in Reline.
However, making completion_proc and basic_word_break_characters stay in sync will significantly impairs code maintainability.
Only changing completion_append_character to be synchronized is not so hard, but I think it is not a good idea to guarantee it to be stay in sync.
In my opinion, it feel like changing completion_append_character inside completion_proc is a hack that only works in the current version of GNU Readline.
sjanusz-r7 commentedon Oct 14, 2024
What would be a more idiomatic Reline solution? For our use case - the scenario is: Some of our completions require a different value for
completion_append_characterIt looks like currently GNU Readline and RbReadline support this functionality, but it's not supported by Reline unfortunately without a patch to sync the Readline and line_editor values
As a feature request - if there was a different API to tell Reline about individual append characters as part of the
completion_procresult that would be greattompng commentedon Oct 14, 2024
I think this is
a bug that should be fixedan incompatibility to readline only because GNU Readline documents that rl_completion_append_character can be changed from completion function.From GNU Readline's documentation https://tiswww.case.edu/php/chet/readline/readline.html#index-rl_005fcompletion_005fappend_005fcharacter
rl_completion_append_character can only be set from completion function and always reset to default value before completion function is called.
Note that the documented behavior is reported as a bug in Ruby's readline binding and carefully fixed. https://bugs.ruby-lang.org/issues/4635.
ddoherty03 commentedon Feb 2, 2025
I'll second this. As an example, completing file names, I want the append character to be a SPACE if we are currently on a regular file, indicating a complete path, but I want it to be the empty string if we have only completed to a directory, indicating there is more completion to do.
adfoster-r7 commentedon May 15, 2026
It would be great to have support for this; I wonder if anything has changed in Reline to help support this capability? 👀