Skip to content

Commit d5b339f

Browse files
committed
Revert changes made to GetGestureString
Given the use of key.KeyChar, the original implementation is now portable.
1 parent 1facd95 commit d5b339f

1 file changed

Lines changed: 0 additions & 19 deletions

File tree

src/Microsoft.PowerShell.PSReadLine/ConsoleLib.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -386,24 +386,6 @@ public static string ToGestureString(this ConsoleKeyInfo key)
386386
sb.Append("Alt");
387387
}
388388

389-
#if UNIX
390-
if (sb.Length > 0)
391-
sb.Append("+");
392-
// TODO: find better way to map these characters to something more friendly
393-
if ((key.Key >= ConsoleKey.D0 && key.Key <= ConsoleKey.D9)
394-
|| (key.Key >= ConsoleKey.Oem1 && key.Key <= ConsoleKey.Oem8))
395-
{
396-
sb.Append(key.KeyChar);
397-
}
398-
else
399-
{
400-
if (key.Modifiers.HasFlag(ConsoleModifiers.Shift))
401-
{
402-
sb.Append("Shift+");
403-
}
404-
sb.Append(key.Key);
405-
}
406-
#else
407389
char c = key.KeyChar;
408390
if (char.IsControl(c) || char.IsWhiteSpace(c))
409391
{
@@ -423,7 +405,6 @@ public static string ToGestureString(this ConsoleKeyInfo key)
423405
sb.Append("+");
424406
sb.Append(c);
425407
}
426-
#endif
427408
return sb.ToString();
428409
}
429410
}

0 commit comments

Comments
 (0)