microsoft / microsoft/terminal

Lines randomly disappear when switching between panes

Open
#9,203 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Rendering Area-TerminalControl Issue-Bug Priority-2 Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

# Environment
Main development branch

# Steps to reproduce

1. Enable FFM mode (not sure if required)
2. Open a Windows Powershell tab with two panes
3. In repro scenario, the panes contain a link (not sure if required)
3. Move the mouse from one pane to another

# Expected behavior

The panes get focus, the links get underlined / de-underlined.

# Actual behavior
Randomly some lines disappear from a pane and reappear after some hovering (see below)

![DisappearingLine](https://user-images.githubusercontent.com/4639110/108351983-e6025600-71ee-11eb-8a84-02b338e179a4.gif)

My guess it is somehow related to us triggering redraw upon pointer move / exit.

Not sure if it is correlated but I also get a log of messages like this.

```
C:\Users\...\Documents\GitHub\terminal\src\renderer\base\renderer.cpp(185)\TerminalControl.dll!00007FFB299C87C1: (caller: 00007FFB298CD2CC) ReturnHr(15) tid(904) 80004004 Operation aborted
Msg:[C:\Users\vikhait\Documents\GitHub\terminal\src\inc\til\rectangle.h(839)\TerminalControl.dll!00007FFB29703A6B: (caller: 00007FFB298D0480) Exception(15) tid(904) 80004004 Operation aborted
[til::rectangle::operator struct _SMALL_RECT(!base::MakeCheckedNum(left()).AssignIfValid(&ret.Left))]
] [Microsoft::Console::Render::Renderer::_PaintFrameForEngine]
```

and this

```
C:\Users\...\Documents\GitHub\terminal\src\renderer\dx\DxRenderer.cpp(1468)\TerminalControl.dll!00007FFB298E2BA8: (caller: 00007FFB298CF273) LogHr(349) tid(904) 80070102 The wait operation timed out.
Msg:[Waiting for swap chain frame latency waitable object returned error or timeout.] [Microsoft::Console::Render::DxEngine::WaitUntilCanRender(ret)]
```
where the `WaitForSingleObjectEx` on `_swapChainFrameLatencyWaitableObject` within `DxEngine::WaitUntilCanRender()` gets `STATUS_TIMEOUT`.

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

Reproduce the two-pane PowerShell scenario while moving the pointer between panes, then inspect the redraw path in src/renderer/base/renderer.cpp. Review the rectangle conversion noted in src/inc/til/rectangle.h and the frame-latency handling in src/renderer/dx/DxRenderer.cpp, especially DxEngine::WaitUntilCanRender(). Done means pane lines no longer disappear during focus and link hover changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, powershell
Domain
computer-graphics, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.