sharkdp / hyperfine

A command-line benchmarking tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

output over multiple lines

Mellbourn opened this issue · comments

I've used hyperfine for a long time. Excellent tool. Recently it started to behave incorrectly visually. Instead of the output animating a single line, it prints several lines:

image

This is the only program that I've noticed this sort of behaviour in.

I'm running on a Macbook with macOS Ventura 13.2.1 and zsh 5.9 (arm-apple-darwin22.1.0)

Thank you for reporting this. Which version of hyperfine do you have? The latest 1.16?

Yes, 1.16.0, I upgrade my tools often, so the behavior could have started with the upgrade.

Here is a recording of the behavior:

Screen.Recording.2023-03-18.at.10.32.56.mov

This is the only program that I've noticed this sort of behaviour in.

Just to be sure: by "the only program", you mean zsh -is < /dev/null, correct? When I first read the ticket I thought you meant that hyperfine is the only program where you saw this behavior.

I can reproduce this with hyperfine "zsh -is </dev/null", and I can also confirm that this is a regression in 1.16, caused by an update of the indicatif dependency which is responsible for drawing those progress bars.

We should probably report this upstream, but it is worth noting that zsh -is < /dev/null behaves extremely strange even when running this in a plain terminal. Notice the error messages and the additional prompt line with the % character:

image

A workaround for now is to disable the progress bars:

hyperfine --style=color "zsh -is </dev/null"

Yes, now that you mention it, the problem seems to occur only for zsh -is < /dev/null. I've used that command since @romkatv recommended it for testing zsh startup times. So it is a bit sad that the graphics no longer work for it.

Where should I direct an upstream report?

You can use https://github.com/romkatv/zsh-bench to benchmark interactive zsh.

We should probably report this upstream, but it is worth noting that zsh -is < /dev/null behaves extremely strange even when running this in a plain terminal. Notice the error messages [...]

It's not zsh -is < /dev/null per se that behaves strangely, it's your zsh startup files. Apparently your startup files produce errors when stdin is not a TTY. This is fixable if you care about this.

[...] and the additional prompt line with the % character:

The prompt line is printed by zsh -is and is intended. The % is printed by your outer shell. You can see it by simply running print -n hello.