mirror of
https://github.com/asciinema/asciinema.git
synced 2026-04-25 16:05:52 +03:00
[GH-ISSUE #613] Recording wont exit when using P10k's instant prompt #317
Labels
No labels
bug
compatibility
feature request
fit for beginners
help wanted
hosting
idea
improvement
packaging
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/asciinema#317
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Pytness on GitHub (Feb 8, 2024).
Original GitHub issue: https://github.com/asciinema/asciinema/issues/613
Describe the bug
asciinema rec wont terminate when exiting zsh shell if using p10k-instant-prompt.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Stop recording
Versions:
@ku1ik commented on GitHub (Feb 8, 2024):
Hmm, probably a deadlock.
What happens when you record with
-c bashand launchzshfrom bash manually?@Pytness commented on GitHub (Feb 8, 2024):
It hangs after exiting bash.
Here is a recording i made with a great tool i found:

@moritzdietz commented on GitHub (Feb 8, 2024):
Just tried to reproduce it – I have zsh, p10k and instant prompt enabled on my Linux Mint x86_64 PC and I wasn't able to. It worked just fine.
Out of curiosity, are you sure you have only one installation of asciinema on your machine? Because the version you specified yells at you for saying where you want to store the recording. Can it be that you have both the rust + python version available on your path and Bash and ZSH get it mixed up?
@Pytness commented on GitHub (Feb 9, 2024):
I dont think so. Its a fresh install through
cargo install --git ...andwhereisoutputs the expected.cargo/bin.By yelling you mean
::: Recording session started, writing to test.cast?To be clear, I dont see the problem when I comment out the lines sourcing the instant prompt script. Could be something related? I will try using a newer version, maybe it is just outdated.
@ku1ik commented on GitHub (Feb 9, 2024):
You can try latest develop, yeah.
Btw, what terminal application do you use?
@Pytness commented on GitHub (Feb 9, 2024):
I am seeing the error on a WSL2 Ubuntu through Wezterm and on an Arch install through ssh in Wezterm
@ku1ik commented on GitHub (Feb 9, 2024):
I tried it now on Arch, using Wezterm, with zsh, p10k, instant prompt (selected verbose mode in the setup wizard), but can't reproduce it either.
@ku1ik commented on GitHub (Feb 9, 2024):
When you ssh to the Arch install, this is from Wezterm running on Windows maybe?
@Pytness commented on GitHub (Feb 9, 2024):
I installed p10k again (deleting instant prompt script) and Im getting same results.
Yes it is, but Im getting the same problem when connecting through other apps (I tried with an Android app, JuiceSSH)
@moritzdietz commented on GitHub (Feb 9, 2024):
Maybe this is something in your dotfiles / ZSH setup. Might be worthwhile to go as vanilla as possible and re-add your config things and see where it breaks?
Reason is: I know that when instant prompt launches and there is some kind of delay for it to launch caused by other things in the dotfiles, it will print out things. Maybe this is the case here?
@ku1ik commented on GitHub (Feb 9, 2024):
Ok, so given it's the same on JuiceSSH, we can rule out Wezterm.
However I'm confused about instant prompt. You first wrote:
And then:
So it does or does not work without instant prompt?
@Pytness commented on GitHub (Feb 9, 2024):
It does work without instant prompt.
I removed the instant prompt script before reinstalling p10k (and configuring) to ensure the last version is installed. Sorry for the confusion.
I will try and bisect where else could it break.
@ku1ik commented on GitHub (Feb 9, 2024):
From the demo you recorded it seems to me that the zsh process actually doesn't fully exit. asciinema finishes when the shell process exits and the allocated PTY for the shell gets closed. So, for some reasone the slave side of the PTY doesn't get closed. (this is probably not useful to you, writing this more as a note for myself :))
@Pytness commented on GitHub (Feb 9, 2024):
Doing
kill -9 $$outputs Killed but still the same issue.@ku1ik commented on GitHub (Feb 9, 2024):
Are you able to install asciinema 2.4.0 and test with it?
@Pytness commented on GitHub (Feb 9, 2024):
Yes, same result. (I uninstalled the rust version)
@Pytness commented on GitHub (Feb 9, 2024):
I am playing with the source code and It gets stuck at pty::handle_child on execvp.
It seems to me that there is not much to be done?
@ku1ik commented on GitHub (Feb 9, 2024):
Right, so this confirms that zsh process doesn't exit, for some reason.
Can you try recording with the
scriptcommand instead of asciinema? Or withttyrec?@Pytness commented on GitHub (Feb 12, 2024):
Using
scriptzsh exits.@Pytness commented on GitHub (Feb 12, 2024):
Comparing with the
scriptcommand source code, I found out it calls some functionul_pty_signals_setup.In that function it sets some signals:
I noticed that in
asciinema, thesigalrmandsigchldare not being handled.Handling this signals allows zsh to exit nicely.
I will open a PR.