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

Always flush conpty before passing-thru a sequence we didn't understand #13462

Closed
wants to merge 6 commits into from

Conversation

zadjii-msft
Copy link
Member

@ghost ghost added Impact-Correctness It be wrong. Issue-Bug It either shouldn't be doing this or needs an investigation. Issue-Task It's a feature request, but it doesn't really need a major design. Priority-1 A description (P1) Product-Conpty For console issues specifically related to conpty labels Jul 8, 2022
@DHowett
Copy link
Member

DHowett commented Jul 8, 2022

This'll definitely help a lot, but we need to be cautious about how we describe it in the release notes. If we get something that is attached to a region of the screen (there are few of those that aren't SGRs, admittedly), we will emit it in the right place once but we'll not be able to retransmit it if we damage that region.

Comment on lines +2483 to 2486
// As of GH#8698, when we return false in ConPTY mode, we'll
// automatically flush the currently buffered frame before passing
// through this sequence.
return false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that these comments are somewhat misleading, since they suggest that these three places are unique in the way they flush the current frame, when in fact it applies to everywhere we're returning false. The only thing special about these cases is that they were historically the only ones that used to work, but I don't think that information is particularly useful going forward is it?

@j4james
Copy link
Collaborator

j4james commented Jul 10, 2022

Btw, I think this could also be considered a fix for #12313. With this PR applied, the test script in #12313 (comment) is now correctly passing through the hide/show cursor sequences (i.e. private mode 25), where previously they were dropped.

DHowett added a commit that referenced this pull request Jul 12, 2022
@DHowett
Copy link
Member

DHowett commented Jul 12, 2022

The tests look doubled-over! And I agree with James: adding those comments doesn't necessarily add value; at this point returning false here does not cause unique behavior.

@zadjii-msft
Copy link
Member Author

<notes>

re:test failures

test failures are about EraseInDisplay. in AdaptDispatch::EraseInDisplay, we currently do one of:

  • erase scrollback, then RETURN FALSE
  • erase all, then RETURN FALSE

to pass the 3J or the 2J through. Problem here is now, if we handle the 2J first, then flush it through, conpty will render a clear viewport, then trigger a 2J. We actually need to like, flush the frame first, then return false to pass the clear through. That would make sure that the current buffer state is synced, then we handle the clear in conpty, then we tell the terminal what changed (which should result in effectively a no op)

Lemme try that.

@zadjii-msft zadjii-msft marked this pull request as draft July 12, 2022 22:04
@github-actions

This comment has been minimized.

@github-actions
Copy link

@check-spelling-bot Report

🔴 Please review

See the 📂 files view or the 📜action log for details.

Unrecognized words (28)
AOn
apimswincoresynchl
AStomps
AString
BGRA
Childitem
CPPARM
cppm
CPPx
Dls
fmix
FNV
HMIDIOUT
intrin
ixx
Jbar
MAKEWORD
notmatch
PLOC
PLOCA
PLOCM
Progman
SHANDLE
SHGFP
umd
WClass
webclient
winsdk
Previously acknowledged words that are now absent aabbcc abbcc ABCDEFGHIJKLMNOPQRSTUVWXY ABORTIFHUNG bgra chaof COLORMATRIX CTRLFREQUENCY CTRLVOLUME CUsers DECARM DECBKM DECCARA DECERA DECFRA DECRARA DECSACE DECSERA DECXCPR DSBCAPS DSBLOCK DSBPLAY DSBUFFERDESC DSBVOLUME dsound DSSCL dxguid ect ENTIREBUFFER eplace Geddy GETKEYSTATE GLOBALFOCUS hicon hrottled icket IWIC lpwfx luma MAPVIRTUALKEY NOTIMEOUTIFNOTHUNG nto otepad ploc ploca plocm Qaabbcc Qxxxxxxxxxxxxxxx SFolder Tdd umul umulh VKKEYSCAN WAVEFORMATEX wic wincodec wyhash wymix wyr xin xinchaof xinxinchaof xwwyzz xxyyzz Zabcdefghijklmnopqrstuvwxyz ZYXWVU ZYXWVUTd :arrow_right:
To accept ✔️ these unrecognized words as correct and remove the previously acknowledged and now absent words, run the following commands

... in a clone of the git@github.com:microsoft/terminal.git repository
on the dev/migrie/b/8698-YOURE-OUT-OF-ORDER branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/v0.0.21/apply.pl' |
perl - 'https://github.com/microsoft/terminal/actions/runs/3568346608/attempts/1'
Errors (1)

See the 📂 files view or the 📜action log for details.

❌ Errors Count
❌ forbidden-pattern 15

See ❌ Event descriptions for more information.

✏️ Contributor please read this

By default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later.

⚠️ The command is written for posix shells. If it doesn't work for you, you can manually add (one word per line) / remove items to expect.txt and the excludes.txt files.

If the listed items are:

  • ... misspelled, then please correct them instead of using the command.
  • ... names, please add them to .github/actions/spelling/allow/names.txt.
  • ... APIs, you can add them to a file in .github/actions/spelling/allow/.
  • ... just things you're using, please add them to an appropriate file in .github/actions/spelling/expect/.
  • ... tokens you only need in one place and shouldn't generally be used, you can add an item in an appropriate file in .github/actions/spelling/patterns/.

See the README.md in each directory for more information.

🔬 You can test your commits without appending to a PR by creating a new branch with that extra change and pushing it to your fork. The check-spelling action will run in response to your push -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. 😉

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

@DHowett
Copy link
Member

DHowett commented Jul 18, 2023

@zadjii-msft was this superseded by the NuShell FTCS change? Or is it unrelated?

@zadjii-msft
Copy link
Member Author

I believe ultimately it was unrelated. For xlinking: #14677.

I'm pretty confident that I did test this scenario with the nushell change (or vice versa), and it didn't work. Notes were in #8698 (comment)

@DHowett
Copy link
Member

DHowett commented Apr 3, 2024

How does this play with Leonard's corking/uncorking work? Is it still necessary?

@zadjii-msft
Copy link
Member Author

This is still open? It went stale years ago

@zadjii-msft zadjii-msft closed this Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Impact-Correctness It be wrong. Issue-Bug It either shouldn't be doing this or needs an investigation. Issue-Task It's a feature request, but it doesn't really need a major design. Priority-1 A description (P1) Product-Conpty For console issues specifically related to conpty
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conpty "pass-through" doesn't maintain order of operations
4 participants