From 13c92c5cbfd64b36c114eb18f34b3ff3de9aebd9 Mon Sep 17 00:00:00 2001 From: Marco Maccaferri Date: Mon, 18 May 2020 11:49:01 +0200 Subject: [PATCH] Implemented terminal status and cursor position reports --- src/com/maccasoft/tools/Terminal.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/com/maccasoft/tools/Terminal.java b/src/com/maccasoft/tools/Terminal.java index 0b9c7ad..3f81f6e 100644 --- a/src/com/maccasoft/tools/Terminal.java +++ b/src/com/maccasoft/tools/Terminal.java @@ -587,6 +587,20 @@ public class Terminal { font.setBackground(paletteData.colors[background]); break; } + case 'n': + if (args[0] == 5) { + writeByte((byte) 0x1B); + writeByte((byte) '['); + writeByte((byte) '0'); + writeByte((byte) 'n'); + } + else if (args[0] == 6) { + byte[] b = String.format("%c[%d;%dR", 0x1B, cy, cx).getBytes(); + for (int i = 0; i < b.length; i++) { + writeByte(b[i]); + } + } + break; case 's': savedCx = cx; savedCy = cy;