emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/eat 1a52dc1dff 1/2: Implement device status report functio


From: ELPA Syncer
Subject: [nongnu] elpa/eat 1a52dc1dff 1/2: Implement device status report function properly
Date: Sat, 22 Jul 2023 01:01:40 -0400 (EDT)

branch: elpa/eat
commit 1a52dc1dffce09f7b98c6f8969bb54aa0d8509c7
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>

    Implement device status report function properly
    
    * eat.el (eat--t-device-status-report): Implement properly.
    Take an argument.
    * eat.el (eat--t-handle-output): Update call to
    'eat--t-device-status-report'.
---
 eat.el | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/eat.el b/eat.el
index 6a0f9135ad..0b27f18ec2 100644
--- a/eat.el
+++ b/eat.el
@@ -1970,14 +1970,20 @@ to (1, 1).  When N is 3, also erase the scrollback."
            ;; Restore point.
            (goto-char pos)))))))
 
-(defun eat--t-device-status-report ()
-  "Send the current Y and X coordinate to client."
-  ;; TODO: Is this really device status report function?
-  (let ((cursor (eat--t-disp-cursor
-                 (eat--t-term-display eat--t-term))))
-    (funcall (eat--t-term-input-fn eat--t-term) eat--t-term
-             (format "\e[%i;%iR" (eat--t-cur-y cursor)
-                     (eat--t-cur-x cursor)))))
+(defun eat--t-device-status-report (n)
+  "Report device (terminal) status.
+
+If N is 5, send OK sequence.  If N is 6, send the current Y and X
+coordinate to client."
+  (pcase n
+    (5
+     (funcall (eat--t-term-input-fn eat--t-term) eat--t-term "\e[0n"))
+    (6
+     (let ((cursor (eat--t-disp-cursor
+                    (eat--t-term-display eat--t-term))))
+       (funcall (eat--t-term-input-fn eat--t-term) eat--t-term
+                (format "\e[%i;%iR" (eat--t-cur-y cursor)
+                        (eat--t-cur-x cursor)))))))
 
 (defun eat--t-set-cursor-state (state)
   "Set cursor state to STATE.
@@ -3218,8 +3224,8 @@ is the selection data encoded in base64."
                       (setq p (cdr p))))
                   (eat--t-set-sgr-params params))
                  ;; CSI 6 n.
-                 ('((?n) nil ((6)))
-                  (eat--t-device-status-report))
+                 (`((?n) nil ((,n)))
+                  (eat--t-device-status-report n))
                  ;; CSI <n> SP q.
                  (`((?q ?\ ) nil ((,n)))
                   (eat--t-set-cursor-style n))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]