theckman / yacspin

Yet Another CLi Spinner; providing over 80 easy to use and customizable terminal spinners for multiple OSes
Apache License 2.0
434 stars 13 forks source link

Add support for Windows printing #13

Closed theckman closed 4 years ago

theckman commented 4 years ago

This adds support for printing on Windows, using a more rudimentary method for clearing the screen. Windows terminals don't understand VT100 / ANSI terminal escape sequences, so the methods used for OS X and Linux aren't applicable.

When on Windows, it tracks the number of wrtten bytes and on erase writes a carriage return and that number of plain spaces to overwrite the characters followed by a final carriage return.

codecov[bot] commented 4 years ago

Codecov Report

Merging #13 into master will decrease coverage by 2.94%. The diff coverage is 48.83%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #13      +/-   ##
==========================================
- Coverage   94.42%   91.47%   -2.95%     
==========================================
  Files           2        2              
  Lines         287      305      +18     
==========================================
+ Hits          271      279       +8     
- Misses          8       13       +5     
- Partials        8       13       +5
Impacted Files Coverage Δ
spinner.go 91.12% <48.83%> (-3.06%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6c78539...8f6b3a9. Read the comment docs.