Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable directory completion for \exec command #305

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gsalsero
Copy link

enable directory completion to allow TAB-ing into subdirectories to find configs.

]\exec c <TAB>
    capt.cfg
    cash.cfg
    cfg-maps/oxodm108a_b2.cfg
    cfg-viewcam/viewcam-ne_duel.cfg
    configs/
    cracky.cfg
    
]\exec co <TAB>
]\exec configs/

]\exec configs/ <TAB>
    cpma/
    osp/
    q3plus/

]\exec configs/o <TAB>
]\exec configs/osp/

]\exec configs/osp/ <TAB>
]\exec configs/osp/all.cfg

output4

@ensiform
Copy link
Contributor

Directory completion works fine already for me, if you want it to fill in the contents on tab with more than 1 result, that is not consistent with the rest of completion code and this introduces a specific behavior only for FS related completion.

Do not enter a slash in dedicated server, unnecessary fwiw.

@gsalsero
Copy link
Author

Directory completion works fine already for me, if you want it to fill in the contents on tab with more than 1 result, that is not consistent with the rest of completion code and this introduces a specific behavior only for FS related completion.

Do not enter a slash in dedicated server, unnecessary fwiw.

I haven't been able to get this to work. I tried on Mac/windows/linux dedicated servers and on Mac/windows clients. I created a file baseq3/configs/test.cfg. The contents of that file are simply echo TEST. Then from the dedicated console I type exec co and press tab. The directory name does not complete. Similarly, from the client console I type \exec co and press tab. The directory name does not complete. In both cases, if I manually provide the full path (i.e \exec configs/test.cfg) it does successfully execute it.

I downloaded the latest release for all of them. Curiously though, the dates are different between the OSes. On windows, it reports Oct 26 2024, on linux it reports Nov 11 2024, and on Mac it reports Sep 6 2024

@ensiform
Copy link
Contributor

Are you putting a SPACE after co because if so, that is your issue.

@ensiform
Copy link
Contributor

As for the difference release dates, I think that is due to the fact that runners are borked or the compile date didnt get encoded right? macOS needs new runner images now so it may not have done those.

@gsalsero
Copy link
Author

Are you putting a SPACE after co because if so, that is your issue.

no space after co when I TAB.

Here's what I see on the client when I press tab after only typing c

]\exec c
    capt.cfg
    cash.cfg
    cfg-maps/oxodm108a_b2.cfg
    cfg-viewcam/viewcam-ne_duel.cfg
    cracky.cfg

then I type o, press TAB and nothing happens. Just to confirm it can find the test.cfg, I type the rest of the path to test.cfg and press enter.

]\exec configs/test.cfg
execing configs/test.cfg
TEST
]

The TEST output is from test.cfg. That file has one line: echo TEST.

I ran git pull on the master branch just now and rebuilt to make sure I was using the latest code. I am currently at this hash: 3a5601bdae392233e00394d8249d292fb2c3c51d. Still doesn't work for me. I have no idea why it works for you. Plus I tried on 3 different systems and OSes.

@ensiform
Copy link
Contributor

ensiform commented Nov 24, 2024

As a test, does it change the behavior in vanilla if the configs are in a pk3 with the desired folder structure for you.

Pretty sure it only works for files in pk3s thats the difference I'm seeing.

@ensiform
Copy link
Contributor

Also, fwiw Sys_ListFiles with extension "/" does directories of path. Pretty sure some mods have introduced behavior of listing demos in menus with this and loops, but you cannot recurse infinitely.

@gsalsero
Copy link
Author

As a test, does it change the behavior in vanilla if the configs are in a pk3 with the desired folder structure for you.

Pretty sure it only works for files in pk3s thats the difference I'm seeing.

It does work for files in pk3s.

Also, fwiw Sys_ListFiles with extension "/" does directories of path. Pretty sure some mods have introduced behavior of listing demos in menus with this and loops, but you cannot recurse infinitely.

I noticed that. From what I gather it's the same behavior as passing in an empty/null extension with a wantsubs set to true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants