Clear Buffer is broken in Windows Terminal Preview (1.22.2362.0) #22227

Closed
opened 2026-01-31 08:07:08 +00:00 by claunia · 3 comments
Owner

Originally created by @valiko-ua on GitHub (Sep 5, 2024).

Windows Terminal version

1.22.2362.0

Windows build number

10.0.22631.4037

Steps to reproduce

  • Settings -> Actions -> Add New -> Add "Ctrl+l" (lowercase L) for "Clear Buffer". Press Save.
  • Open tab with "Command Prompt".
  • Execute "cd C:\Windows". Execute "dir" several times to fill the screen.
  • Press Ctrl+l (lowercase L).

Expected Behavior

Clear Buffer works fine in Windows Terminal v.1.20.11781.0.

Actual Behavior

Clear Buffer does not work in Windows Terminal Preview v.1.22.2362.0.

The same problem can be reproduced with "Ubuntu 24.04 LTS" tab (WSL2).

I've just noticed that pressing Ctrl+Shift+L works differently from Ctrl+L (but still broken). And I didn't assign Ctrl+Shift+L to anything.

Originally created by @valiko-ua on GitHub (Sep 5, 2024). ### Windows Terminal version 1.22.2362.0 ### Windows build number 10.0.22631.4037 ### Steps to reproduce * Settings -> Actions -> Add New -> Add "Ctrl+l" (lowercase L) for "Clear Buffer". Press Save. * Open tab with "Command Prompt". * Execute "cd C:\Windows". Execute "dir" several times to fill the screen. * Press Ctrl+l (lowercase L). ### Expected Behavior Clear Buffer works fine in Windows Terminal v.1.20.11781.0. ### Actual Behavior Clear Buffer does not work in Windows Terminal Preview v.1.22.2362.0. The same problem can be reproduced with "Ubuntu 24.04 LTS" tab (WSL2). I've just noticed that pressing Ctrl+Shift+L works differently from Ctrl+L (but still broken). And I didn't assign Ctrl+Shift+L to anything.
Author
Owner

@zadjii-msft commented on GitHub (Sep 5, 2024):

@lhecker Didn't we fix this during the original #17510? I could have swore that I filed that, but I can't find it now

@zadjii-msft commented on GitHub (Sep 5, 2024): @lhecker Didn't we fix this during the original #17510? I could have swore that I filed that, but I can't find it now
Author
Owner

@elsaco commented on GitHub (Sep 6, 2024):

@valiko-ua it's not the key binding. In 1.22.2362 the Clear buffer doesn't work. Fill the buffer with data and invoke the command via ctrl+shift+p. It won't clear the buffer!

@elsaco commented on GitHub (Sep 6, 2024): @valiko-ua it's not the key binding. In `1.22.2362` the `Clear buffer` doesn't work. Fill the buffer with data and invoke the command via `ctrl+shift+p`. It won't clear the buffer!
Author
Owner

@j4james commented on GitHub (Sep 7, 2024):

I think the problem is explained by the comment here:

544452dad4/src/cascadia/TerminalControl/ControlCore.cpp (L2232-L2238)

In the past when you asked conpty to clear its buffer, the vtengine would have pushed back an update that also cleared the buffer in the connected terminal, but that's not happening anymore. On the conhost side, the ClearBuffer signal is handled here:

544452dad4/src/host/PtySignalInputThread.cpp (L185-L201)

Which just calls the SCREEN_INFORMATION class here:

544452dad4/src/host/screenInfo.cpp (L2142-L2162)

That's just going to clear the conhost buffer. As far as I can see, there's nothing in that code that will emit sequences to sync it up with the terminal buffer.

@j4james commented on GitHub (Sep 7, 2024): I think the problem is explained by the comment here: https://github.com/microsoft/terminal/blob/544452dad41d05b865f1fa1d665397befaa9ec2b/src/cascadia/TerminalControl/ControlCore.cpp#L2232-L2238 In the past when you asked conpty to clear its buffer, the vtengine would have pushed back an update that also cleared the buffer in the connected terminal, but that's not happening anymore. On the conhost side, the `ClearBuffer` signal is handled here: https://github.com/microsoft/terminal/blob/544452dad41d05b865f1fa1d665397befaa9ec2b/src/host/PtySignalInputThread.cpp#L185-L201 Which just calls the `SCREEN_INFORMATION` class here: https://github.com/microsoft/terminal/blob/544452dad41d05b865f1fa1d665397befaa9ec2b/src/host/screenInfo.cpp#L2142-L2162 That's just going to clear the conhost buffer. As far as I can see, there's nothing in that code that will emit sequences to sync it up with the terminal buffer.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#22227