Open donaldguy opened 3 years ago
If I type
ls -l path/subfolder/filen
Then hit tab, it will work fine.
vspipe -a fileName=path/subfolder/filen
Doesn’t trigger the autocomplete.
Another issue - when the autocomplete does work, if I trigger it from the middle of a command while that I’m editing, the cursor ends up a few characters further on from the end of the filename (after selecting the autocomplete file) - rather than at the end of the filename, where I would expect it to be. It’s a minor detail, but it does feel odd.
Describe the solution you'd like if I typed in desk and then tab. it should autocomplete to Desktop
In addition to this, shells like zsh
will handle the case where if you type a subset of the folder and there's no other folder containing that subset, you can use tab autocomplete.
For example, in a home folder you may have
Desktop
Documents
Videos
Music
...
In this example typing cd top<TAB>
should result in autofilling cd Desktop/
, typing cd docu<TAB>
should correct the spelling on the first character, etc. Would love to see this addition to Warp
Hmm, this doesn't look like the same thing I brought up in #1954. That is an issue with the inline autosuggestions (which I understand to be ML generated?) are invalid for the working directory. (If these have the same underlying provider, and just get triggered differently, that's not indicated in the ticket. And it's not part of the ticket acceptance criteria that the paths be correct - a reasonable assumption, but I would have assumed that about the autosuggestions before I encountered that issue.)
I came here to leave a bug report that I have a folder called Downloads and when I type down + TAB
the autocomplete doesn't figure it out. I have to go back and type Down + TAB
which is really annoying.
Hey @jakeonrails Sorry to hear about this, I can't seem to reproduce it on my end, do you have "Open completions as you type" enabled? Is anything else bound to TAB
? Are you using any unsupported completion plugin?
Please see my example below, both with and without "Completions as you type" enabled
(Partially) Extracted from (previous draft) of https://github.com/warpdotdev/warp/issues/16#issuecomment-882120458 :
Currently the tab completion algorithm takes a fairly conservative approach to offering completions for file names. While some commands' (
cd
,ls
,file
,stat
, somewhat surprisinglytar
, … ) completions are configured to assume a file may come at an initial (or any post-flag) position and offer suggestions accordingly, others (mkdir
,vi
- at least with my shell config, …) play it safe and wait to see an explicit--
before any file completions are offered.This is the case even when Tab is proceeded by
./
,../
or/
I suggest there are at least 3 heuristic approaches that might be reasonable:
Assuming paths should follow on:
^\.{0,2}/
or indeed^[./]
– this would catch all explicitly rooted paths (at the cost of ignoring or requiring special handling for the rarely-used DOS-style/?
flag; and having some false positives)^[^-+]
except where there is an explicit expectation of sub-commands for e.g.git
, or stuff likedd
'sk=v
style, etc. This is likely how many commands currently behave-
,--
or+
} style flag(s) followed by a space and not then another-
or+
The logic of 3 would aim so that:
flags/subcommands are always offered on first bare (space-)tab and possibly each subsequent til no suggestion is selected from offered completions
[currently they are not. Generally, for both e.g.
ls
andmkdir
flag completions are offered only after a-Tab
, and (for those likemkdir
) nothing is offered on bareTab
]*That accepting doesn't add a trailing space is perhaps a bug as it stands, because additional Tab seems to be ignored rather than offering additional flags to add to an ~option clump (as does, for example,
/usr/share/zsh/5.8/functions/_ls
/usr/share/zsh/5.8/functions/_mkdir
). As such one is gonna have to type Space-Tab even if one does want more flag suggestions (unless there is some way to multi-select?)If it were the default behavior, however, one would likely still want to suppress for Java/Go-std-lib
-key=val
and POSIX(?)--key=val
style flags