ohmybash / oh-my-bash

A delightful community-driven framework for managing your bash configuration, and an auto-update tool so that makes it easy to keep up with the latest updates from the community.
https://ohmybash.github.io
MIT License
5.54k stars 626 forks source link

oh-my-bash makes autocomplete in taskwarrior go wrong #471

Closed JVAQUEROM closed 9 months ago

JVAQUEROM commented 10 months ago

In normal bash, with taskwarrior, I get autocompletion like:

> task pro:[tab]
myproject otherproject

> task pro:m[tab]
> task pro:myproject

However, with oh-my-bash, I get this

> task pro:[tab]
myproject otherproject

> task pro:m[tab]
> task myproject

So oh-my-bash autocompletion removes the "pro:" part needed by taskwarrior.

curiousgeorgios commented 9 months ago

Also having the same issue here.

uncapped1599 commented 9 months ago

This issue also surfaces on rclone remote path completion.

Before OMB install, tab autocomplete would list remote paths like so

rclone sync dropbox:remote[tab]
rclone sync dropbox:remote/paths

after install I get

rclone sync dropbox:remote[tab]
rclone sync remote/

It seems to be replacing the colon as with others in this ticket

uncapped1599 commented 9 months ago

Just upgraded to latest version and can confirm this issue has been fixed, at least for rclone. Thanks for all the hard work!

JVAQUEROM commented 9 months ago

I just checked and for taskwarrior the problem is still there :cry:

akinomyoga commented 9 months ago

Thanks for the additional information. It might depend on the situation. I cannot actually reproduce the problem in my environment. Could you give us the result of the following command after you see the problem?

$ task pro:m[TAB]  # <-- please attempt the problematic completion
$ task myproject   # <-- confirm that the problem happened. You can discard this line by C-c.
$ complete -p task # <-- Q. In the same session, what is the output of this command?
JVAQUEROM commented 9 months ago

thanks @akinomyoga. I confirm that the problem is persistent.

$ complete -p task # <-- Q. In the same session, what is the output of this command?
complete -o nospace -F _task task

Additional information: in my system, completion did not work out of the box, I had to create this symlink: /usr/share/bash-completion/completions/task -> /usr/share/bash_completion.d/task.sh

akinomyoga commented 9 months ago

Thank you! That means that with Oh My Bash (OMB), a completion setting located in /usr/share/bash_completion.d/task.sh is used. I'm also interested in the working case. You have written that the completion seems to work in the normal Bash (without OMB). What is the result of the following command in the normal Bash?

$ complete -p task
JVAQUEROM commented 9 months ago

I get this:

$ complete -p task
complete -o nospace -F _task task

which is the same as for oh-my-bash...

EDIT: added bash coloring in code block

akinomyoga commented 9 months ago

@JVAQUEROM Can you check if it is fixed in the branch of #480?

JVAQUEROM commented 9 months ago

@akinomyoga It works! Thank you!

akinomyoga commented 9 months ago

Thanks!

epinoia-au commented 9 months ago

Thanks for fixing this :heart: