Skip to content

Conversation

@danielwe
Copy link
Contributor

This adresses the issue of having a scrollbar margin (with the legacy scroller style on macOS) even when the terminal state is explicitly non-scrollable, such as in the alternate screen. I reported this in #9254 (reply in thread) and more extensively in #9291 (comment).

Before
Screenshot 2025-10-21 at 12 25 58

After
Screenshot 2025-10-21 at 12 20 30

@danielwe danielwe requested review from a team as code owners October 21, 2025 19:54
@danielwe danielwe force-pushed the no_alternate_margin branch 2 times, most recently from 145149b to 7e81b5d Compare October 22, 2025 02:53
@mitchellh
Copy link
Contributor

I do question if this is the right solution, but beyond that I also wonder if this will cause reflow since resizing the terminal resizes BOTH screens and we have no way to only resize one screen currently (I'm open to the idea of that in general but its probably filled with a bunch of edge cases).

@danielwe
Copy link
Contributor Author

Yeah if you have a lot of wrapped text on the primary screen, you can sometimes see a split second reflow happening as you exit or stop (ctrl+z) neovim, but everything seems to work itself out correctly regardless of shell and shell integration. I guess the unhappy edge case would be if you have a complex, width-sensitive shell prompt but your shell/shell-integration doesn't support repainting it on reflow/resize---then the first prompt when exiting the alternate screen would be off.

Conversely you can sometimes notice the resize event as neovim is launched if you're paying close attention.

Agree these things are not ideal, but browsing the code it looks like it would be a pretty complex change to have separate primary and alternate screen sizes. But probably the better solution if it can be made to work.

@danielwe
Copy link
Contributor Author

looks like it would be a pretty complex change to have separate primary and alternate screen sizes. But probably the better solution if it can be made to work.

But to bring back the discussion from #9291, I think this approach would require the core to be aware of the scrollbar margin, or more generally, to know which parts of the apprt insets/safe areas are scrolling related. The decision about whether to heed the margin would then happen in Screen.init, depending on whether max_scrollback > 0.

@danielwe danielwe force-pushed the no_alternate_margin branch 5 times, most recently from 3c453de to 4f6ef0f Compare November 1, 2025 21:24
@danielwe danielwe force-pushed the no_alternate_margin branch from 4f6ef0f to a515c96 Compare November 1, 2025 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants