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

Stop the viewport being moved when in the alt buffer #13039

Merged
1 commit merged into from
May 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/cascadia/TerminalCore/TerminalApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,13 @@ til::rect Terminal::GetViewport() const

void Terminal::SetViewportPosition(const til::point position)
{
const auto dimensions = _GetMutableViewport().Dimensions();
_mutableViewport = Viewport::FromDimensions(position.to_win32_coord(), dimensions);
Terminal::_NotifyScrollEvent();
// The viewport is fixed at 0,0 for the alt buffer, so this is a no-op.
if (!_inAltBuffer())
{
const auto dimensions = _GetMutableViewport().Dimensions();
_mutableViewport = Viewport::FromDimensions(position.to_win32_coord(), dimensions);
Terminal::_NotifyScrollEvent();
}
}

void Terminal::SetTextAttributes(const TextAttribute& attrs)
Expand Down