zinc icon indicating copy to clipboard operation
zinc copied to clipboard

Exit "blocked"

Open fniessen opened this issue 5 years ago • 12 comments

Dear Ben, now, since I'm using Zinc, I have some (?) terminal windows which don't close, after the exit command. It stays in that state forever:

image

and if I click on the x button, I get:

image

But answering OK does not change anything: the window still hangs out…

Any idea?

fniessen avatar Jun 28 '19 07:06 fniessen

I think that's the async worker that's still running in the background.

zsh-async doesn't have very good support for cygwin, other themes also have a similar problem: https://github.com/agkozak/agkozak-zsh-prompt#asynchronous-methods

If it's just the worker getting stuch in the background, I can try making it so that the worker shuts down in zsh EXIT to see if that fixes the extra process.

robobenklein avatar Jun 28 '19 08:06 robobenklein

Actually, try this:

Exit using exit or ctrl-D in the terminal vs Exiting using the close button.

If exit in the terminal works and the close button doesn't then I don't think I can get an easy fix soon, it'd mean I have to rewrite some of the async backend to avoid spawning that extra process that mintty thinks is something important.

Unfortunately I really have little clue as to making things work in non-Unix / non-Posix environments but I'll try my best with whatever info you can provide.

robobenklein avatar Jun 28 '19 08:06 robobenklein

Thanks for trying.

Just to be clear, exit does not work, nor the close button...

fniessen avatar Jun 28 '19 13:06 fniessen

Actually since exit does not work, there's another thing you can try: shut down the worker process before exiting the shell.

Try running async_stop_worker zinc_segment_worker before using exit. If that works then we can just tell ZSH to run it when the shell exits.

robobenklein avatar Jun 28 '19 19:06 robobenklein

I've run the above command. I did not get any prompt back… Seems blocked forever (I did reboot after waiting for more than 2 minutes).

fniessen avatar Jul 01 '19 09:07 fniessen

Dear Ben,

Do you think you'll be able to find a solution or workaround for this? For me, this is the only show-stopper on Windows -- need to reboot to make the "dead" terminal Windows disappear...

For the rest, I'm super-mega-happy with the switch I've done! I don't have to wait anymore for the Git prompt to show up, for some seconds, in Git projects with a lot of history… Thanks again!

fniessen avatar Jul 15 '19 08:07 fniessen

Here's another idea to try: run this to exit the shell:

async_worker_eval zinc_segment_worker exit; exit

If that works then I think I can implement a solution.

robobenklein avatar Jul 15 '19 09:07 robobenklein

I would like to "please" you ;-), but - sorry - nope, that line is hanging around indefinitely. And the window can't be closed, even with the "x" button.

fniessen avatar Jul 15 '19 11:07 fniessen

Could you show me what processes are still blocking the closing of the terminal after running that?

robobenklein avatar Jul 16 '19 04:07 robobenklein

Not sure how to get the right info for you.

Here's a trial:

image

image

Any command I should run to get more concrete info for you?

fniessen avatar Jul 16 '19 09:07 fniessen

You see above that I can't close when clicking on "x". Nor C-c or anything else does work.

I do have a MP4 showing this, but that won't help you, I guess.

fniessen avatar Jul 16 '19 09:07 fniessen

I would try killing all the child processes when exiting the shell, something like https://unix.stackexchange.com/questions/124127/kill-all-descendant-processes

robobenklein avatar Jul 17 '19 02:07 robobenklein