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

Implement snap-on-input for conhost #17453

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lhecker
Copy link
Member

@lhecker lhecker commented Jun 20, 2024

Once COOKED_READ_DATA uses VT sequences to position the cursor,
nothing will snap the viewport back to the prompt line anymore.
The same problem already exists with WSL. Unfortunately, the inbox
conhost in build ~26100 has the same issue.

This PR implements a "snap on input" functionality similar to the one
in Windows Terminal by ignoring control keys and otherwise snapping
the viewport to the current cursor position. This is slightly different
to Windows Terminal however, because it should actually snap to the
virtual viewport position instead. The benefit of this difference is
that the diff is way small which hopefully makes backporting easier.

@lhecker lhecker added Product-Conhost For issues in the Console codebase Area-Input Related to input processing (key presses, mouse, etc.) labels Jun 20, 2024
@lhecker lhecker added this to To Cherry Pick in Inbox Servicing Pipeline via automation Jun 20, 2024
@lhecker
Copy link
Member Author

lhecker commented Jun 20, 2024

I've implemented snapping to the virtual viewport on input here: dc0f798

I cannot quite decide what behavior is better though. If we snap to the virtual viewport then this will affect scroll-forward in conhost because it'll snap even if you're slightly scrolled down by a few lines.

@DHowett
Copy link
Member

DHowett commented Jun 20, 2024

Notes from chat: i think we agreed on, "don't snap if the cursor is anywhere in view" (?)

@zadjii-msft zadjii-msft added this to the Terminal v1.22 milestone Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Input Related to input processing (key presses, mouse, etc.) Product-Conhost For issues in the Console codebase
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants