Bug 8371 - tl-config completion depth differs when completing folders and parameters
Summary: tl-config completion depth differs when completing folders and parameters
Status: RESOLVED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Misc (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.19.0
Assignee: Samuel Mannehed
URL:
Keywords: prosaic
Depends on:
Blocks:
 
Reported: 2024-06-19 15:15 CEST by Tobias
Modified: 2025-04-02 08:49 CEST (History)
1 user (show)

See Also:
Acceptance Criteria:
MUST * tl-config must be consistent in how folder depth is expanded in tab completion * tl-config tab completion must not suggest repetitions of what the user has already written


Attachments

Description Tobias cendio 2024-06-19 15:15:34 CEST
For instance with this entry,
> [/vsmagent/level1/level2/level3/level4/level5/level6/level7/level8]
> 
> testvalue=999
in vsmagent.hconf, attempting to tab complete directories with the --all-entries option as in
> $ tl-config --all-entries /vsmagent/lev
won't complete the full unique directory path in one completion. Instead, one has to press tab for all the levels.

Conversely, with no options given we tab complete for parameters, and this completer only returns a maximum of two levels down for some reason. Attempting to tab complete this line
> $ tl-config /vsmagent/lev
yields
> $ tl-config /vsmagent/level1/level2/
> /vsmagent/level1/level2/         /vsmagent/level1/level2/level3/
where the first suggestion is simply a repetition, and one has to assist the completer into the next level (every two levels).

Unsure if tl-session-param exhibits similar problems with similar completers.

Seen with server build #3632 on RHEL9.
Comment 1 Tobias cendio 2024-06-19 15:39:55 CEST
Missed when testing tab completion in bug 7867 probably due to lack of sufficiently deep entries while testing.
Comment 2 Samuel Mannehed cendio 2024-06-25 13:39:05 CEST
It might not be a bug that we only get one folder at a time when completing a unique path with multiple levels. This is how 'ls' behaves when completing folders.
Comment 3 Samuel Mannehed cendio 2024-09-04 14:35:39 CEST
Attachment 1234 [details] on bug 8384 removes a lot of complexity for the --all-entries, I think the correct way forward is to only complete one level at a time.
Comment 5 Samuel Mannehed cendio 2025-04-02 08:49:36 CEST
This has been fixed as of r41664 and r41667 in bug 8384. Both `tl-config -a` (all_entries_completer) and `tl-config` (param_completer) now only expand one folder level at a time when tab-completing.

Incorrect repetitions in tab-completion was also removed.

While there could be an argument for completing as far as possible (if that was the only unique way forward), it doesn't feel natural. If the completer would sometimes suggest only one level, but then sometimes multiple levels, the feeling for the user would be inconsistent.

Looking at `dconf` for example, it behaves like tl-config does now after these changes. Given a dconf folder "/system/locale/" with only a key "region" inside, the tab completion from "/system/" will still require the user to first step to "/system/locale/" and then to "/system/locale/region" in a second step. This feels natural. As mentioned in comment #2, this also matches the behavior of `ls` tab completion.

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