Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: change bash completions to user directory #3654

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,12 @@ See `poetry help completions` for full details, but the gist is as simple as usi


```bash
# Bash
# Bash (single user)
BASH_COMPLETION_USER_DIR=${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions
mkdir -p ${BASH_COMPLETION_USER_DIR}
poetry completions bash > ${BASH_COMPLETION_USER_DIR}/poetry

# Bash (all users)
poetry completions bash > /etc/bash_completion.d/poetry.bash-completion

# Bash (Homebrew)
Expand All @@ -199,6 +204,16 @@ poetry completions zsh > ~/.zprezto/modules/completion/external/src/_poetry

```

The commands above create static completions that need to be manually updated when
Poetry is updated. Alternatively, you can dynamically create the completions each time
you open a terminal. However, this doesn't happen instantly, so it will add some
delay before the terminal is ready.

```
# Bash
echo '. <(poetry completions bash)' >> ~/.bashrc
```

!!! note

You may need to restart your shell in order for the changes to take effect.
Expand Down