From 38b0999238fac2a63e6979506c46cc5dc02d5ab0 Mon Sep 17 00:00:00 2001 From: "Matthew R. Wilson" Date: Mon, 26 May 2025 20:00:38 -0700 Subject: [PATCH] Don't reset MDT when not clearing screen --- screen.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/screen.go b/screen.go index c0065f3..552b678 100644 --- a/screen.go +++ b/screen.go @@ -226,7 +226,14 @@ func showScreenInternal(screen Screen, values map[string]string, } else { b.WriteByte(0xf1) // Write to terminal } - b.WriteByte(0xc3) // WCC = Reset, Unlock Keyboard, Reset MDT + if clear { + b.WriteByte(0xc3) // WCC = Reset, Unlock Keyboard, Reset MDT + } else { + // Don't clear modified data tag if we're not clearing the screen; + // we still want the client to send any data a user has modified + // in fields. + b.WriteByte(0xc2) // WCC = Reset, Unlock Keyboard (*no* reset MDT) + } // Build the commands for each field on the screen for _, fld := range screen {