Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long description with Chinese characters breaks terminal? #52

Open
joeytwiddle opened this issue Nov 15, 2019 · 0 comments
Open

Long description with Chinese characters breaks terminal? #52

joeytwiddle opened this issue Nov 15, 2019 · 0 comments

Comments

@joeytwiddle
Copy link

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 -REX

Amongst 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 -REXS

Is cat "cleaning up" the character stream?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant