Skip to content

Commit a11d24a

Browse files
committed
Fix PC mode detection for non-printable key inputs
Move schedulePCSwitch() call before input classification so all local keystrokes (arrows, enter, backspace, ctrl) trigger the switch back to PC mode, not just printable characters.
1 parent 87ed36a commit a11d24a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,9 @@ func startStdinReader(daemon *Daemon, oldState *term.State) {
390390

391391
char := b[0]
392392

393+
// Any local input means user is on PC
394+
daemon.schedulePCSwitch()
395+
393396
// Track escape sequences
394397
if char == 0x1b { // ESC
395398
lineBuf = ""
@@ -408,7 +411,6 @@ func startStdinReader(daemon *Daemon, oldState *term.State) {
408411
if char >= 32 && char < 127 {
409412
lineBuf += string(char)
410413
daemon.sendToPTY(b)
411-
daemon.schedulePCSwitch()
412414
continue
413415
}
414416

0 commit comments

Comments
 (0)