mirror of
https://github.com/hansjone/netx.git
synced 2026-10-14 22:20:50 +08:00
Improve WebCRT connect UX and terminal input handling.
Open shells asynchronously with clearer prompt settling, fix Telnet CRLF expansion, and add right-click paste with safer focus behavior. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
1463652dbb
commit
3b45d6abe3
8 changed files with 108 additions and 71 deletions
|
|
@ -89,10 +89,8 @@ def map_network_cli_enter(data: str, conn: ConnectHandler | None) -> str:
|
|||
if not text:
|
||||
return text
|
||||
ret = channel_return(conn)
|
||||
if ret == "\r":
|
||||
return text
|
||||
# Prefer replacing CRLF first so Telnet RETURN \\r\\n does not double-expand.
|
||||
return text.replace("\r\n", ret).replace("\r", ret)
|
||||
# Replace once: chained replacements expand the CR in Telnet CRLF again.
|
||||
return re.sub(r"\r\n|\r|\n", lambda _match: ret, text)
|
||||
|
||||
|
||||
def _drain_channel(conn: ConnectHandler, *, rounds: int = 6, wait: float = 0.06) -> str:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue