manrajgrover / halo

💫 Beautiful spinners for terminal, IPython and Jupyter
MIT License
2.86k stars 148 forks source link

Bug: text input ignores leading spaces #113

Open tjquillan opened 5 years ago

tjquillan commented 5 years ago

Description

When supplying something such as spinner.start(text) with a string like " =>" it simply prints in the console as "=>"

System settings

Expected behaviour

I would expect for the leading white-space to be included in the text shown in the command line.

JoshKarpel commented 4 years ago

@manrajgrover It seems like a better default would be to rstrip the user's text instead of strip, so that trailing whitespace is removed but leading whitespace (like in the original issue) is preserved. This is less of a change than #114 , and still doesn't let the user break the spinner by having \n or \r at the end of their text (although it doesn't stop them from putting it in front...). Would be happy to produce a PR along those lines if you think that's reasonable.