SSH then running a reset caused blank space #9083

Closed
opened 2026-01-31 01:45:31 +00:00 by claunia · 8 comments
Owner

Originally created by @NathanR1225 on GitHub (Jun 17, 2020).

Environment

Win 10
Windows Terminal Version: 1.0.1401.0

Any other software?
SSH?

Steps to reproduce

  1. SSH into Linux using power shell or Ubuntu terminal
  2. run some commands (to full console )
  3. run reset to clear console
    Show example in images

Expected behavior

When running reset the console should clear like it does but put the next line at the top of the screen.

Actual behavior

Used SSH to log into a piece of hardware running linux. When I ran the reset command it clears the screen but adds a blank new line above the terminal line. resizing the terminal from full screen to partial screen then back to full screen does remove some new lines. Seen in Power shell and Ubuntu terminal.
image
image

Originally created by @NathanR1225 on GitHub (Jun 17, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment Win 10 Windows Terminal Version: 1.0.1401.0 Any other software? SSH? # Steps to reproduce 1. SSH into Linux using power shell or Ubuntu terminal 2. run some commands (to full console ) 3. run reset to clear console Show example in images # Expected behavior When running reset the console should clear like it does but put the next line at the top of the screen. # Actual behavior Used SSH to log into a piece of hardware running linux. When I ran the reset command it clears the screen but adds a blank new line above the terminal line. resizing the terminal from full screen to partial screen then back to full screen does remove some new lines. Seen in Power shell and Ubuntu terminal. ![image](https://user-images.githubusercontent.com/63110047/84912193-2a00f200-b087-11ea-963f-41caa5c7a138.png) ![image](https://user-images.githubusercontent.com/63110047/84912224-36854a80-b087-11ea-8fbd-41b1351f7024.png)
Author
Owner

@DHowett commented on GitHub (Jun 17, 2020):

Would you mind sharing the output of...

infocmp | grep "rs[123]"

in a session where reset is acting up?

@DHowett commented on GitHub (Jun 17, 2020): Would you mind sharing the output of... ```bash infocmp | grep "rs[123]" ``` in a session where `reset` is acting up?
Author
Owner

@NathanR1225 commented on GitHub (Jun 17, 2020):

Command was run in Ubuntu terminal

rs1=\Ec\E]104\007, rs2=\E[!p\E[?3;4l\E[4l\E>, sc=\E7,
@NathanR1225 commented on GitHub (Jun 17, 2020): Command was run in Ubuntu terminal ``` rs1=\Ec\E]104\007, rs2=\E[!p\E[?3;4l\E[4l\E>, sc=\E7, ```
Author
Owner

@j4james commented on GitHub (Jun 18, 2020):

This is because AdaptDispatch::EraseInDisplay returns false in conpty mode, which prevents the remaining steps of the AdaptDispatch::HardReset method being executed. That include the cursor position not being reset to 1,1 so the conhost cursor ends up out of sync with the conpty client.

I can't help thinking this passthrough approach is wrong - I mean idea of "failing" in conpty mode as a way to trigger a passthrough. I'm also not convinced that we should be aborting command sequences (like HardReset) on the first failure. I'd much rather we just continued executing everything, and accumulated the failure status.

So instead of:

if (success)
{
    success = _EraseScrollback();
}

we could just have:

success = _EraseScrollback() && success;

That at least should fix this particular problem.

@j4james commented on GitHub (Jun 18, 2020): This is because `AdaptDispatch::EraseInDisplay` returns false in conpty mode, which prevents the remaining steps of the `AdaptDispatch::HardReset` method being executed. That include the cursor position not being reset to 1,1 so the conhost cursor ends up out of sync with the conpty client. I can't help thinking this passthrough approach is wrong - I mean idea of "failing" in conpty mode as a way to trigger a passthrough. I'm also not convinced that we should be aborting command sequences (like `HardReset`) on the first failure. I'd much rather we just continued executing everything, and accumulated the failure status. So instead of: ```cpp if (success) { success = _EraseScrollback(); } ``` we could just have: ```cpp success = _EraseScrollback() && success; ``` That at least should fix this particular problem.
Author
Owner

@DHowett commented on GitHub (Jun 18, 2020):

I also find the failure=passthrough behavior somewhat suspect. 😄

@DHowett commented on GitHub (Jun 18, 2020): I also find the failure=passthrough behavior somewhat suspect. :smile:
Author
Owner

@DHowett commented on GitHub (Jun 18, 2020):

Thanks for digging into this!

@DHowett commented on GitHub (Jun 18, 2020): Thanks for digging into this!
Author
Owner

@ghost commented on GitHub (Jul 21, 2020):

:tada:This issue was addressed in #6763, which has now been successfully released as Windows Terminal v1.1.2021.0.🎉

Handy links:

@ghost commented on GitHub (Jul 21, 2020): :tada:This issue was addressed in #6763, which has now been successfully released as `Windows Terminal v1.1.2021.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.1.2021.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Jul 22, 2020):

:tada:This issue was addressed in #6763, which has now been successfully released as Windows Terminal v1.1.2021.0.🎉

Handy links:

@ghost commented on GitHub (Jul 22, 2020): :tada:This issue was addressed in #6763, which has now been successfully released as `Windows Terminal v1.1.2021.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.1.2021.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Jul 22, 2020):

:tada:This issue was addressed in #6763, which has now been successfully released as Windows Terminal Preview v1.2.2022.0.🎉

Handy links:

@ghost commented on GitHub (Jul 22, 2020): :tada:This issue was addressed in #6763, which has now been successfully released as `Windows Terminal Preview v1.2.2022.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.2.2022.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9083