fix(webcrt): resize hop PTY before nested CLI jump

Nested stelnet/telnet captures hop TTY width at start; Netmiko's default 511 cols made mid-line edit redraws wrap and garble in ~80-col WebCRT.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
hansjone 2026-07-30 02:34:25 +00:00
parent b690914f18
commit b540ea21c1
6 changed files with 88 additions and 3 deletions

View file

@ -593,7 +593,11 @@ def create_session(
log_buf = io.BytesIO()
try:
conn = open_netmiko_connection(
creds, session_timeout=connect_timeout, session_log=log_buf
creds,
session_timeout=connect_timeout,
session_log=log_buf,
cols=c,
rows=r,
)
except Exception as exc:
partial = _session_log_text(log_buf).strip()
@ -686,6 +690,7 @@ def create_session(
"cols": sess.cols,
"rows": sess.rows,
"ws_path": f"/v1/webcrt/sessions/{session_id}/ws",
"cli_hop": bool(hop_guard),
}