Fix spinners in a very specific way to make emacs happy
Summary:
Before
D7207801 we could either just print `<result>` immediately or (if things take time) print `<spinner>(wait 1 s)<magical control characters to remove old spinner><spinner>(wait 1 s)<control character>...<result>`
After
D7207801, the first option got replaced by `<spinner><control characters><result>` (without the wait.) This should be functionally equivalent to just `<result>`, and command line terminal handles it correctly, but it seems that emacs pretends to be a terminal (in a way that makes our Unix.isatty check pass), while not actually handling those control characters correctly.
Note that this was already always broken, and will keep being broken in some cases - if the command takes more than 1 second to answer, the spinners and control characters will be printed out.
D7207801 just made it happen for all commands, not only the slow ones.
IMHO something really should be fixed on the emacs plugin side, but I'll maintain the previous behavior to not break it even more.
Reviewed By: gregory-nisbet
Differential Revision:
D7441847
fbshipit-source-id:
2a6798a8c2a0bca145dd72762ac20c571185ef40