todotxt / todo.txt-cli

☑️ A simple and extensible shell script for managing your todo.txt file.
http://todotxt.org
GNU General Public License v3.0
5.58k stars 714 forks source link

Contexts not expanding #255

Open stueja opened 6 years ago

stueja commented 6 years ago

Do you want to request a feature or report a bug? A bug.

What is the current behavior? Entering "@" and hitting "tab" does not expand the contexts.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Enter t add +project @ and hit tab.

What is the expected behavior? Like with +, see a list of contexts.

Which versions todo.sh are you using?

Run todo.sh -V DEV_VERSION

Which Operating System are you using? Arch Linux

Which version of bash are you using?

Run bash --version 4.4.23

Note: I sent this to the mailing list, no answer so far.

pabgan commented 6 years ago

I guess you did, but just in case: Have you added complete -F _todo t to todo_completion file in todo-txt directory?

stueja commented 6 years ago

Hey @pabgan , yes, I have. Everything else is expanding properly. Only the contexts are not.

inkarkat commented 6 years ago

That's strange; if +project completion is working, @context should, too. Do you actually have contexts in your todo.txt; do you get output from

todo.sh command listcon
stueja commented 6 years ago

Yes, I do have contexts, and todo.sh command listcon outputs them.

More interestingly, either I made a mistake in my original post, or it now partly works: todo.sh add @<tab> outputs, indeed the list of contexts. E. g.:

[stueja@host ~]$ todo.sh add @
@daily       @calendar    @linux       @monthly     @online

However, expansion does not work: todo.sh add @lin<tab> will not expand to @linux. Whereas todo.sh add +pro<tab> will well expand to +project

sjdennis commented 6 years ago

I am seeing command expansion working, but neither projects nor contexts working. For instance: t li expands to t list. But t add +ca will not expand to +camp, nor will @ca expand.

t listproj and t listcon both work as expected, returning lists of projects and contexts in todo.txt.

Using version 2.11.0 on Ubuntu 16.04 GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)

l00kanio commented 6 years ago

I had the same issue as @stueja wrote. Check if there is 'shopt -s hostname' in your .bashrc file. If yes => comment it out and have fully functional autocompletion with todotxt :-)

sjdennis commented 6 years ago

I have no such line in my .bashrc unfortunately, so that doesn't help in my case. Thanks for the suggestion though!