mirror of
https://github.com/fasteddy516/SimplySerial.git
synced 2024-11-24 10:04:35 +00:00
Don't process virtual terminal sequences in RAW encoding mode
This commit is contained in:
parent
a5f3f36fb6
commit
ad7a3fa920
@ -85,7 +85,15 @@ namespace SimplySerial
|
|||||||
|
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
// load and parse data in boards.json
|
||||||
|
LoadBoards();
|
||||||
|
|
||||||
|
// process all command-line arguments
|
||||||
|
ProcessArguments(args);
|
||||||
|
|
||||||
// attempt to enable virtual terminal escape sequence processing
|
// attempt to enable virtual terminal escape sequence processing
|
||||||
|
if (!convertToPrintable)
|
||||||
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var iStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
|
var iStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
@ -97,12 +105,7 @@ namespace SimplySerial
|
|||||||
{
|
{
|
||||||
// if the above fails, it doesn't really matter - it just means escape sequences won't process nicely
|
// if the above fails, it doesn't really matter - it just means escape sequences won't process nicely
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// load and parse data in boards.json
|
|
||||||
LoadBoards();
|
|
||||||
|
|
||||||
// process all command-line arguments
|
|
||||||
ProcessArguments(args);
|
|
||||||
|
|
||||||
Console.OutputEncoding = encoding;
|
Console.OutputEncoding = encoding;
|
||||||
|
|
||||||
@ -639,7 +642,7 @@ namespace SimplySerial
|
|||||||
string newMessage = "";
|
string newMessage = "";
|
||||||
foreach (byte c in message)
|
foreach (byte c in message)
|
||||||
{
|
{
|
||||||
if ((c > 31 && c < 128) || (c == 8) || (c == 9) || (c == 10) || (c == 13) || (c == 27))
|
if ((c > 31 && c < 128) || (c == 8) || (c == 9) || (c == 10) || (c == 13))
|
||||||
newMessage += (char) c;
|
newMessage += (char) c;
|
||||||
else
|
else
|
||||||
newMessage += $"[{c:X2}]";
|
newMessage += $"[{c:X2}]";
|
||||||
|
Loading…
Reference in New Issue
Block a user