Skip to content

Commit

Permalink
Stop empty sticky scrolls showing on Windows
Browse files Browse the repository at this point in the history
Fixes #199402
  • Loading branch information
Tyriar committed Dec 18, 2023
1 parent 2fc0194 commit 6fb7d0a
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { CancelablePromise, createCancelablePromise } from 'vs/base/common/async
import { debounce, memoize, throttle } from 'vs/base/common/decorators';
import { Event } from 'vs/base/common/event';
import { Disposable, MutableDisposable, combinedDisposable, toDisposable } from 'vs/base/common/lifecycle';
import { removeAnsiEscapeCodes } from 'vs/base/common/strings';
import 'vs/css!./media/stickyScroll';
import { localize } from 'vs/nls';
import { IMenu, IMenuService, MenuId } from 'vs/platform/actions/common/actions';
Expand Down Expand Up @@ -285,6 +286,13 @@ export class TerminalStickyScrollOverlay extends Disposable {
}
});

// If a partial command's sticky scroll would show nothing, just hide it. This is another
// edge case when using a pager or interactive editor.
if (isPartialCommand && removeAnsiEscapeCodes(content).length === 0) {
this._setVisible(false);
return;
}

// Write content if it differs
if (content && this._currentContent !== content) {
this._stickyScrollOverlay.resize(this._stickyScrollOverlay.cols, stickyScrollLineCount);
Expand Down

0 comments on commit 6fb7d0a

Please sign in to comment.