Primary/secondary buffer size mismatch #292

Closed
opened 2026-01-30 21:48:09 +00:00 by claunia · 2 comments
Owner

Originally created by @parkovski on GitHub (Jun 1, 2018).

When switching from the secondary buffer to the primary buffer, if the console was resized while the secondary buffer was active, it goes back to the previous size. Most apparent using vim. Only happens using Windows vim (aka console API buffers), not Linux/WSL (ANSI buffer switch).

  • Your Windows build number: (Type ver at a Windows Command Prompt)
    17682

  • What you're doing and what's happening: (Copy & paste specific commands and their output, or include screen shots)
    Run vim in an unmaximized console (happens regardless of vimrc or termguicolors setting). Maximize the console with vim open. Close the console while maximized. The console resets to its previous size, but keeps its maximized window frame:

image

(Probably should have included the whole screen, but you can see a portion of my full screen browser through the transparent console)

  • What's wrong / what should be happening instead:
    Switching buffers should not affect the window size - buffers should always assume the size of the window.
Originally created by @parkovski on GitHub (Jun 1, 2018). When switching from the secondary buffer to the primary buffer, if the console was resized while the secondary buffer was active, it goes back to the previous size. Most apparent using vim. Only happens using Windows vim (aka console API buffers), not Linux/WSL (ANSI buffer switch). * Your Windows build number: (Type `ver` at a Windows Command Prompt) 17682 * What you're doing and what's happening: (Copy & paste specific commands and their output, or include screen shots) Run vim in an unmaximized console (happens regardless of vimrc or termguicolors setting). Maximize the console with vim open. Close the console while maximized. The console resets to its previous size, but keeps its maximized window frame: ![image](https://user-images.githubusercontent.com/1094150/40817110-699755aa-6505-11e8-85df-1c71e0e66a7e.png) (Probably should have included the whole screen, but you can see a portion of my full screen browser through the transparent console) * What's wrong / what should be happening instead: Switching buffers should not affect the window size - buffers should always assume the size of the window.
claunia added the Product-ConhostResolution-By-Design labels 2026-01-30 21:48:09 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Jun 1, 2018):

I'm fairly certain this isn't a regression - each screen buffer has always had it's own separate size, both window size and buffer size.

If it's a regression in behavior (esp from the legacy console), we could probably do something about it but from what I remember when I was adding the alt-buffer in Creator's Update, that's how the screen buffers have always worked.

Not that I don't agree that this is weird - it certainly is. It's just one of those legacy pieces of behavior we'll have to keep.

@zadjii-msft commented on GitHub (Jun 1, 2018): I'm fairly certain this isn't a regression - each screen buffer has always had it's own separate size, both window size and buffer size. If it's a regression in behavior (esp from the legacy console), we could probably do something about it but from what I remember when I was adding the alt-buffer in Creator's Update, that's how the screen buffers have always worked. Not that I don't agree that this is weird - it certainly is. It's just one of those legacy pieces of behavior we'll have to keep.
Author
Owner

@parkovski commented on GitHub (Jun 1, 2018):

I just tried this in tmux and it causes issues with interop - after I close vim, the console won't resize, but the buffer does, so that tmux tab has a big empty area at the bottom that won't go away until the window is resized manually.

It is how it's always worked, I just figured it was an overlooked behavior since I can't think of why you'd want that. If it has to stay that way, is there a solution for terminals that don't/can't resize themselves?

As another example, there are web based ssh terminals - these don't have the authority to resize the browser, although the user does. Can the buffer respect the window size if it doesn't change?

@parkovski commented on GitHub (Jun 1, 2018): I just tried this in tmux and it causes issues with interop - after I close vim, the console won't resize, but the buffer does, so that tmux tab has a big empty area at the bottom that won't go away until the window is resized manually. It is how it's always worked, I just figured it was an overlooked behavior since I can't think of why you'd want that. If it has to stay that way, is there a solution for terminals that don't/can't resize themselves? As another example, there are web based ssh terminals - these don't have the authority to resize the browser, although the user does. Can the buffer respect the window size if it doesn't change?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#292