Recently Written · git

clic

MIRROR ONLY Gopher client with pretty colours in Common Lisp

git clone https://github.com/equwal/clic

Log | Files | Refs


commit 8605ef1699e170afed26d4266f2bf3db53225e73
Solene Rapenne <solene@perso.pw>
2018-01-11 19:35:44 +0000

Send a string to hide the latest line when scrolling. thx josuah

 clic.lisp | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/clic.lisp b/clic.lisp
index 5fbb137..86617da 100644
--- a/clic.lisp
+++ b/clic.lisp
@@ -543,11 +543,13 @@
                             (get-color 'reset))
                     (force-output)
                     (let ((first-input (read-char)))
-                      (when (not (char= #\NewLine first-input))
-                        (unread-char first-input)
-                        (let ((input-text (format nil "~a" (read-line nil nil))))
-                          (setf input input-text)
-                          (loop-finish))))))
+                      (if (char= #\NewLine first-input)
+			  (format t "'~a[A~a[K" #\Escape #\Escape)
+			(progn
+			  (unread-char first-input)
+			  (let ((input-text (format nil "~a" (read-line nil nil))))
+			    (setf input input-text)
+			    (loop-finish)))))))
 
              ;; in case of shell command, do it
              (if input