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

Multiselect clips prompt message and some items when scrolling #426

Open
robations opened this issue Jun 14, 2023 · 4 comments
Open

Multiselect clips prompt message and some items when scrolling #426

robations opened this issue Jun 14, 2023 · 4 comments
Labels

Comments

@robations
Copy link

See issue I reported downstream with pnpm here.

The issue seems to occur when there are many items that wrap around the screen and there seems to be an off-by-2 (?) issue with the calculation and the terminal height.

The prompt implementation code in pnpm can be found here:

https://github.com/pnpm/pnpm/blob/100d03b36bd0aefb30fd64ee769d3eaed2ea6d87/pkg-manager/plugin-commands-installation/src/update/index.ts#L212

I can potentially create a reproduction (when time allows).

@jonschlinkert
Copy link
Member

K, I looked at the prompt and I think I reproduced what you're describing, but I want to make sure I'm focused on the right thing. There are three things that could potentially be wrapping incorrectly, is it one or multiple of the following?

  1. The prompt message string isn't wrapping correctly, horizontally
  2. The choice message strings aren't wrapping correctly, horizontally
  3. The list of choices is overflowing vertically

Or something else?

Sorry for the late reply, please let me know if you are able to recall what the specific issue was. thanks!

@robations
Copy link
Author

@jonschlinkert no problem, thanks for the reply.

Sorry for lack of clarity. I think we're talking about 3 here.

A video may help. Notice how the prompt and the top of the list isn't visible, scrolling up causes the cursor to disappear out of view:

Screen.Recording.2023-08-10.at.11.39.04.mp4

This is with pnpm and MacOS Terminal.app, but I've seen the same issue with my own CLI application and other terminals.

@robations
Copy link
Author

A naive take (after searching the project for "height"), is that a fix could be applied here?

return Math.min(limit, this.height);

this.height - 2 perhaps?

@es50678
Copy link

es50678 commented Dec 6, 2023

I get the same problem

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

No branches or pull requests

3 participants