Skip to content

Commit bf36369

Browse files
powercodelzybkr
authored andcommitted
Always display special characters (#667)
Many of these are behind `AltGr` and we can't reliably determine when `AltGr` is needed.
1 parent b83522b commit bf36369

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

PSReadLine/Keys.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,12 @@ internal static int GetNormalizedHashCode(this ConsoleKeyInfo obj)
551551

552552
internal static bool ShouldInsert(this ConsoleKeyInfo key)
553553
{
554-
if (key.KeyChar == '\0') return false;
555-
554+
var keyChar = key.KeyChar;
555+
if (keyChar == '\0') return false;
556+
foreach (char c in "`~!@#$%^&*()-_=+[{]}\\|;:'\",<.>/?") {
557+
// we always want to insert chars essential to the PowerShell experience
558+
if (keyChar == c) { return true; }
559+
}
556560
if (key.Modifiers != 0)
557561
{
558562
// We want to ignore control sequences - but distinguishing a control sequence

0 commit comments

Comments
 (0)