Skip to content

Deduplicate argument history suggestions #4795

@mqudsi

Description

@mqudsi

Currently, argument history iteration is a huge chore because it is extremely naïve as currently implemented and suggests literally every argument in the history that matches the current prefix, regardless if it's already been suggested or not.

Consider the following history items:

cp file1 file2
rm file1
touch file4
touch file1
mv file1 file3
cp file<UP>

The suggestions on repeated <UP> will be file3, file1, file4, file1, and finally file2 (which is what I want). While these arguments are taken from deduplicated history entries, the completion arguments themselves are duplicates of previous suggestions. If I bypassed file1 the first time, there's no reason to suggest it the second time.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions