Skip to content

Commit c90f53f

Browse files
authored
Revert "Set the cursor to the place where a user hits tab key (#7023)"
This reverts commit 8805ca2.
1 parent 6e92e26 commit c90f53f

3 files changed

Lines changed: 5 additions & 19 deletions

File tree

src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHostUserInterfaceProgress.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,6 @@ class ConsoleHostUserInterface : System.Management.Automation.Host.PSHostUserInt
9797
// Update the progress pane only when the timer set up the update flag or WriteProgress is completed.
9898
// As a result, we do not block WriteProgress and whole script and eliminate unnecessary console locks and updates.
9999
_progPane.Show(_pendingProgress);
100-
101-
// Reset the cursor back to where it started
102-
if (record.RecordType == ProgressRecordType.Completed)
103-
{
104-
_progPane.Hide();
105-
}
106100
}
107101
}
108102

src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressPane.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -99,20 +99,12 @@ class ProgressPane
9999

100100
//if the cursor is at the bottom, create screen buffer space by scrolling
101101
int scrollRows = rows - ((_rawui.BufferSize.Height - 1) - _location.Y);
102+
for (int i = 0; i < rows; i++)
103+
{
104+
Console.Out.Write('\n');
105+
}
102106
if (scrollRows > 0)
103107
{
104-
// The following can be possibly replaced by Console.Write ("\x1b[" + scrollRows + "S");
105-
// For details, see https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences
106-
107-
// Scroll the console screen up by 'scrollRows'
108-
var bottomLocation = _location;
109-
bottomLocation.Y = _rawui.BufferSize.Height;
110-
_rawui.CursorPosition = bottomLocation;
111-
for (int i = 0; i < scrollRows; i++)
112-
{
113-
Console.Out.Write('\n');
114-
}
115-
116108
_location.Y -= scrollRows;
117109
_savedCursor.Y -= scrollRows;
118110
}

src/System.Management.Automation/engine/MshCommandRuntime.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2252,7 +2252,7 @@ internal void ThrowIfWriteNotPermitted(bool needsToWriteToPipeline)
22522252
{
22532253
// Only generate these exceptions if a pipeline has already been declared as the 'writing' pipeline.
22542254
// Otherwise, these are probably infrastructure messages and can be ignored.
2255-
if (this.PipelineProcessor?._permittedToWrite != null)
2255+
if (this.PipelineProcessor._permittedToWrite != null)
22562256
{
22572257
throw PSTraceSource.NewInvalidOperationException(
22582258
PipelineStrings.WriteNotPermitted);

0 commit comments

Comments
 (0)