microsoft / microsoft/terminal
Defer initial terminal sizing until terminal initialization
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 105k
- Forks
- 9.6k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 29
Description
Right now the initial window size is calculated just as the window is created but before the terminal is. This has two disadvantages:
- It doesn't have all the size information. Right now its only the width of a scrollbar that it has to guess but there could be more (potentially variable size) elements in the future. There might also be some additional spacing in layers above, like pane or terminal page.
- It creates temporary
DxRendererjust to locate required fond and calculate its size and then discards it.
If we instead calculated the initial size when terminal initializes this problems would be gone (it would be able to query sizes of the controls and use the real renderer of a terminal). We might potentially resolve them otherwise but this seems to be the simplest and most robust approach.
The problem is that it could result in two sizing operations (one when window opens and another one when the size is calculated) which could be noticeable to user or CPU, unless this can be somehow avoided. Thus I'm here to ask what do you think about this approach.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the window-creation sizing and terminal-initialization flow described in the issue. Compare the available control-size information and renderer usage at each stage, then determine whether initialization can provide the final size without a noticeable second sizing operation. Done means sizing uses the real terminal renderer and avoids the temporary renderer while preserving acceptable startup behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop, performance
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100