Forum Discussion
Getting powershell to scroll horizontally instead of word wrap
Are you using the standard shell?
I've tested the standard shells for both Windows PowerShell and PowerShell and I do get the horizontal scroll bar as show below.
Given you said you wanted a value of 7,000, you might want to try that instead of the 256 value I was using, since if your current width is greater than 256 characters, you wouldn't expect to see a horizontal scroll bar.
Windows PowerShell initial screen set to a display width of 120 characters
Windows PowerShell screen after running the buffer change command (set to 256 characters width) showing horizontal scroll bar
The PowerShell default shell behaves the same way, so I haven't bothered including the almost-identical screenshots from it.
Cheers,
Lain
- sawtooth500May 13, 2024Copper ContributorI'm guessing I must be doing something wrong then...
https://youtu.be/jZk0wmKtn7w
That's a recording of me trying to change the buffer size as you suggested Lain. As you see with some sample content I have there, it's line wrapping. If I extend the window onto my second monitor, the wrapping stops. Let me know what I'm doing wrong, thanks.- LainRobertsonMay 13, 2024Silver Contributor
And don't forget to use your own value instead of what I used (256 characters) in my simple example. Perhaps try something like 2,048 and see how you go.
Cheers,
Lain
- LainRobertsonMay 13, 2024Silver Contributor
I haven't watched the video, however, if you're resizing your window after running the command then the application window property shown below will undo the command's changes.
You'd need to uncheck this property to avoid the undoing of the programmatic changing of the buffer width.
Note that unchecking this option means the unchecking will persist between sessions, impacting all future windows as they're opened.
I guess that leads to perhaps a final point: if you don't need to change the buffer width dynamically, just set the properties above to your liking and walk away, as that'd be job done.
However, if you're saying that even after doing this (and this also applies to the programmatic change method) you still don't see the horizontal scroll bar, then I can't help as I'm not seeing that behaviour on my client using the default shells.
Cheers,
Lain