Feature suggestion: Tab to complete filenames in command mod


I often use the (somewhat hidden) command mode in the find-as-you-type bar that you open with > or ?.

But for it to really be a valuable replacement for opening a command line, it should complete filenames when pressing tab, just like in shell.

At the moment I would need to:

  • select the file by using FAYT
  • clear everything I typed
  • open command mode and enter my command
  • press Ctrl-Enter

I would prefer:

  • open command mode and enter my command
  • start typing the filename
  • press tab to complete

Regards, Kai

Is the aim to run the selected file with some extra arguments?

I'll chime in my support of the request.

Auto-completing filenames (arguments) after a command is quite convenient, esp. when the auto-complete performs the necessary quoting, and supports cycling through the choices upon ambiguity (w/additional Tab presses). Filename auto-complete would be available after entry of a command followed by whitespace (ie. arguments). DOpus doesn't have to make the decision about what a command is - it can assume the first command line argument is a command.

If you want to add filenames as arguments to another command then you can already do that easily by selecting them, opening the command field, then pushing Ctrl-Enter. That will insert them, with appropriate quotes, into the command.

I guess I can see that you might want to do things the other way around, by typing a command and then selecting a file to insert, which you then cannot do by typing the start of the filename (since the FAYT field is in command mode now).

But there are other ways you can send filenames to commnads, or send arguments to (exe) filenames. For example, buttons which use {dlgstring} to prompt you for the command or arguments. So I wanted to understand the scenario in case it's already catered for via a slightly different method to what we're talking about already.

It allows very rapid ad-hoc command line writing.

For example, if I want to run a quick command on some arbitrary directory:

?dir C:\Program Files (x86)\Squeezebox\server\Bin\MSWin32-x86-multi-thread

filename tab auto-completion makes this very fast. Each tab expands to an ambiguous point, whereby a list of possible completions is presented. Add an additional letter, and tab away, and the process repeats. It could (perhaps as an option) cycle through the ambiguous choices, and/or present a list of possible completions and require a disambiguating letter.

I've been using this for more years that I can recall, so when its not there, its a Doh! moment.

I understand and use tab completion, I'm just trying to understand what the OP is doing, in case there's a better way to do it.

In your example, if that folder is below the current folder then you could do things even quicker by selecting the folder in question, then type "?dir " and hit Ctrl-Enter to insert the path.

If the folder in question isn't below the current folder then that won't work, obviously, but I think that's different to what the OP is saying.

They're all valid uses; I just wanted to make sure I understood the OP's scenario, in case there's already a better way to do whatever it is.

One further thought: If you're running stuff via ? rather than > then you're opening a command prompt anyway, so you could get tab completion, for no extra keypresses, by simply binding a hotkey to open a command prompt in the current folder. (The command is already in the Tools menu so it'd just need a hotkey assigning. You could even use the ? key, I guess.)

i.e. With one keypress you can open a full command prompt, instead of Opus's simple FAYT prompt, and that has tab-completion built in.

Understood. Sorry if I hijacked the thread.

To answer your question leo: I don't want to run the file, I want to pass it as a parameter to a program/command.

A typical usecase for me is using jad (Java Decompiler) to decompile a java class. Jad takes the java class filename as single parameter. I don't care about what jad writes to stdout, I just want it to generate a file. So I would like to go to the files folder an type '>jad MyCla' and Tab to complete.

I know that I could select the file beforehand and use Ctrl+Enter, but I like to operate Opus with the keyboard and this would mean switching back to the mouse.

For me the command mode is useful, when opening a command prompt is just too much of a hassle. E.g. when you want to call just one command. Even if I assign a hot key to opening it, I still have to close it again.

One more point: I find using tab-to-complete feels a bit more natural, than Ctrl+Enter. I agree with MrC: everyone used to a command prompt knows tab-to-complete. And speaking of usability: It's easier to guess than Ctrl+Enter :wink: