mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-09-27 22:30:11 +03:00
Merge pull request #2633 from GNS3/revert-2628-console
Revert "Fix QEMU serial console artifacts by filtering ANSI CPR responses in …"
This commit is contained in:
commit
cd51afb01f
@ -20,7 +20,6 @@ import socket
|
|||||||
import asyncio
|
import asyncio
|
||||||
import asyncio.subprocess
|
import asyncio.subprocess
|
||||||
import struct
|
import struct
|
||||||
import re
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -58,7 +57,6 @@ NAWS = 31 # Negotiate About Window Size
|
|||||||
LINEMO = 34 # Line Mode
|
LINEMO = 34 # Line Mode
|
||||||
|
|
||||||
READ_SIZE = 1024
|
READ_SIZE = 1024
|
||||||
CPR_RESPONSE = re.compile(br"\x1b\[[0-9]{1,4}(;[0-9]{1,4})?R")
|
|
||||||
|
|
||||||
|
|
||||||
class TelnetConnection(object):
|
class TelnetConnection(object):
|
||||||
@ -288,11 +286,6 @@ class AsyncioTelnetServer:
|
|||||||
if IAC in data:
|
if IAC in data:
|
||||||
data = await self._IAC_parser(data, network_reader, network_writer, connection)
|
data = await self._IAC_parser(data, network_reader, network_writer, connection)
|
||||||
|
|
||||||
# Some terminal clients may send ANSI cursor position reports
|
|
||||||
# (e.g. ESC[1;80R) when attaching to a serial console. Those
|
|
||||||
# responses can show up as spurious characters at the shell prompt.
|
|
||||||
data = CPR_RESPONSE.sub(b"", data)
|
|
||||||
|
|
||||||
if len(data) == 0:
|
if len(data) == 0:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user