-
Notifications
You must be signed in to change notification settings - Fork 16
Description
This might not be npms's fault but I'm curious about the cause, if anyone can help. #lowpriority
I am using iTerm2 on macOS, and I run the following:
npms search --color -s 250 babel-cli | less -REXAmongst these results is a package called my-vue-cli which has a very long description in Chinese characters (and perhaps no spaces to break on). As a result, the results table becomes very wide.
The problem: If I press q to quit less before reaching the my-vue-cli package, then my terminal output is messed up (no newlines, missing output) so I have to run reset to fix it.
But curiously, if I page through the results until I reach that package, and then quit less then my terminal ends up in its normal happy state. The same if I just keep paging until I drop out the bottom.
What odd behaviour! Perhaps it is a bug in less.
I have found a workaround. I just add an extra cat and that fixes the problem:
npms search --color -s 250 babel-cli | cat | less -REXSIs cat "cleaning up" the character stream?