Closed vashirov closed 4 years ago
Hi @vashirov , Thank you for reporting the issue and additional information about zsh
.
I think I have noticed same thing in past and thought that it might be just something wrong on my system, but checking the link you have provided it seems that really the -c
option of pv
might be the root cause for this.
I'm using only bash
. If this is indeed the behaviour of pv
in bash
then I would like to rather see it fixed in pv
instead of introducing the workarounds in fast-vm
. But before getting to conclusions let me do some testing on systems where I have tested the fast-vm
to see the whole picture.
Could you please let me know in the meantime the following information?
pv
that you are using - pv --version
bash
that you have seen this behavior - bash --version
I will have a look at this either today or during next week. Thank you!
pv
from at least pv-1.4.6-1.fc18.x86_64
through pv-1.6.6-6.fc30.x86_64
are affected.bash-4.4.0-1.fc26.x86_64
to bash-5.0.7-1.fc30.x86_64
.I also tested in zsh
a bit more and noticed that it's also affected, but it happens less often than in bash
. So I also think that the root cause is pv -c
and its behavior might be racy. I've sent bug report to the author.
I used the following reproducer:
dd if=/dev/zero bs=1M count=1024 | pv -cN download | pv -cN unpack | dd of=/dev/null; stty -a | grep echo
You might want to increase count
in case it's too fast.
Thank you for additional information. I had to crank up the count a bit (6000 made it up on my Gentoo system while new CentOS 8 system resisted a bit longer), but then on second try the echo really disappeared. Tested on my Gentoo GNU bash, version 4.4.23(1)-release (x86_64-pc-linux-gnu)
.
While it would be nice to fix it in the pv
I think I will also implement the workaround in the fast-vm
so if it detects that stty -a
echo state has changed from echo
to -echo
it will re-enable it. I will post the proposed change in second half of this week. I will keep you updated.
In case you get any response from pv
author in the meantime please also let me know.
Hi @vashirov, thank you for patience. I have tested workaround in fast-vm
to restore stty to previous values when the echo
is detected to be missing after pv -c
. I have tested this on my Gentoo and CentOS-8.0. Currently the change is in develop
branch. I'm planning on making release of new version of fast-vm
in upcoming weeks when it would be available as package with other fixes and improvements.
In the meantime, would you be able to test the changes from commit d433db64585dda3566ba45254ac4b6eeb4b37adb on your machine and let me know if it works also for you?
Change introduces also message that shows when issue was detected and recovery was attempted. So you should see message [__][inf] Missing 'echo' on termninal after 'pv', restoring terminal settings before 'pv'.
when issue happened. After that the terminal should work normally. If that is not the case, please let me know.
Once again thank you for reporting this issue and providing the needed details.
Hi @vashirov, the change is now available in fast-vm version 1.6 released this week. If you have oportunity to confirm if this works also for you or you need more time to test it please let me know. If there will be no response from you for 2 weeks I will proceed with closing this Issue as I cannot reproduce the issue any more after implementing the workaround that restores echo in terminal in my environment.
Hi @OndrejHome, I apologize for the delay.
I still haven't heard from the author of pv
.
I've tested fast-vm-1.6-1.fc30.noarch
. Everything works as expected. Thank you so much for fixing this issue!
And thank you for fast-vm
, really enjoying it.
After
fast-vm import_image
I have to runstty sane
orstty echo
to restore echo in my terminal. This only happens inbash
whenpv
is installed and is used byfast-vm
. Inzsh
I don't have this problem.Apparently
pv -c
is known for this kind of behavior: https://serverfault.com/a/690183The workaround would be to run
stty sane
orstty echo
afterpv -c
invocation.