You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[serial-console] az serial-console connect stops delivering keystrokes after the terminal is left unfocused/idle; session must be quit and reopened #10612
Describe the bug az serial-console connect to a Linux VM works at first, but after the terminal window has been left unfocused/idle for a while, keystrokes no longer reach the VM. Nothing is echoed, pressing Enter does not redraw the login: prompt, and no error is shown; the client does not exit. The local escape (Ctrl+] then q) still works, and an immediate reconnect works fine — until the next time the window is left.
This appears specific to the CLI client: in our use the Azure portal's Serial Console has not shown this stall, so the service-side session seems fine and the problem looks to be in how the extension keeps (or detects the loss of) its connection.
Related command az serial-console connect -g <resource-group> -n <vm-name>
To Reproduce
az serial-console connect -g <rg> -n <vm> to a running Linux VM (Gen1, boot diagnostics enabled, console=ttyS0,115200n8, serial-getty@ttyS0/agetty).
Confirm it works (login prompt responds to Enter).
Switch to other windows/apps and leave the console untouched for several minutes.
Return and press Enter / type.
Expected behavior
Keystrokes reach the VM, or — if the underlying connection has been closed — the client detects it and exits (or reconnects) with a clear message, instead of silently appearing connected.
Actual behavior
No response to input; the session looks alive but is dead. Must Ctrl+]q and reconnect.
VM-side evidence that input is not arriving
While the client was unresponsive we checked the VM over SSH:
agetty on ttyS0 had been running since boot (no respawns in journalctl -u serial-getty@ttyS0) and was waiting at the login prompt.
stty -F /dev/ttyS0 -a: normal settings (115200 baud).
So the guest is fine; the keystrokes are lost between the client and the guest. A fresh session to the same VM works immediately.
Environment summary
azure-cli 2.91.0 (azure-cli-core 2.91.0), installed via pipx (Python 3.14)
serial-console extension 1.0.0b5
macOS 14.8.8 (Sonoma), Terminal
VM: Ubuntu 26.04.1 LTS, Gen1, region Australia Southeast
Additional context
Since the portal console is unaffected, a likely cause is the extension's websocket going idle or being closed without the client detecting it (no keepalive / no close handling), leaving a session that looks connected but drops input. Expected: keepalives, or detect the closed socket and exit/reconnect with a message. Happy to capture --debug output from a stalled session if that helps.
Activity