Skip to content

Missing directory error when adding Fish completions #1779

@yhoiseth

Description

@yhoiseth

Thanks for making Rust 😄

This is my first time trying it, and I discovered a tiny issue that might trip some people up.

Problem

When running the documented command to enable tab completions for Fish on macOS, I get:

An error occurred while redirecting file '/Users/yngve/.config/fish/completions/rustup.fish'
open: No such file or directory

Steps

  1. brew install rustup-init
  2. rustup-init
  3. Add source $HOME/.cargo/env to ~/.config/fish/config.fish
  4. rustup completions fish > ~/.config/fish/completions/rustup.fish

Possible Solution(s)

I fixed the issue by navigating into ~/.config/fish and then creating the completions directory:

➜  ~ cd .config/fish/
➜  fish mkdir completions

Then, I ran rustup completions fish > ~/.config/fish/completions/rustup.fish without problems.

My guess is that this problem is quite rare as most people using Fish have probably added the completions directory already. There are probably more elegant solutions, but I suggest adding a mkdir command to the documentation. I'll create a pull request to show what I mean.

Notes

Output of rustup --version:

rustup 1.17.0 ( )

Output of rustup show:

Default host: x86_64-apple-darwin

stable-x86_64-apple-darwin (default)
rustc 1.34.0 (91856ed52 2019-04-10)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions