Zsh has a feature called zpty which creates a pseudo-terminal in the background.
According to the docs, this can be useful to run a program in the background that expects to be run in a normal terminal environment.
Some zsh themes such as pure use this to run commands asynchronously. Pure uses the zsh plugin zsh-async for this.
zsh-async provides a very nice wrapper, but I wanted to play around a bit and make sure I understood the basics.
https://asciinema.org/a/TdWmfaUO75FDuvGuniAJHuRKk?speed=3
I have no idea where testing1
went.
update I compiled zsh from scratch with the intention of figuring out where testing1
went. But I see different behavior on my fresh build.
https://asciinema.org/a/9sQSe5ZyzGnpNnyBS4ZnA2TQx?speed=3
Could be a difference in versions? Or (more likely) something in my zsh environment is messing with what I'm seeing.