PSReadLine icon indicating copy to clipboard operation
PSReadLine copied to clipboard

Add an option to set history list width

Open SomwareHR opened this issue 9 months ago • 1 comments

Prerequisites

  • [x] Write a descriptive title.

Description of the new feature/enhancement

Hi, thanks for an excellent addition to Powershell! :)

Intro

I keep WindowsTerminal window full screen all the time. PSReadLine cuts history list at 88 chars. This leaves a lot of free space on screen (see image) and commands are cut-off, often at the places where most important arguments are.

Idea

Introduce an option to set history list width to desired number of characters or, even better, to console width.

Thank you! :)

Image

Image

Proposed technical implementation details (optional)

Set-PSReadLineOption -LineWidth 200 Set-PSReadLineOption -LineWidth $Host.UI.RawUI.WindowSize.Width Set-PSReadLineOption -LineWidth Maximum

SomwareHR avatar Apr 18 '25 06:04 SomwareHR

It's common enough to have fairly long lines with only slight variations toward the end of the command line and it's literally impossible to see the difference between them in the list view.

Image

I can use the arrow keys to navigate through the options and see each complete line one at a time, but like why? There's so much wasted real estate there and folks have wide monitors. You can see from this screenshot that the 4th item isn't even that much longer than its truncated display.

Image

My vote is for @SomwareHR 's 3rd proposed option - just let it auto size to use all available space. That's the most elegant and then should work regardless of how the terminal is resized.

Set-PSReadLineOption -LineWidth Maximum

Could you please consider this enhancement?

KyleKolander avatar Jul 15 '25 18:07 KyleKolander