autocomplete icon indicating copy to clipboard operation
autocomplete copied to clipboard

Fig mis-handles tabs when it's attempting file completion using touch with a matching dir name

Open jmoses opened this issue 3 years ago • 5 comments

For example:

2022-05-04 at 9 16 AM

You can see that I've entered touch cyp[tab], and that my zsh-history plugin has offered a suggestion, and that fig has also offered directories that match what I have typed, but the top selection in fig is selected (and it's my partial entry). However, my expected behavior here is that hitting tab will complete the existing dirname (cypress), but current fig just beeps and shakes at me, as the "non existent" entry is selected.

Especially if there is only a single match entry to my what I have entered, I would expect fig to behave as a normal shell auto-completion, and fill the dirname.

> fig --version
fig 1.3.1

Reproduction:

mkdir foobar
cd foobar
mkdir foo
touch fo[TAB]

jmoses avatar May 04 '22 13:05 jmoses

Suggesting cyp is an expected behaviour. Some tools like touch allow you to create a "non-existing" file but (in your case for example) when there is a partially matching folder you would have to close the fig popup before inserting touch fig. So for some tools we suggest the currently typed token such that it is possible to type enter or tab directly from fig. See here https://github.com/withfig/autocomplete/pull/852

fedeci avatar May 06 '22 17:05 fedeci

I think my issue would have probably not been a real big thing if I could to the other fig entries (like bash or zsh does for auto-complete). The frustration i had was essentially just continually hitting tab and getting bell'd at with nothing changing. Is that ( while fig pop=up open cycles through the list) an option I've missed maybe?

jmoses avatar May 06 '22 17:05 jmoses

That may depend from your fig keybindings, would you mind sharing them?

fedeci avatar May 06 '22 17:05 fedeci

In theory they should be default? Is there a way to dump my config, like as json or something?

jmoses avatar May 06 '22 17:05 jmoses

Hey @jmoses! You can run fig settings all to list all customization.

mschrage avatar Jul 02 '22 21:07 mschrage