Skip to content

Unexpected Right Padding in TUIs even though Scrollbar is Hidden by Default #18872

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

Open
ni554n opened this issue May 4, 2025 · 2 comments
Open
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@ni554n
Copy link

ni554n commented May 4, 2025

Windows Terminal version

1.22.11141.0

Windows build number

10.0.22631.0

Other Software

neovim 0.11.1

Steps to reproduce

Setup:

On Defaults > Appearance page:

  • Window Padding is set to 0
  • Scrollbar visibility is set to Hidden

On default profile PowerShell > Appearance page:

  • Scrollbar visibility is set to Visible

  • Restart the terminal

Expected Behavior

When I run nvim via PowerShell, I see the padding reserved for the scrollbar area, which is understandable.
However, I wish TUIs could take over the whole window.

Image

Actual Behavior

The Issue

If I run nvim.exe directly by double-clicking it, there's an unexpected gap on the right. It's smaller than the scrollbar padding. This gap corrects itself if I slightly resize the window from the right edge.

Image

This seems like a bug to me. I originally commented it on #18582.

Here's the reply I got from @j4james in #18582

I assume what's happening here is you've set your default profile as PowerShell, so when opening a new instance of the terminal, the initial size is based on the PowerShell profile, i.e. with a visible scrollbar.

However, when launching an arbitrary executable, the tab that will be created for that app will use the profile default settings, which have the scrollbar hidden. And if the window is already created at that point, a tab without a scrollbar will not fill the available space.

Now it's arguable that if you're creating a brand new terminal with an arbitrary executable, the initial window size should have been based on the default settings, rather than the settings of the default profile. So that may well be a bug, although it might also be by design.

If it bothers you, I'd recommend opening an issue for this and see what the core devs have to say.

@ni554n ni554n added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels May 4, 2025
@zadjii-msft
Copy link
Member

Now it's arguable that if you're creating a brand new terminal with an arbitrary executable, the initial window size should have been based on the default settings, rather than the settings of the default profile. So that may well be a bug, although it might also be by design.

So, okay, yes. This one is "by bad design".

Right now, profiles.defaults is used to derive the settings for any unknown application that gets launched into Terminal.

For now, I'd recommend moving the settings you care to apply to all applications to your defaults rather than to your default profile.

You could also just make a hidden profile with a commandline of path/to/nvim.exe and hidden: true, and I suspect that Terminal would match defterm launches for nvim to that... but that seems like a strictly goofier solution

@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label May 7, 2025
@ni554n
Copy link
Author

ni554n commented May 8, 2025

Right now, profiles.defaults is used to derive the settings for any unknown application that gets launched into Terminal.

For now, I'd recommend moving the settings you care to apply to all applications to your defaults rather than to your default profile.

This was my expectation. But it's the opposite behavior I'm observing; hence the bug report.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

2 participants