poetry icon indicating copy to clipboard operation
poetry copied to clipboard

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

Open jamilraichouni opened this issue 5 years ago • 3 comments

  • [ 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 avatar Nov 25 '20 16:11 jamilraichouni

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.

mforbes avatar Dec 18 '20 06:12 mforbes

Hope it helps.

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

jybaek avatar Feb 02 '21 00:02 jybaek

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

LordFckHelmchen avatar Aug 04 '22 14:08 LordFckHelmchen

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[bot] avatar Mar 01 '24 13:03 github-actions[bot]