Skip to content

Conversation

@snnwolf
Copy link
Contributor

@snnwolf snnwolf commented Jun 7, 2020

fix: autocompletion won't work with zsh 5.8

fix: autocompletion won't work with zsh 5.8
@jmaupetit
Copy link
Contributor

I'm using zsh 5.8 and it seems to work pretty well. Can you point me to the BC you are describing?

@snnwolf
Copy link
Contributor Author

snnwolf commented Jun 8, 2020

I'm working on Archlinux with installed packages.
_watson file without modify not loading

local/zsh 5.8-1
A very advanced and programmable command interpreter (shell) for UNIX
local/zsh-completions 0.32.0-1
Additional completion definitions for Zsh

@jmaupetit
Copy link
Contributor

That's unfortunate. I need to test your changes locally but I've no idea of the impact of those.

@snnwolf
Copy link
Contributor Author

snnwolf commented Jun 9, 2020

Maybe archlinux in docker?

@joelostblom
Copy link
Contributor

I noticed problems with completion too, but didn't have time to investigate so I just copied the autocompetion function and appended it to my .zshrc and this works as a temporary workaround.

@sadid
Copy link

sadid commented Oct 23, 2020

I also couldn't make autocompletion work with zsh/Archlinux:

Watson, version 1.10.0
zsh 5.8-1 (x86_64-pc-linux-gnu)

I copied the provided watson.zsh-completion in watson root directory to /usr/share/zsh/site-functions/_watson. This is different than Document which might not work for arch linux. However, I tested /usr/local/share/zsh/site-functions/_watson as well by creating the zsh folder without success.

I also perform the compinit and load it beforehand.

However, using the changes mentioned here, I can verify it now can work with the updated version.

Copy link

@sadid sadid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have applied the changes on my archbox into /usr/share/zsh/site-functions/_watson and now zsh completion works.

@jugendhacker
Copy link

For me even with this PR applied zsh completion does not work...

@jmaupetit
Copy link
Contributor

Works like a charm from here. Can you please fill the CHANGELOG and rebase your branch @snnwolf? I'll merge this.

@jmaupetit
Copy link
Contributor

For me even with this PR applied zsh completion does not work...

@jugendhacker how did you integrate this completion file in your zsh configuration?

@jugendhacker
Copy link

For me even with this PR applied zsh completion does not work...

@jugendhacker how did you integrate this completion file in your zsh configuration?

I have a _watson file in /usr/share/zsh/site-functions containing the exact same content of this PR....

@jmaupetit
Copy link
Contributor

Which zsh version are you running?

@jugendhacker
Copy link

It tells me zsh 5.8 (x86_64-pc-linux-gnu)

@jmaupetit
Copy link
Contributor

  1. Are you using oh-my-zsh?
  2. Have you tried to reset the completion cache [1]?

[1] https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#how-do-i-reset-the-completion-cache

@jugendhacker
Copy link

1. Are you using oh-my-zsh?

2. Have you tried to reset the completion cache [1]?

[1] https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#how-do-i-reset-the-completion-cache

Yeah I use oh-my-zsh und yes I tried resetting the cache, but it did not help

@jmaupetit
Copy link
Contributor

I also use OMZ 😉

To make it work I've:

  1. copied this PR completion file in ~/.oh-my-zsh/custom/plugins/watson/_watson
  2. added the watson plugin to my ~/.zshrc
plugins=(
  # [...]
  watson
)
  1. reloaded my configuration: source ~/.zshrc

Please, tell me that it works on your machine ™️

@jugendhacker
Copy link

@jmaupetit okay so this did indeed work.... but it's not a very good solution because it's make it impossible for packagers to apply the completion with a package....

@jmaupetit
Copy link
Contributor

jmaupetit commented Jan 6, 2021

@jmaupetit okay so this did indeed work.... but it's not a very good solution because it's make it impossible for packagers to apply the completion with a package....

True. Do you have time to investigate why we cannot use this completion file the vanilla-zsh way? I tried but did not succeed...

May this be related to OMZ?

@snnwolf
Copy link
Contributor Author

snnwolf commented Jan 6, 2021

Works like a charm from here. Can you please fill the CHANGELOG and rebase your branch @snnwolf? I'll merge this.

oohhh,,, :( could u help me? I don't working with rebase..
problem is: my first commit in jun 2020 and next commit with CHANGE.log in jan 2021, how to save other people's commits without hating?

@ivan-volnov
Copy link

This fix is working for me. Thanks.

zsh --version
zsh 5.8 (x86_64-apple-darwin20.0)

@georgeto
Copy link

georgeto commented Mar 2, 2021

This fix works for me too!

@georgeto georgeto mentioned this pull request Mar 2, 2021
@jmaupetit
Copy link
Contributor

Closed in favor of #409

@jmaupetit jmaupetit closed this Mar 2, 2021
jmaupetit added a commit that referenced this pull request Mar 19, 2021
Added:

- The `log` command output can now be filtered to exclude projects and
  tags via `--ignore-project` and `--ignore-tag` (#395)
- Python 3.8 support (#402)
- Python 3.9 support (#402)
- Support for the TZ environment variable to specify the local time zone
  (#391)

Changed:

- Upgrade to major arrow release 1.0.0 (#407)

Fixed:

- Zsh completion (#379)

Removed:

- Python 2.7 support (#305).
- Python 3.5 support (#407).
@jmaupetit jmaupetit mentioned this pull request Mar 19, 2021
jmaupetit added a commit that referenced this pull request Mar 19, 2021
Added:

- The `log` command output can now be filtered to exclude projects and
  tags via `--ignore-project` and `--ignore-tag` (#395)
- Python 3.8 support (#402)
- Python 3.9 support (#402)
- Support for the TZ environment variable to specify the local time zone
  (#391)

Changed:

- Upgrade to major arrow release 1.0.0 (#407)

Fixed:

- Zsh completion (#379)

Removed:

- Python 2.7 support (#305).
- Python 3.5 support (#407).
veganjay pushed a commit to veganjay/Watson that referenced this pull request May 15, 2021
Added:

- The `log` command output can now be filtered to exclude projects and
  tags via `--ignore-project` and `--ignore-tag` (jazzband#395)
- Python 3.8 support (jazzband#402)
- Python 3.9 support (jazzband#402)
- Support for the TZ environment variable to specify the local time zone
  (jazzband#391)

Changed:

- Upgrade to major arrow release 1.0.0 (jazzband#407)

Fixed:

- Zsh completion (jazzband#379)

Removed:

- Python 2.7 support (jazzband#305).
- Python 3.5 support (jazzband#407).
samtx added a commit to samtx/Watson that referenced this pull request Apr 17, 2022
* Resolve Issue jazzband#407: Migrate to arrow 1.0.0

- requirements.txt: specify arrow==1.00
- frames.py, fullmoon.py, watson.py: change "timestamp" to
  "int_timestamp"

* Resolve Issue jazzband#407: Migrate to arrow 1.0.0

- cli.py: change "date.tzinfo = tz.tzlocal()" to "date.replace(tzinfo=tz.tzlocal())"

* Update requirements.txt

This makes sense, especially given that arrow is already up to 1.0.2

Co-authored-by: Julien Maupetit <[email protected]>

* Resolve Issue jazzband#407: Migrate to arrow 1.0.0

- watson.cli.py: use date = date.replace(tzinfo=tz.tzlocal())
  (date.replace does not modify the existing object)

* Resolve Issue jazzband#407: Migrate to arrow 1.0.0

Update unit test cases:

- tests/test_cli.py: replace arrow.arrow.datetime with arrow.arrow.dt_datetime
- tests/test_watson.py: replace .timestamp with .int_timestamp

* Resolve Issue jazzband#407: Migrate to arrow 1.0.0

- .travis.yml: remove python 3.5
- setup.py: require python >= 3.6
- CHANGELOG.md: mention arrow upgrade and drop of python 3.5 support

* Update watson.zsh-completion

fix: autocompletion won't work with zsh 5.8

* Use TZ environment variable to set the timezone (jazzband#411)

Watson did not have a way to set the timezone, other than what the system used.
In UNIX you can set the TZ variable to represent the timezone you want your
programs to respect.

* Bump release to 2.0.0

Added:

- The `log` command output can now be filtered to exclude projects and
  tags via `--ignore-project` and `--ignore-tag` (jazzband#395)
- Python 3.8 support (jazzband#402)
- Python 3.9 support (jazzband#402)
- Support for the TZ environment variable to specify the local time zone
  (jazzband#391)

Changed:

- Upgrade to major arrow release 1.0.0 (jazzband#407)

Fixed:

- Zsh completion (jazzband#379)

Removed:

- Python 2.7 support (jazzband#305).
- Python 3.5 support (jazzband#407).

* Fix year in 2.0.0 release

Believe it or not its 2021!

* Gracefully handle empty stop time (jazzband#418)

Recent arrow library update broke the current frame edition.

* Bump release to 2.0.1

Fixed:

- Ability to `edit` the current frame (jazzband#418)

* Add 'notes' field to frames.

This is a large commit that adds the following:

1. Syntax: `watson stop --notes "some additional information"`.
2. Print only non-empty notes in log.
3. Always pass id to `new_frame` so that the length of array with/without
   notes doesn't cause ambiguity.
4. Print a warning message and the existing note if overwriting a note.
5. Print notes in report.

Primary work here was done by the following people:

Co-authored-by: Tristan Pratt <[email protected]>
Co-authored-by: Joel Ostblom <[email protected]>

* notes: Print notes in `watson log`.

* notes: Fix tests.

* Set requirements for click >= 8.0 and rename autocompletion parameter to shell_complete. Remove 'multiple' paramater on reporting option

Co-authored-by: Jason Youzwak <[email protected]>
Co-authored-by: veganjay <[email protected]>
Co-authored-by: Julien Maupetit <[email protected]>
Co-authored-by: Nikolay Shkrylev <[email protected]>
Co-authored-by: Eddie Ash <[email protected]>
Co-authored-by: Julien Maupetit <[email protected]>
Co-authored-by: Matthew Barry <[email protected]>
Co-authored-by: Rohitt Vashishtha <[email protected]>
Co-authored-by: Tristan Pratt <[email protected]>
Co-authored-by: Joel Ostblom <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants