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

[TW-1403] fish shell: no option "modify" after task selection #1430

Closed
taskwarrior opened this issue Feb 14, 2018 · 27 comments
Closed

[TW-1403] fish shell: no option "modify" after task selection #1430

taskwarrior opened this issue Feb 14, 2018 · 27 comments
Labels
type:bug Something isn't working
Milestone

Comments

@taskwarrior
Copy link

Roman Inflianskas on 2014-08-28T08:49:30Z says:

I type in fish shell:

task 1 m<TAB>

and there is no completion. It should be "modify" completion.

@taskwarrior taskwarrior added this to the 2.4.0 milestone Feb 14, 2018
@taskwarrior taskwarrior added type:bug Something isn't working fixed labels Feb 14, 2018
@taskwarrior
Copy link
Author

Migrated metadata:

Created: 2014-08-28T08:49:30Z
Modified: 2014-09-06T19:38:17Z

@taskwarrior
Copy link
Author

Roman Inflianskas on 2014-08-30T12:15:01Z says:

done is not autocompleted also.

@taskwarrior
Copy link
Author

Paul Beckingham on 2014-08-30T15:26:31Z says:

Looking at the fish shell completion script, I see why it doesn't work - it makes almost no use of the built-in helper commands that taskwarrior implements to assist scripts like this.

What we really need is a developer who uses fish to help us out.

@taskwarrior
Copy link
Author

Roman Inflianskas on 2014-08-30T15:34:08Z says:

Well, I'm the developer (see my autocompletions for salt: saltstack/salt#15310).

Can you give me access to make pull requests (or how is it called in Atlassian products)? I've fixed this already.

@taskwarrior
Copy link
Author

Paul Beckingham on 2014-08-30T15:58:49Z says:

[1] Get the code and switch to the dev branch:

$ git clone https://git.tasktools.org/scm/tm/task.git
$ git checkout 2.4.0

[2] Upload patch here.

Note that there are several helper commands, to aid completion scripts:

$ task help | grep ' _'
       task          _aliases              Generates a list of all aliases, for
       task          _columns              Displays only a list of supported
       task          _commands             Generates a list of all commands, for
       task          _config               Lists all supported configuration
       task          _get <DOM> [<DOM>     DOM Accessor
       task <filter> _ids                  Shows the IDs of matching tasks, in
       task <filter> _projects             Shows only a list of all project
       task          _show                 Shows all configuration settings in a
       task <filter> _tags                 Shows only a list of all tags used,
       task          _udas                 Shows the defined UDAs for completion
       task <filter> _urgency              Displays the urgency measure of a
       task <filter> _uuids                Shows the UUIDs of matching tasks, as
       task          _version              Shows only the taskwarrior version
       task          _zshcommands          Generates a list of all commands, for
       task <filter> _zshids               Shows the IDs and descriptions of
       task <filter> _zshuuids             Shows the UUIDs and descriptions of

@taskwarrior
Copy link
Author

Paul Beckingham on 2014-08-30T16:00:38Z says:

I forgot to add: Thank you for helping!

@taskwarrior
Copy link
Author

Roman Inflianskas on 2014-08-30T16:03:50Z says:

I knew about patches. I thought that JIRA supports GitHub style workflow, argh! OK, will send.

@taskwarrior
Copy link
Author

Paul Beckingham on 2014-08-30T16:10:43Z says:

Yes, Atlassian Stash does support github like workflow. We just keep it mostly locked up. Sorry for the inconvenience.

@taskwarrior
Copy link
Author

Roman Inflianskas on 2014-08-31T21:12:02Z says:

Today I've improved completion for fish. It works much better, than the previous one, in my opinion.

I've changed it so much, that only the license and 10 lines remained from the previous version. It would be easier to write it from scratch, but who knew?

I saved copyright of the previous author and appended mine. Is it the right solution?

So I'm uploading a new version: https://dpaste.de/onx8

@taskwarrior
Copy link
Author

Paul Beckingham on 2014-08-31T21:17:55Z says:

It appears you rewrote the whole thing, which means you should replace the existing copyright, as the original author's contribution is no longer involved.

This looks really nice, thank you for doing this. I'll apply the now, and if you update the copyright or anything else, please let me know, and i'll update it further.

@taskwarrior
Copy link
Author

Roman Inflianskas on 2014-08-31T21:22:14Z says:

OK, I removed previous copyright: https://dpaste.de/eqCA

@taskwarrior
Copy link
Author

Roman Inflianskas on 2014-08-31T21:24:06Z says:

But all those bugs I filled (except this one) are still actual. If you fix them, completion will be even better (but actually, they are not very principal).

@taskwarrior
Copy link
Author

Paul Beckingham on 2014-08-31T21:25:37Z says:

Understood. Thanks.

@taskwarrior
Copy link
Author

Roman Inflianskas on 2014-08-31T21:26:16Z says:

I can prepare a screencast (like I did in saltstack/salt#15310). Do you need it? Will you put it into blogs/documentation?

@taskwarrior
Copy link
Author

Paul Beckingham on 2014-08-31T21:27:08Z says:

Thanks Roman! Good work.

@taskwarrior
Copy link
Author

Paul Beckingham on 2014-08-31T21:27:38Z says:

Yes, I would put that up on the site.

@taskwarrior
Copy link
Author

Roman Inflianskas on 2014-08-31T21:34:41Z says:

OK, I'll do it. But it's late now, I'll do it tomorrow.

task add project:programming due:today prepare screen cast for taskwarrior completions

Thank you for the best (especially now, after creation of the taskd) task manager!

@taskwarrior
Copy link
Author

Paul Beckingham on 2014-08-31T22:01:57Z says:

Thank you for getting involved and improving it further!

@taskwarrior
Copy link
Author

Roman Inflianskas on 2014-09-02T18:19:53Z says:

Well, I found bug: deleted or done tasks in a current shell session are still displayed in completion list. To fix this I need to wait fixing the fish shell (fish-shell/fish-shell#1660) or remove descriptions from the IDs completions (that makes them useless).

Actual version is this: https://dpaste.de/fuTO

Changes: added task completions (by description), refactoring, fixed small bugs.

PS: This bug will be very obvious on a screen cast, so I will do it after fixing this issue.

@taskwarrior
Copy link
Author

Roman Inflianskas on 2014-09-05T17:56:27Z says:

Well I fixed all issues

Changes: added some functionality (help for depends attribute, completion for attribute values after modify and other commands), fixed bugs, cleaned the code.

Actual version: https://dpaste.de/OqJS

Screencast: http://i.imgur.com/T8GYZjD.gif

@taskwarrior
Copy link
Author

Paul Beckingham on 2014-09-06T16:32:46Z says:

Script updated. Screencast gif on site. Thanks!

@taskwarrior
Copy link
Author

Roman Inflianskas on 2014-09-06T16:48:42Z says:

Wow! My name is just on the center of the taskwarrior site. Cool, thank you!

PS: Forgot to show projects completion and fuzzy completion (thanks to fish, it's doing this automatically and quite intelligently, so that you will not notice false completions). It's especially useful for working with a long project names. My first bug report was just about it: https://bug.tasktools.org/browse/TW-1277. Well, nevermind.

@taskwarrior
Copy link
Author

Paul Beckingham on 2014-09-06T18:29:21Z says:

Note that I removed whitespace at EOL and tabs.

@taskwarrior
Copy link
Author

Roman Inflianskas on 2014-09-06T19:03:09Z says:

It's good that you said me about this. You accidentally broken completion by replacing tabs inside "cut" arguments (zsh separates descriptions by ":", fish uses "\t", so I've used cut (cut don't understand '\t') and sed with tabs).

I intentionally use tabs in my code (I agree with the most voted answer to this question: http://programmers.stackexchange.com/questions/57/tabs-versus-spaces-what-is-the-proper-indentation-character-for-everything-in-e). But I don't want to start holy war here, 2 spaces agrees with the fish coding convention, so let it be.

I fixed completions and added config completion.

Here it is: https://dpaste.de/59jp/raw

PS: I just read interesting article about copyright: http://opensource.com/law/14/2/copyright-statements-source-files. I think that really my copyright is not necessary, especially because you placed my email and name into the commit author. I've chosen MIT License either, it's the same as the core, so I would remove it either. It's just 20 useless lines for me.

@taskwarrior
Copy link
Author

Roman Inflianskas on 2014-09-06T19:13:54Z says:

Fine, thank you.

@taskwarrior
Copy link
Author

Paul Beckingham on 2014-09-06T19:16:29Z says:

Change applied, thank you, and sorry for breaking it by removing too many tabs. I won't do any more search/replace on the script.

As for tabs, we don't use them, and use 2 spaces instead. The reason for using 2 spaces is essentially arbitrary. The reason for spaces over tabs is so that source can be aligned, and that breaks with different tab settings. For example, from the code:

  std::stringstream out;
  out << "\n"
      << bold.colorize (PACKAGE_STRING)
      << "\n";

The copyright is your choice, it can stay or go, and I'll leave that to you to decide. The license must remain though, as it needs to be clear for every standard and optional component of Taskwarrior.

@taskwarrior
Copy link
Author

Roman Inflianskas on 2014-09-06T19:38:17Z says:

Your are right, in this situation I would use spaces either. My general rule is "Indent with tabs, align with spaces". It's described in a good details in http://vim.wikia.com/wiki/Indent_with_tabs,_align_with_spaces#Spaces_or_tabs.3F

OK, I'll change copyright with next changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant