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

getting bash: _command_offset: command not found - on windows, git bash #44

Open
AMikkels88 opened this issue Aug 1, 2023 · 2 comments

Comments

@AMikkels88
Copy link

hi guys,

i can't seem to get this working on windows, have tried to follow instructions in the readme and especially the FAQ section about windows but finding it pretty confusing.

I've got both files bash_completion.sh and complete_alias.sh in the .bash_completion.d directory, and i'm sourcing them in the specified order in my bash_profile file for git bash:
source ~/.bash_completion.d/bash_completion.sh
source ~/.bash_completion.d/complete_alias.sh

I've also added this to the end of my bash profile, as well as trying to specify the aliases by name:
complete -F _complete_alias "${!BASH_ALIASES[@]}"

Not super clear on what i should be editing or adding to the two repo .sh files above, i tried a few things from the readme adding to both files but nothing seemed to work.

Any help much appreciated

@boop5
Copy link

boop5 commented Mar 7, 2024

+1

@sjerdmann
Copy link

Hi,
I just had the same problem and was able to solve it by using an older version of the script bash_completion.
More precisely, version 2.11 seems to work. (By the way, you'll notice with a simple Ctrl + F that function _command_offset is actually defined in this version of the script, contrary to current version 2.14).

To make things clearer than in the README, run these commands to download scripts bash_completion and complete_alias :

curl https://raw.githubusercontent.com/scop/bash-completion/2.11/bash_completion -o ~/.bash_completion
curl https://raw.githubusercontent.com/cykerway/complete-alias/master/complete_alias -o ~/.complete_alias

Then, add these lines to your ~/.bashrc :

. $HOME/.bash_completion
. $HOME/.complete_alias

followed by your own aliases (complete -F _complete_alias foo).

egelja added a commit to egelja/dotfiles that referenced this issue Aug 28, 2024
Jipok added a commit to Jipok/Cute-bash that referenced this issue Oct 10, 2024
Jipok added a commit to Jipok/Cute-bash that referenced this issue Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants