Fixed the progress bar width calculation

This was previously hard-coded at a width of 80 characters, which would cause tests to fail when they were run on wider terminals