Skip to content

Completing "~" only ever offers one user #4075

Closed

Description

@faho

Since c114cbc, which breaks after a matching user has been found, completing somecommand ~ will only ever offer the first matching user.

E.g. on my system:

  • somecommand ~ completes to somecommand ~root

  • somecommand ~a completes to somecommand ~avahi (even though I also have a user called "alfa")

Note that it also aborts after 200ms, but that part seems okay.

I have confirmed that simply removing the break statements in completer_t::try_complete_user fixes the issue, but I'm not sure that is the right thing to do.

@krader1961?

@zanchey: Since this is a somewhat visible regression, I'd like this to be included in 2.6.0, even if we have to do a second beta.

Activity

  1. added
    bug
    regression
    on May 27, 2017
  2. added this to the fish 2.6.0 milestone on May 27, 2017
  3. zx8 commented on May 27, 2017

    @zx8

    Following on the discussion from #4061:

    zx8: it seems to complete ~_amavisd even if the target directory doesn't exist

    faho: I'm assuming the path is still marked as non-existing (i.e. it's not underlined)

    That's correct, it does appear in red, but only after it's been completed. While this behaviour is consistent with bashs cd completion, it still seems unintuitive/unhelpful to bloat suggestions with a nonexistent directory.

    In bash, the nonexistent directory is identifiable before it's been selected (no trailing /):

    $ cd ~<TAB>
    ~_amavisd
    ~_appleevents/
    ~_appowner/
    ~_appserver/
    
    [...]

    With that said, I don't mind either way. It's not an issue most users are going to experience on a daily basis, but thought it was worth flagging while we're on the subject of ~ completion.

  4. krader1961 commented on May 27, 2017

    @krader1961
    Contributor

    Mea Culpa. I should not have inserted those break statements. I misunderstood the point of the loop. Fix to master and Integration_2.6.0 in a few minutes.

  5. locked as resolved and limited conversation to collaborators on Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugregression

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions