Open ARF1 opened 5 years ago
Hi there. This is simply streaming the output from the commands you are running on the guest. To prevent things like progress bars from being streamed, you need to add --quiet
flags to your commands (or what ever flag is used to suppress output for the given command in use).
Cheers!
@chrisroberts Thanks for getting back to me. Your answer is apparently mistaken though:
This is simply streaming the output from the commands you are running on the guest.
The problem is that quite clearly vagrant is not simply streaming the output. Instead it seems to insert a line-break character \n
after every output from the command. - Even if the command did not output one.
This seems to be at the core of why so many people are reporting issues with progress bars with vagrant. Ascii progress bars work fundamentally by not ending a output line with \n
but staying in the line last printed instead. Thus when the command printing the progress bar issues an update, it begins the line-update with \r
(carriage return) to overwrite the current line instead. By inserting \n
after every line output, vagrant breaks this process of all ascii progress bars.
Please re-open this issue as either as a bug or feature request: Your recommendation to modify the script is not reasonable in many cases. It works well if you directly control the command that prints the progress bar. But what if it is printed by a command in a script, called by a script, ......., called by a script you called? Messing with Makefiles of highly intricate but well-established open source projects is not really a sensible approach to circumventing this bug.
+1 for this feature.
Another way to reproduce:
$script = <<-SCRIPT
openssl genrsa -out /tmp/server.key 2048
SCRIPT
Vagrant.configure("2") do |config|
config.vm.box = "base"
config.vm.provision "shell", inline: $script
end
After a vagrant up
, I got:
==> default: Running provisioner: shell...
default: Running: inline script
default: Generating RSA private key, 2048 bit long modulus
default: ....
default: .............
default: ............
default: ..............
default: ........+++
default: ....
default: .............
default: .+++
default: e is 65537 (0x10001)
@chrisroberts: any idea of a possible workaround for this issue ?
I am new to vagrant coming from docker.
The only issue I have encountered to far is the problematic handling of progress bars created by commands called in shell provisioners.
I am using vagrant to build the crosstool-NG toolchain which shows a progress bar (of more precisely the time elapsed plus a rotating bar). In Vagrant every update to the "progress bar" is printed in a new line. This floods the screen with useless information an prevent the user from seeing an "real" progress messages that may be interspersed with the progress bar updates.
Vagrant version
Vagrant 2.2.1
Host operating system
Windows 8.1 Microsoft Windows [Version 6.3.9600]
Guest operating system
debian/contrib-jessie64
Vagrantfile
Expected behavior
Only a single line of the progress bar should be printed. This line should be updated. (Overwritten.)
Actual behavior
Steps to reproduce
vagrant up
with vagrantfile provided above