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

Improve startup behavior of CLS (clear screen) and full-screen programs #49

Open
rprichard opened this issue Oct 15, 2015 · 0 comments
Open

Comments

@rprichard
Copy link
Owner

Currently, running console.exe cmd.exe /c cls appears to have no effect:

rprichard@vbwin7 ~
$ console cmd.exe /c cls

rprichard@vbwin7 ~
$

Similarly, if my cursor is in the middle of the screen, and I start winpty on cmd, then press F7, the F7 popup appears at the bottom of the terminal, but the popup always appears in the center of the console:

f7atbottom

This happens because winpty must translate between the console (which is initially entirely blank) and the terminal, which typically has content on startup. winpty could have avoided this issue by clearing the terminal on startup, but that would hurt user experience overall.

So far, I'd considered this issue a limitation, but now I think it might be solvable by initializing the console cursor position to the terminal's cursor position. winpty would need to determine the cursor position at startup, which is possible using the DSR (Device Status Report) escape sequence.

When scraping, winpty wouldn't output the blank lines prior to the initial line. It would only output those lines once they changed, or once the cursor moved into them. Ideally, it would make some effort to shift the lines into the terminal's scrollback -- which I think happens with either Erase Display or Scroll Up.

Things to consider:

  • Are things like Agent::resetConsoleTracking and Terminal::reset affected somehow?
  • The new Windows 10 rewrapping behavior can already result in blank lines at the top of a console window that are not output. Are these situations related somehow?

The idea of blocking startup until the terminal responds to queries also came up with color translation (#45).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant