microsoft / microsoft/terminal

WINDOW_BUFFER_SIZE_EVENT generated during window scrolling

Open
#281 26 comments 30 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Server Issue-Feature Product-Conhost Work-Item
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

Windows Version 10.0.17763.1

SetConsoleWindowInfo can be used to scroll the contents of the console screen buffer by shifting the position of the window rectangle without changing its size.

Starting from Windows 10 1709 (FCU) such scrolling generates a WINDOW_BUFFER_SIZE_EVENT even though the console buffer size remains unchanged.

This breaks our application behaviour and does not make sense for the following reasons:

  • The documentation explicitly says that WINDOW_BUFFER_SIZE_RECORD "describes a change in the size of the console screen buffer", but there's no change in this case.
  • The event is generated only if the contents of the console screen buffer is scrolled via SetConsoleWindowInfo API, but it's useless - the application already knows that the console is being scrolled because the scrolling is initiated by the application itself.
  • event is not generated when the user moves the scrollbar manually, so the application does not know that the console it being scrolled in that case.
  • It does not happen in Legacy mode and never happened before for 20+ years.

A minimal project to reproduce the issue attached.
BufferSizeEventBug.zip

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached BufferSizeEventBug.zip minimal reproduction and the SetConsoleWindowInfo and WINDOW_BUFFER_SIZE_RECORD documentation linked in the issue. Compare the generated events when scrolling the console buffer and when the buffer size is unchanged; done means the spurious WINDOW_BUFFER_SIZE_EVENT no longer breaks the application's behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.