diff --git a/src/ReadLine/KeyHandler.cs b/src/ReadLine/KeyHandler.cs index 1a97141..0c66803 100644 --- a/src/ReadLine/KeyHandler.cs +++ b/src/ReadLine/KeyHandler.cs @@ -78,7 +78,11 @@ private void WriteNewString(string str) WriteString(str); } - private void WriteChar() => WriteString(_keyInfo.KeyChar.ToString()); + private void WriteChar() + { + if (_keyInfo.KeyChar != '\0') // drop control-keys + WriteString(_keyInfo.KeyChar.ToString()); + } private void WriteString(string c) => WriteString(c, _context.InsertionMode); private void WriteString(string c, bool overwrite)