[PATCH 0/1] MR9854: cmd: Add '/' to delimiters for tab-completion support.
**Improvement:** Since 'cd ../' works in wineconsole, tab completion should too. - This not like **win10 cmd**, because 'cd ../' fails there. Interestingly tab completion for 'cd ../' shows results for actual path and not for the parent folder. It fails only after enter like cd command does for using '/' instead of '\'. - wineconsole behaves more like **PowerShell on win10**, which accepts '/' as delimiter, but it replaces '/' with '\' on completion. **Before:** {width=600 height=380} **After:** {width=600 height=380} -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9854
From: Thomas Csovcsity <thc.fr13nd@gmail.com> Improvement: Since 'cd ../' works in wineconsole, tab completion should too. This not like win10 cmd, because 'cd ../' fails there. Interestingly tab completion for 'cd ../' shows results for actual path and not for the parent folder. It fails only after enter like cd command does for using '/' instead of '\'. wineconsole behaves more like PowerShell on win10, which accepts '/' as delimiter, but it replaces '/' with '\' on completion. --- programs/cmd/wcmdmain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index a47a62424c1..23b4a06f70f 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -36,7 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(cmd); /* Delimiters for tab-completion support */ #define BASE_DELIMS L",=;~!^&()+{}[]" #define PATH_SEPARATION_DELIMS L" " BASE_DELIMS -#define INTRA_PATH_DELIMS L"\\:" BASE_DELIMS +#define INTRA_PATH_DELIMS L"\\:/" BASE_DELIMS typedef struct _SEARCH_CONTEXT { -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9854
testing on Win10, it looks to me that '/' is treated as a separator and not a path element -as your patch does- (and hence displays files from current directory keepind the leading '/') moreover, adding '/' as a path element does work on relative path, but doesn't (generally speaking) on absolute (unix) paths -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9854#note_126397
On Mon Jan 5 16:35:01 2026 +0000, eric pouech wrote: > testing on Win10, it looks to me that '/' is treated as a separator and > not a path element -as your patch does- (and hence displays files from > current directory keepind the leading '/') > moreover, adding '/' as a path element does work on relative path, but > doesn't (generally speaking) on absolute (unix) paths on Win10 **CMD** it behaves like a separator, but in **PowerShell** '/' seems to be interchangable with '\'. PowerShell interchanges '/' with '\' on completion. - [ ] What behaviour should we mimic here? cmd vs PowerShell, because we already do not copy cmd for cd-command with '/', which fails on cmd but not on PowerShell or wineconsole. - [ ] What do you mean with "work on relative path, but doesn't (generally speaking) on absolute (unix) paths". Do i miss something, that should be tested, because it seams working for me. Maybe a side effect, i did not consider. Please give me an example. It is also ok to reject this MR, if the intended behaviour has side effects or is not wanted. I am willing to modify the MR to reach the projects selected goal, but feel free to commit your own solution, if it is faster/easier for you. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9854#note_126409
On Mon Jan 5 16:35:01 2026 +0000, Thomas Csovcsity wrote:
on Win10 **CMD** it behaves like a separator, but in **PowerShell** '/' seems to be interchangable with '\'. PowerShell interchanges '/' with '\' on completion. - [ ] What behaviour should we mimic here? cmd vs PowerShell, because we already do not copy cmd for cd-command with '/', which fails on cmd but not on PowerShell or wineconsole. - [ ] What do you mean with "work on relative path, but doesn't (generally speaking) on absolute (unix) paths". Do i miss something, that should be tested, because it seams working for me. Maybe a side effect, i did not consider. Please give me an example. It is also ok to reject this MR, if the intended behaviour has side effects or is not wanted. I am willing to modify the MR to reach the projects selected goal, but feel free to commit your own solution, if it is faster/easier for you. my point is that '/' should be added to BASE_DELIMS
(absolute unix paths can be converted to a DOS path only if unix "/" path is configured as a DOS drive; it's Z: by default, but can be deleted) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9854#note_126432
On Tue Jan 6 07:54:15 2026 +0000, eric pouech wrote:
my point is that '/' should be added to BASE_DELIMS (absolute unix paths can be converted to a DOS path only if unix "/" path is configured as a DOS drive; it's Z: by default, but can be deleted) Adding '/' to BASE_DELIMS means that '/' is also in PATH_SEPARATION_DELIMS, therefore it does not fix the completion behaviour.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9854#note_126501
On Wed Jan 7 15:46:04 2026 +0000, Thomas Csovcsity wrote:
Adding '/' to BASE_DELIMS means that '/' is also in PATH_SEPARATION_DELIMS, therefore it does not fix the completion behaviour. How should i proceed? Should i try another approach or is this a "works as expected"?
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9854#note_128696
On Tue Feb 3 19:35:08 2026 +0000, Thomas Csovcsity wrote:
How should i proceed? Should i try another approach or is this a "works as expected"? spent a bit more time testing (sigh. on native:
* using` cd /<tab>` uses '/' as a delimiter, and \<tab\> lists files/dir from current directory; builtin doesn't do it, so '/' shall be added to BASE_DELIMS * using `cd "/<tab>` uses '/' also as a delimiter, and \<tab\> lists files/dir from current directory;builtin doesn't recognize the '/' and erases it (bug to be fixed, but will require some more work) so there's no behavior on native where '/' is treated as a path delimiter; that's not even consistent with how builtin commands work regarding options and arguments (check MR!9881 for a bit of background) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9854#note_128954
On Fri Feb 6 14:36:50 2026 +0000, eric pouech wrote:
spent a bit more time testing (sigh. on native: * using` cd /<tab>` uses '/' as a delimiter, and \<tab\> lists files/dir from current directory; builtin doesn't do it, so '/' shall be added to BASE_DELIMS * using `cd "/<tab>` uses '/' also as a delimiter, and \<tab\> lists files/dir from current directory;builtin doesn't recognize the '/' and erases it (bug to be fixed, but will require some more work) so there's no behavior on native where '/' is treated as a path delimiter; that's not even consistent with how builtin commands work regarding options and arguments (check MR!9881 for a bit of background) So we try to stick with the CMD behaviour and not some Powershell things. I am fully okay with that. Closing this MR therefore.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/9854#note_128965
This merge request was closed by Thomas Csovcsity. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9854
participants (3)
-
eric pouech (@epo) -
Thomas Csovcsity -
Thomas Csovcsity (@thc13)