Skip to content
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
13 changes: 8 additions & 5 deletions src/Microsoft.PowerShell.ConsoleGuiTools/ConsoleGui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,14 @@ private void AddRows(Window win)

public void Dispose()
{
// By emitting this, we fix an issue where arrow keys don't work in the console
// because .NET requires application mode to support Arrow key escape sequences
// Esc[?1h - Set cursor key to application mode
// See http://ascii-table.com/ansi-escape-sequences-vt-100.php
Console.Write("\u001b[?1h");
if (!Console.IsInputRedirected)
{
// By emitting this, we fix an issue where arrow keys don't work in the console
// because .NET requires application mode to support Arrow key escape sequences
// Esc[?1h - Set cursor key to application mode
// See http://ascii-table.com/ansi-escape-sequences-vt-100.php
Console.Write("\u001b[?1h");
}
}
}
}