Skip to content

Long description with Chinese characters breaks terminal? #52

@joeytwiddle

Description

@joeytwiddle

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions