Skip to content

Completing "~" does not offer "~/" #4074

Open

Description

@faho

As mentioned in #4061, completing somecommand ~ does not offer the obvious ~/ (i.e. the current user's home directory).

I don't think it ever did, which is why I'm filing this as an enhancement.

Also, since these are directories, it might be better to complete all of these with a trailing "/" (like we do for directories in general), since there's no valid suffix otherwise (though tilde-expansion passes through the literal if it doesn't expand - e.g. ~nonexistentuser expands to ~nonexistentuser).

Activity

  1. added this to the fish-future milestone on May 27, 2017
  2. gechr commented on Jun 3, 2017

    @gechr
    Contributor

    Thinking about this, I'm really not convinced ~/ should be offered as a completion at all.

    Every time I have ever used ~<TAB>, it's specifically because I want to complete another user's directory, never because I want to complete my own. If I did, I would just manually type ~/ (which I assume is muscle memory for the vast majority of shell users).

    It's also fewer keystrokes than typing ~<TAB> and then finding ~/ in a list of suggestions. Besides, my own user directory is still offered in its expanded form in the list of suggestions if I really wanted to ~<TAB> complete it for some strange reason.

    it might be better to complete all of these with a trailing "/" (like we do for directories in general)

    I agree with this – it would also solve the "nonexistent directory" issue described in #4075 (comment) (i.e. don't append a / if the directory doesn't exist).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions