Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

output over multiple lines #630

Open
Mellbourn opened this issue Mar 17, 2023 · 8 comments
Open

output over multiple lines #630

Mellbourn opened this issue Mar 17, 2023 · 8 comments
Labels

Comments

@Mellbourn
Copy link

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)

@sharkdp
Copy link
Owner

sharkdp commented Mar 18, 2023

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

@Mellbourn
Copy link
Author

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

@Mellbourn
Copy link
Author

Here is a recording of the behavior:

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

@sharkdp sharkdp added the bug label Mar 19, 2023
@sharkdp
Copy link
Owner

sharkdp commented Mar 21, 2023

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

@sharkdp
Copy link
Owner

sharkdp commented Mar 21, 2023

A workaround for now is to disable the progress bars:

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

@Mellbourn
Copy link
Author

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?

@romkatv
Copy link

romkatv commented Mar 22, 2023

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

@romkatv
Copy link

romkatv commented Mar 23, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants