autoupdate-zgen icon indicating copy to clipboard operation
autoupdate-zgen copied to clipboard

Delay update / interactive update

Open ratijas opened this issue 7 years ago • 10 comments

Please, add an option to skip an update, like oh-my-zsh does. Sometimes it starts to update on a new tab in the most inconvenient moment, so a quick "Would you like Zgen to update?" may save some nerves. (:

ratijas avatar Feb 04 '18 16:02 ratijas

Literally, two years have passed...

ratijas avatar Sep 29 '20 15:09 ratijas

I somehow missed this when you opened it, apologies. The main issue I have with a prompt is that then your new terminal windows are blocked on user input.

Maybe add the prompt only if ~/.zgen-prompt-autoupdate exists.

unixorn avatar Sep 29 '20 23:09 unixorn

Isn't it exactly what happens now? From time to time, my workflow suddenly get all blocked by unexpected update, without leaving me much of a choice. Why does it feel like using Windows anyway?

Maybe I would be happy to update, but now right now. Maybe I'd even open a separate terminal window specifically for the update, but I definitely don't want to read an update log in an IntelliJ terminal widget, or at console tty while rescuing hung up Xorg server.

And the worst part — if you were to kill the untimely update process, you'd get completely bare zsh, since .zshrc wasn't fully executed.

ratijas avatar Sep 29 '20 23:09 ratijas

With that being said, I really want automatic updates. Or at least, I want software to remind/tell me when an update is available. But it most certainly must not be such an intrusive process.

Besides, why not doing this somewhere in the background, completely non-interactively?

ratijas avatar Sep 29 '20 23:09 ratijas

The plugin just calls zgen's internal commands and I didn't want to have them spewing output into the terminal session while you're trying to get work done. I didn't want to just toss it in /dev/null because then you don't get to see any error messages.

Maybe have a flag file to have it warn you "you need to do a zgen selfupdate/zgen update" without actually running the update.

unixorn avatar Sep 29 '20 23:09 unixorn

There is definitely more than one way around it. But current strategy is clearly too straight-forward.

Also, would be good to have something like this in zgen itself. I mean, this kind of stuff is my dotfiles, it is not governed under jurisdiction of package managers — I can't just apt update && upgrade or pacman -Suy to update my shell plugins, because neither apt nor pacman aware of zgen.

ratijas avatar Sep 29 '20 23:09 ratijas

When I originally brought it up, the zgen maintainer didn't want an autoupdate patch, which is why I wrote the plugin.

unixorn avatar Sep 29 '20 23:09 unixorn

Maybe have a flag file to have it warn you "you need to do a zgen selfupdate/zgen update" without actually running the update.

You know, the old times when people used to have mail in their PS1... Except, now we have fully-blown themes managers like powerlevel{9,10}k and their informative widgets.

the zgen maintainer didn't want an autoupdate patch

Looking at their Gtihub activity, it is almost certainly a dead project by now. At this point, I'm sure they don't want to do anything about it, let alone autoupdate patch. Is it time to migrate elsewhere? Eeewww, changes, not again...

ratijas avatar Sep 29 '20 23:09 ratijas

That's how I see it fit:

/me opens up zsh. — Oh, hello there! Wanna update? — I'm busy. Get lost. — Understandable, have nice day. zgen delays update prompt until tomorrow. It also prints on the screen instructions on how to perform manual update without waiting till next doomsday. (that's "actionable" for 'ya!)

On hour later: /me finishes whatever he was doing. — Damn, that was so rude. I'd better watch my attitude. /me runs zgen update; zgen selfupdate manually.

Tomorrow: zgen sees last update times, and further delays prompt by a whole week without asking.

ratijas avatar Sep 30 '20 00:09 ratijas

I really didn't want to change away from zgen, but you're right, it is looking pretty dead.

unixorn avatar Sep 30 '20 15:09 unixorn