mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-04 00:56:19 +02:00
Properly ignore control characters when adding input in CLI and Terminal processes
This commit is contained in:
@@ -41,8 +41,11 @@ internal class CliProcess() : Process("Cli")
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
currentInput += key.KeyChar;
|
if (!char.IsControl(key.KeyChar))
|
||||||
Console.Write(key.KeyChar);
|
{
|
||||||
|
currentInput += key.KeyChar;
|
||||||
|
Console.Write(key.KeyChar);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public class TerminalProcess : Process
|
|||||||
UpdateDisplay();
|
UpdateDisplay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (keyEvent.KeyChar is >= (char)32 and <= (char)126) // Printable chars
|
else if (!char.IsControl(keyEvent.KeyChar))
|
||||||
{
|
{
|
||||||
currentInput += keyEvent.KeyChar;
|
currentInput += keyEvent.KeyChar;
|
||||||
UpdateDisplay();
|
UpdateDisplay();
|
||||||
|
|||||||
Reference in New Issue
Block a user