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

poetry.bash-completion (brew) calls not-existing function "__ltrim_colon_completions" #3418

Closed
jamilraichouni opened this issue Nov 25, 2020 · 4 comments · Fixed by python-poetry/cleo#247
Labels
area/cli Related to the command line kind/bug Something isn't working as expected

Comments

@jamilraichouni
Copy link

  • [ x] I am on the latest Poetry version.
  • [ x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [ x] If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: macOS Big Sur 11.0.1
  • Poetry version: 1.1.4

Issue

Hi, after

poetry completions bash > $(brew --prefix)/etc/bash_completion.d/poetry.bash-completion
source /usr/local/etc/bash_completion.d/poetry.bash-completion

and a restart of a shell I get

poetry shbash: __ltrim_colon_completions: command not found

when typing poetry sh and pressing the tab key for completion.

I looked into the file poetry.bash-completion and the code (lines 123 and 133) tries to call the not existing function __ltrim_colon_completions.

Thanks,
Jamil

@jamilraichouni jamilraichouni added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Nov 25, 2020
@mforbes
Copy link

mforbes commented Dec 18, 2020

I think if you install bash-completion using MacPorts, then this will work, but it would be better if poetry did not require this. Also, it seems like the file should be called poetry.bash not poetry.bash-completion. The following worked for me:

port install bash-completion
sudo echo /opt/local/bin/bash >> /etc/shells
chsh -s /opt/local/bin/bash
mkdir -p ~/.local/share/bash-completion/completions
poetry completions bash > ~/.local/share/bash-completion/completions/poetry.bash

Then I added something like this to my .bashrc file:

if [ -f /opt/local/etc/profile.d/bash_completion.sh ]; then
  . /opt/local/etc/profile.d/bash_completion.sh
fi

I would still advocate for providing a graceful fallback so poetry works without fail using the system shell.

@jybaek
Copy link

jybaek commented Feb 2, 2021

Hope it helps.

brew install bash-completion
source $(brew --prefix)/etc/bash_completion

@Secrus Secrus added area/cli Related to the command line Dependency and removed status/triage This issue needs to be triaged labels May 24, 2022
@LordFckHelmchen
Copy link

Same happened for me on Windows 10 with Git Bash for Windows setup.

Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/cli Related to the command line kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants