question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Auto-resize Predictor ListView when the height is too small

See original GitHub issue

Prerequisites

  • Write a descriptive title.

Description of the new feature/enhancement

When my shell windows are too small to display all ten predictions in ListView, it should reduce the size to be able to display a smaller number of predictions.

This is particularly applicable in CloudShell where the default window when you open CloudShell is too small for ListView and so fails silently when I try using F2 and gives this error message when I try to set:

PS /home/steven> Set-PSReadLineOption -PredictionViewStyle ListView
WARNING: The prediction 'ListView' is temporarily disabled because the current window size of the console is too small. To use the 'ListView', please make sure the 'WindowWidth' is not less than '54' and the 'WindowHeight' is not less than '15'.

https://user-images.githubusercontent.com/20605456/216405289-d6449cb9-5b75-4306-95b1-53a204d9d7b3.mov

Proposed technical implementation details (optional)

There are a few ways to improve this experience.

  • Incorporate similiar error message that Set-PSReadLineOption gives when the user tries F2
  • Make ListView number of results resizable based on the window.
  • Make ListView number of results resizable based on the window and incorporate scrollable functionality to enable users to see the other results given a smaller window.

cc @theJasonHelmick @daxian-dbw

Issue Analytics

  • State:closed
  • Created 8 months ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
msftbot[bot]commented, Mar 8, 2023

🎉 This issue was addressed in 3583, which has now been successfully released in v2.3.0-beta0. 🎉

1reaction
daxian-dbwcommented, Feb 6, 2023

I improved the scrollable list view to be able to adjust the list height accordingly based on the terminal height, and print warning when the terminal size is too small to show the list view.

scrollable-adjustable

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Fix ListView Item size to Auto
I tried to resize its width by -2 but still same error. It autosize is not possible on listview set to panel or...
Read more >
AutoSize a .NET ListView Control
To autosize it fully, pass in the number of items that the list view control contains.
Read more >
Item Height Issue in UI for WinForms
ListView leaves too much space around text in every visual item. I mean it wraps text fine, but leaves spare 15 pixels on...
Read more >
Thread: [RESOLVED] ListView autosize
I am having some issues with auto sizing the list view. I have set the properties to auto size based on the ColumnContent...
Read more >
Listview height autosizing - Ask for Help
The problem: I want the listview's height to be adjusted depending on the number of lines (i.e. auto-sized, like you can horizintally). I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found