3 ms·
Nice! I would replace `ttysize w` with `tput cols` for use on macOS, and it works. However, for some reason, it erases too many lines when I tested it. Maybe so
by kattouf 2y ago
Nice! I would replace `ttysize w` with `tput cols` for use on macOS, and it works. However, for some reason, it erases too many lines when I tested it. Maybe something is going wrong with the "n" calculation.
For test I used `ping google.com | progressline`
- teo_zero 2y agoYes, "n" calculation is approximate: it's just the number of chars divided by the terminal's width. No guarantees it works with UTF-8, escape sequences, or if the terminal get resized while it's running... Sorry, this is just a quick hack!
- kattouf 2y agoGot it, no need to sorry, this is a still cool example :thumbs-up: