Bug 8354 - Completing from commands containing special characters isn't possible
Summary: Completing from commands containing special characters isn't possible
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Misc (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: MediumPrio
Assignee: Bugzilla mail exporter
Depends on:
Reported: 2024-05-29 11:35 CEST by Samuel Mannehed
Modified: 2024-07-12 11:02 CEST (History)
1 user (show)

See Also:
Acceptance Criteria:


Description Samuel Mannehed cendio 2024-05-29 11:35:15 CEST
As part of bug 7867 we disabled completions when the commandline contains any of the characters in COMP_WORDBREAKS. The most common ones of these characters are '=' and ':'.

This means it isn't possible to complete on the following command:

 tl-config --eval VAR=/vsmagent/age<TAB>

Our completion code currently detects the equal sign and then stops further completions.
Comment 3 Samuel Mannehed cendio 2024-06-04 14:10:15 CEST
Note that paths can contain these special characters, meaning this limitation applies when trying to tab complete such paths too.

Also note that all subsequent tab completions are disabled on a command line containing these characters, not only the current sub command or option is affected.
Comment 4 Alexander Zeijlon cendio 2024-06-04 15:35:06 CEST
It might be worth looking further into how the bash-completion package handles special characters.

At least for the equals sign, there is special handling for it when calling the bash-completion-function _init_completion() with the s-option which triggers splitting for long options on the format "--option=argument".

As far as I have seen, there is no special handling for other characters in COMP_WORDBREAKS, but you are free to add any characters you want with the n-option. 

(_init_completion can be found in /usr/share/bash-completion/bash_completion)

See also Bug 7867 comment 63.
See also https://github.com/scop/bash-completion/blob/main/README.md
Comment 5 Samuel Mannehed cendio 2024-06-12 15:25:57 CEST
Examples of options that require '=' to complete properly are:

* tl-config --eval
* tl-session-param --eval

These two options lack a completer function as of r40972.

Note You need to log in before you can comment on or make changes to this bug.