Skip to content

Commit

Permalink
scroll down on keypress, terminate OS commands on any 'non-printable'…
Browse files Browse the repository at this point in the history
… character.
  • Loading branch information
doubleyewdee committed Nov 24, 2018
1 parent 0dd2b39 commit 2b70797
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/ConsoleBuffer/SequenceParser.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace ConsoleBuffer
namespace ConsoleBuffer
{
using System;
using System.Text;
Expand Down Expand Up @@ -172,12 +172,12 @@ private ParserAppendResult AppendControlSequence(int character)

private ParserAppendResult AppendOSCommand(int character)
{
switch (character)
if (character < 0x20)
{
case '\a':
case '\0':
return this.CompleteCommand(new Commands.OS(this.buffer.ToString()));
default:
}
else
{
this.buffer.Append((char)character); // XXX: nukes astral plane support for giganto unicode characters. care later.
return ParserAppendResult.Pending;
}
Expand Down
1 change: 1 addition & 0 deletions src/condo/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ private void OnLoaded(object sender, RoutedEventArgs e)
};

this.KeyDown += this.keyHandler.OnKeyDown;
this.KeyDown += (_, args) => this.screen.VerticalOffset = double.MaxValue; // force scroll on keypress.
this.TextInput += this.keyHandler.OnTextInput;

this.console.PropertyChanged += (_, args) =>
Expand Down

0 comments on commit 2b70797

Please sign in to comment.