Screen text is not invalidated on "screen" detached #7803

Closed
opened 2026-01-31 01:12:59 +00:00 by claunia · 16 comments
Owner

Originally created by @vadimkantorov on GitHub (Apr 29, 2020).

I have ssh+screen setup. When I detach screen, sometimes Terminal (last release) resets the current line, but keeps the old text on the screen. I'm still figuring out a proper repro.

image

Originally created by @vadimkantorov on GitHub (Apr 29, 2020). I have ssh+screen setup. When I detach screen, sometimes Terminal (last release) resets the current line, but keeps the old text on the screen. I'm still figuring out a proper repro. ![image](https://user-images.githubusercontent.com/1041752/80601843-a33c7b00-8a2e-11ea-8740-e8af2d8f1239.png)
claunia added the Issue-QuestionNeeds-Tag-FixResolution-Answered labels 2026-01-31 01:12:59 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Apr 29, 2020):

@vadimkantorov When you're in this state, if you select the text that's left over from screen, will it just disappear on it's own? That might help us debug the source of this.

EDIT: also, could you provide which number is the "last release"? There's an update that's flowing out right now, so it's impossible to know which of the 0.11 releases this is

@zadjii-msft commented on GitHub (Apr 29, 2020): @vadimkantorov When you're in this state, if you _select_ the text that's left over from screen, will it just disappear on it's own? That might help us debug the source of this. EDIT: also, could you provide which number is the "last release"? There's an update that's flowing out right now, so it's impossible to know which of the 0.11 releases this is
Author
Owner

@vadimkantorov commented on GitHub (Apr 29, 2020):

Version: 0.11.1121.0.
Thanks for advice about selection - I'll check

@vadimkantorov commented on GitHub (Apr 29, 2020): Version: 0.11.1121.0. Thanks for advice about selection - I'll check
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 29, 2020):

Are you using SSH 7.7? They’ve got a bug that causes this exact behavior, as well as occasionally duplicating the MOTD when you log in.

@DHowett-MSFT commented on GitHub (Apr 29, 2020): Are you using SSH 7.7? They’ve got a bug that causes this exact behavior, as well as occasionally duplicating the MOTD when you log in.
Author
Owner

@vadimkantorov commented on GitHub (Apr 29, 2020):

I use WSLv1 + Ubuntu 18.04.2 LTS + OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017 (output of ssh -V)

@vadimkantorov commented on GitHub (Apr 29, 2020): I use WSLv1 + Ubuntu 18.04.2 LTS + `OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017` (output of `ssh -V`)
Author
Owner

@AmericanY commented on GitHub (Apr 30, 2020):

@DHowett-MSFT I've the same issue since I've used the new terminal.

Current Version: Version: 0.11.1191.0

I'm over SSH connection and the terminal usually repeat last line. and sometimes it's placing the mouse within previous text and once typing it's overwriting it.

image

@AmericanY commented on GitHub (Apr 30, 2020): @DHowett-MSFT I've the same issue since I've used the new terminal. Current Version: `Version: 0.11.1191.0` I'm over `SSH` connection and the terminal usually repeat last line. and sometimes it's placing the mouse within previous text and once typing it's overwriting it. ![image](https://user-images.githubusercontent.com/27644047/80664685-b9caec80-8a97-11ea-9ded-e9c150014c3b.png)
Author
Owner

@vadimkantorov commented on GitHub (Apr 30, 2020):

On "Version: 0.11.1191.0":

image

@zadjii-msft selection does not disappear:
image

@vadimkantorov commented on GitHub (Apr 30, 2020): On "Version: 0.11.1191.0": ![image](https://user-images.githubusercontent.com/1041752/80711219-4acdb200-8af0-11ea-9f6d-d400ef8504ce.png) @zadjii-msft selection does not disappear: ![image](https://user-images.githubusercontent.com/1041752/80711432-a1d38700-8af0-11ea-9a02-0e79dc4be9a4.png)
Author
Owner

@vadimkantorov commented on GitHub (Apr 30, 2020):

Maybe this happens when ssh connections breaks

@vadimkantorov commented on GitHub (Apr 30, 2020): Maybe this happens when ssh connections breaks
Author
Owner

@zadjii-msft commented on GitHub (Apr 30, 2020):

Well it's totally expected if the ssh connection breaks - screen wouldn't have a chance to clean up the terminal's state if the connection was broken abruptly.

@zadjii-msft commented on GitHub (Apr 30, 2020): Well it's totally expected if the `ssh` connection breaks - `screen` wouldn't have a chance to clean up the terminal's state if the connection was broken abruptly.
Author
Owner

@DHowett-MSFT commented on GitHub (May 1, 2020):

Puzzling, I just tried a bunch of different versions of OpenSSH and I can only repro it with Win32-OpenSSH_7.7.

image
(working, 8.2)

image
(working, 8.1)

image
(failing, windows ssh, under tap)

@DHowett-MSFT commented on GitHub (May 1, 2020): Puzzling, I just tried a bunch of different versions of OpenSSH and I can _only_ repro it with Win32-OpenSSH_7.7. ![image](https://user-images.githubusercontent.com/14316954/80770203-83778680-8b04-11ea-86e3-d21e2997910e.png) (working, 8.2) ![image](https://user-images.githubusercontent.com/14316954/80770300-c0dc1400-8b04-11ea-8a03-5ad7f2e9cc0e.png) (working, 8.1) ![image](https://user-images.githubusercontent.com/14316954/80770227-912d0c00-8b04-11ea-9c64-c7374260c4e3.png) (failing, windows ssh, under tap)
Author
Owner

@DHowett-MSFT commented on GitHub (May 1, 2020):

It's unfortunately impossible to restore the terminal's state properly when the application on the other end hangs up and leaves it inconsistent. Screen restores the cursor position (and the main buffer) as part of teardown, and if it never actually tears down on the wire the terminal will always be left in a weird state.

@DHowett-MSFT commented on GitHub (May 1, 2020): It's unfortunately impossible to restore the terminal's state properly when the application on the other end hangs up and leaves it inconsistent. Screen restores the cursor position (and the main buffer) as part of teardown, and if it never actually tears down on the wire the terminal will _always_ be left in a weird state.
Author
Owner

@AmericanY commented on GitHub (May 1, 2020):

@DHowett-MSFT

But i never lost the SSH connection. let me explain for you what exactly i do. maybe it's will help.

  1. I'm using Windows New Terminal with PowerShell profile. and this before i connect to my server via SSH.

image

  1. Now am connected to the server.

image

  1. Now i started screen and detached it.

image

As you can see am still connected but the detached lines repeated twice but sometimes not. and there's a time when it's override the last recent CMD.

@AmericanY commented on GitHub (May 1, 2020): @DHowett-MSFT But i never lost the `SSH` connection. let me explain for you what exactly i do. maybe it's will help. 1. I'm using `Windows New Terminal` with `PowerShell` profile. and this before i connect to my server via `SSH`. ![image](https://user-images.githubusercontent.com/27644047/80771105-a3359b80-8b52-11ea-93f0-8cc6c78ecf43.png) 2. Now am connected to the `server`. ![image](https://user-images.githubusercontent.com/27644047/80771182-e0019280-8b52-11ea-85c5-a427f63d3d7f.png) 3. Now i started screen and `detached` it. ![image](https://user-images.githubusercontent.com/27644047/80771232-0aebe680-8b53-11ea-86f9-8f6f13caa387.png) As you can see am still connected but the `detached ` lines repeated twice but sometimes not. and there's a time when it's override the last recent `CMD`.
Author
Owner

@AmericanY commented on GitHub (May 1, 2020):

@DHowett-MSFT Oh, it's happened now.

see it

image

@AmericanY commented on GitHub (May 1, 2020): @DHowett-MSFT Oh, it's happened now. see it ![image](https://user-images.githubusercontent.com/27644047/80771352-8188e400-8b53-11ea-9d9a-17577630d914.png)
Author
Owner

@DHowett-MSFT commented on GitHub (May 1, 2020):

image

This is the problem. This was resolved with https://github.com/PowerShell/Win32-OpenSSH/issues/1253 which should be released as part of the Win32_OpenSSH update coming later in the Windows release cycle. 😄

@DHowett-MSFT commented on GitHub (May 1, 2020): ![image](https://user-images.githubusercontent.com/14316954/80771347-0f3ee200-8b08-11ea-866b-1ba547b56b85.png) This is the problem. This was resolved with https://github.com/PowerShell/Win32-OpenSSH/issues/1253 which should be released as part of the Win32_OpenSSH update coming later in the Windows release cycle. :smile:
Author
Owner

@AmericanY commented on GitHub (May 1, 2020):

Here what i meant with overriding @DHowett-MSFT

image

@AmericanY commented on GitHub (May 1, 2020): Here what i meant with overriding @DHowett-MSFT ![image](https://user-images.githubusercontent.com/27644047/80771399-a3826680-8b53-11ea-811d-143b2d0c722c.png)
Author
Owner

@DHowett-MSFT commented on GitHub (May 1, 2020):

I understand. Thank you.

@DHowett-MSFT commented on GitHub (May 1, 2020): **I understand. Thank you.**
Author
Owner

@AmericanY commented on GitHub (May 1, 2020):

@DHowett-MSFT you welcome.

@AmericanY commented on GitHub (May 1, 2020): @DHowett-MSFT you welcome.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7803