Skip to content

overwritting text #18081

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
phr34k opened this issue Oct 19, 2024 · 2 comments
Open

overwritting text #18081

phr34k opened this issue Oct 19, 2024 · 2 comments
Assignees
Labels
Area-VT Virtual Terminal sequence support Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Conpty For console issues specifically related to conpty

Comments

@phr34k
Copy link

phr34k commented Oct 19, 2024

Windows Terminal version

1.22.2912.0

Windows build number

10.0.22631.0

Other Software

OpenSSH_for_Windows_9.5p1

Steps to reproduce

You can repoduce this bug by opening an the preview version of Windows Terminal. I usually have default profile for pwsh, and once inside of terminal open up an ssh session to a remote windows computer with sshd configured. With the preview version of Windows Terminal, when you type something inside of the ssh session overwrites the text over the current folder i.e. PS C:\Users\Somebody. When switching back to the non-preview version of Windows Terminal and repeating the same steps everything works normally.

Expected Behavior

I expect the terminal not to overwrite to behave in a way it doesn't overwrite current folder i.e. PS C:\Users\Somebody part. Presently, it makes it really hard to execute any commands, especially because pwsh also doesn't support clearing the console buffer (some error about invalid cursor handle, I think this implies it's not using vt escape sequences or terminal is not translating these commands).

Actual Behavior

When you ssd into an windows machine and for example when you type the clear command, it displays on the screen as clear\Users\Somebody>. It doesn't matter what environment you sshd into cmd, powershell, pwsh all had the same problems of overwriting.

@phr34k phr34k added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Oct 19, 2024
@zadjii-msft
Copy link
Member

@lhecker I'm putting this one on you to look at. Looks like there's something weird with openssh 9.5 and the new conpty

@zadjii-msft zadjii-msft added this to the Terminal v1.23 milestone Oct 21, 2024
@zadjii-msft zadjii-msft added the Product-Conpty For console issues specifically related to conpty label Oct 21, 2024
@carlos-zamora
Copy link
Member

Related to #18004

@carlos-zamora carlos-zamora added Area-VT Virtual Terminal sequence support and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Oct 23, 2024
carlos-zamora pushed a commit that referenced this issue Jan 27, 2025
)

As explained in the comment on `_getViewportCursorPosition`, printing
to stdout after initiating a cooked stdin reads is a race condition
between the application and the terminal. But we can significantly
reduce the likelihood of this being obvious with this change.

Related to #18265
Possibly related to #18081

## Validation Steps Performed

Execute the following Go code and start typing:
```go
package main

import (
	"fmt"
	"time"
)

func main() {
	go func() {
		time.Sleep(50 * time.Millisecond)
		fmt.Printf("Here is a prompt! >")
	}()

	var text string
	fmt.Scanln(&text)
}
```

Without this change the prompt will disappear,
and with this change in place, it'll work as expected. ✅
DHowett pushed a commit that referenced this issue Jan 28, 2025
)

As explained in the comment on `_getViewportCursorPosition`, printing
to stdout after initiating a cooked stdin reads is a race condition
between the application and the terminal. But we can significantly
reduce the likelihood of this being obvious with this change.

Related to #18265
Possibly related to #18081

## Validation Steps Performed

Execute the following Go code and start typing:
```go
package main

import (
	"fmt"
	"time"
)

func main() {
	go func() {
		time.Sleep(50 * time.Millisecond)
		fmt.Printf("Here is a prompt! >")
	}()

	var text string
	fmt.Scanln(&text)
}
```

Without this change the prompt will disappear,
and with this change in place, it'll work as expected. ✅

(cherry picked from commit 1040035)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgWppag
Service-Version: 1.22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-VT Virtual Terminal sequence support Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Conpty For console issues specifically related to conpty
Projects
None yet
Development

No branches or pull requests

4 participants