Open ghost opened 5 years ago
Check out my response to #340.
I'm going to re-open this since it is definitely what fish shell does and it would be really nice to have. zsh-histdb doesn't actually solve the problem in the way that fish does. Fish seems to save files/directories that a command references along with the command in the history entry. Then when retrieving a suggestion it skips commands that refer to files/directories that no longer exist.
I don't know how that can be implemented in zsh, but I think it's worth pursuing since it would bring this plugin closer to working just like fish. We may need something added upstream to keep track of which files were referenced by a given history command.
Some more test cases based on my observations with fish:
touch foo
rm foo
rm
Should not suggest rm foo
since it no longer exists.
mkdir -p foo/bar/baz
echo 'foo/bar/baz'
rm -rf foo
echo
Should not suggest echo foo/bar/baz
since it no longer exists.
mkdir -p foo/bar/baz
rm -rf foo
mkdir
Should suggest mkdir -p foo/bar/baz
since at the time mkdir
was run, foo/bar/baz
did not exist.
Another test case:
Should suggest cat {foo,bar}
even though they no longer exist.
touch {foo,bar}
cat {foo,bar}
rm {foo,bar}
cat
@ericfreese is there a news about this FISH-like feature?
Still waiting for this ;)
Autosuggest suggests me files that don't exist in this directory, e.g.
at the
|
point autosuggest is suggesting mefoofile
even though it doesn't exist infoo/bar
.For commands that work on paths I want to only be shown valid paths (from the current directory).
Can I make the suggestions more intelligent to solve this problem?