franciscolourenco / done

A fish-shell package to automatically receive notifications when long processes finish.
MIT License
766 stars 70 forks source link

Bad quotes in __done_humanize_duration? #101

Closed aselker closed 9 months ago

aselker commented 3 years ago

When a long-running process finishes, these messages show up in the terminal:

(standard_in) 1: syntax error
(standard_in) 1: syntax error
test: Missing argument at index 2
test: Missing argument at index 2

Also, the title of the notification is just "Done in", not e.g. "Done in 20s".

I think the problem is on lines 159 and 160 of done.fish, which read:

set -l seconds (math --scale=0 "$milliseconds/1000" % 60)
set -l minutes (math --scale=0 "$milliseconds/60000" % 60)

Running one of those lines in a terminal fails. I think Fish doesn't like the %. If I move the quotes to this...

set -l seconds (math --scale=0 "$milliseconds/1000 % 60")
set -l minutes (math --scale=0 "$milliseconds/60000 % 60")

...then the error messages go away, and the notification shows the runtime.

franciscolourenco commented 3 years ago

Hi @aselker, thank you for reporting this. Would you be up for submitting a pull request?

franciscolourenco commented 3 years ago

Which version of fish are you using? I can't reproduce this issue.

aselker commented 3 years ago

I updated to Fish 3.2.2, from version 2.something, and the problem seems to be gone.

franciscolourenco commented 3 years ago

OK, so it seems to depend on the version

franciscolourenco commented 9 months ago

Closing this as it seems to only be fixed in newer version of fish. Thanks for reporting!