Skip to content
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

RIS doesn't propagate through ConPTY to clear connected terminal #2715

Closed
watzon opened this issue Sep 10, 2019 · 7 comments · Fixed by #4433 or #4909
Closed

RIS doesn't propagate through ConPTY to clear connected terminal #2715

watzon opened this issue Sep 10, 2019 · 7 comments · Fixed by #4433 or #4909
Assignees
Labels
Area-VT Virtual Terminal sequence support Issue-Task It's a feature request, but it doesn't really need a major design. Priority-2 A description (P2) Product-Conpty For console issues specifically related to conpty Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@watzon
Copy link

watzon commented Sep 10, 2019

Environment

Windows build number: Win32NT 10.0.18362.0 Microsoft Windows NT 10.0.18362.0
Windows Terminal version (if applicable): 0.4.2382.0
Ubuntu WSL version: 1804.2019.521.0

Steps to reproduce

Enter printf "\033c" while using WSL in Windows Terminal

Expected behavior

Console should be cleared, as when using any standard Linux terminal

Actual behavior

Nothing changes.

Could be related to #140, but it seems like that has been fixed.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Sep 10, 2019
@zadjii-msft
Copy link
Member

Is this maybe #2307, which was fixed in #2367?

cc @j4james

@zadjii-msft zadjii-msft added the Area-VT Virtual Terminal sequence support label Sep 10, 2019
@j4james
Copy link
Collaborator

j4james commented Sep 10, 2019

@zadjii-msft Yes and no. PR #2367 was just a conhost fix. So while it should improve the behaviour of RIS in the Windows Terminal (e.g. the screen should at least clear), it won't be perfect. Things like the backbuffer clearing would assumedly need special case handling through conpty. I don't know much about that side of things though.

@DHowett-MSFT DHowett-MSFT changed the title printf "\033c" doesn't clear the console RIS and CSI 3 J don't propagate through ConPTY to clear connected terminal Sep 16, 2019
@DHowett-MSFT DHowett-MSFT added Issue-Task It's a feature request, but it doesn't really need a major design. Product-Conpty For console issues specifically related to conpty labels Sep 16, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Sep 16, 2019
@DHowett-MSFT DHowett-MSFT added Help Wanted We encourage anyone to jump in on these. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Sep 16, 2019
@DHowett-MSFT DHowett-MSFT added this to the Console Backlog milestone Sep 16, 2019
zadjii-msft added a commit that referenced this issue Jan 31, 2020
@ghost ghost added the In-PR This issue has a related PR label Jan 31, 2020
@ghost ghost removed the Help Wanted We encourage anyone to jump in on these. label Jan 31, 2020
@ghost ghost closed this as completed in #4433 Feb 10, 2020
ghost pushed a commit that referenced this issue Feb 10, 2020
## Summary of the Pull Request

Conpty doesn't need `CSI 3 J`, it doesn't have a scrollback. The terminal that's connected should use that. This makes conpty pass it through, like other sequences that conpty has no need for.

## References

## PR Checklist
* [x] Closes #2715
* [x] I work here
* [x] Tests added/passed
* [n/a] Requires documentation to be updated
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Feb 10, 2020
@ghost
Copy link

ghost commented Feb 13, 2020

🎉This issue was addressed in #4433, which has now been successfully released as Windows Terminal Preview v0.9.433.0.:tada:

Handy links:

@mixmastamyk
Copy link

This allowed CSI 3 J but seems to have forgotten RIS? It least RIS doesn't seem to work for me on the new build mentioned above.

@studoot
Copy link

studoot commented Feb 16, 2020

And as far as I can tell, the original bug report (printf "\033c" not clearing scrollback in WSL bash) is still the case with the 0.9 build.

@Lemmingh

This comment has been minimized.

@zadjii-msft zadjii-msft reopened this Feb 27, 2020
@zadjii-msft zadjii-msft changed the title RIS and CSI 3 J don't propagate through ConPTY to clear connected terminal RIS doesn't propagate through ConPTY to clear connected terminal Feb 27, 2020
@j4james
Copy link
Collaborator

j4james commented Feb 27, 2020

@Lemmingh The problem of clearing the scrollback in PowerShell and Cmd is covered by another issue (#3126), because Windows applications don't use VT sequences like RIS and CSI 3J. In that case we need to intercept the Windows API calls that are used to clear the scrollback, and then convert them into equivalent VT escape sequences (that's really the whole point of conpty). In a perfect world, fixing those Windows apps would automatically make RIS work as well, but in practice it's probably not that simple.

@cinnamon-msft cinnamon-msft added Priority-2 A description (P2) v1-Scrubbed and removed Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. labels Feb 28, 2020
@zadjii-msft zadjii-msft self-assigned this Mar 12, 2020
zadjii-msft added a commit that referenced this issue Mar 13, 2020
## Summary of the Pull Request

This _actually_ implements `\033c`
([RIS](https://vt100.net/docs/vt220-rm/chapter4.html)) for the Windows Terminal.
I thought I had done this in #4433, but that PR actually only passthrough'd
`\x1b[3J`. I didn't realize at the time that #2715 was mostly about hard reset,
not erase scrollback.

Not only should conpty pass through RIS, but the Terminal should also be
prepared to actually handle that sequence. So this PR adds that support as well.

## References

* #4433: original PR I thought fixed this.

## PR Checklist
* [x] Closes #2715 for real this time
* [x] I work here
* [x] Tests added/passed
* [n/a] Requires documentation to be updated

## Validation Steps Performed

Actually tested `printf \033c` in the Terminal this time
@ghost ghost added the In-PR This issue has a related PR label Mar 13, 2020
@ghost ghost closed this as completed in #4909 Mar 16, 2020
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Mar 16, 2020
ghost pushed a commit that referenced this issue Mar 16, 2020
## Summary of the Pull Request

This _actually_ implements `\033c`
([RIS](https://vt100.net/docs/vt220-rm/chapter4.html)) for the Windows Terminal.
I thought I had done this in #4433, but that PR actually only passthrough'd
`\x1b[3J`. I didn't realize at the time that #2715 was mostly about hard reset,
not erase scrollback.

Not only should conpty pass through RIS, but the Terminal should also be
prepared to actually handle that sequence. So this PR adds that support as well.

## References

* #4433: original PR I thought fixed this.

## PR Checklist
* [x] Closes #2715 for real this time
* [x] I work here
* [x] Tests added/passed
* [n/a] Requires documentation to be updated

## Validation Steps Performed

Actually tested `printf \033c` in the Terminal this time
This issue was closed.
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-Task It's a feature request, but it doesn't really need a major design. Priority-2 A description (P2) Product-Conpty For console issues specifically related to conpty Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
8 participants