Skip to content

Instantly share code, notes, and snippets.

@QiangF
Created April 25, 2025 07:04
Show Gist options
  • Select an option

  • Save QiangF/a8de949fef0cd2748c6dcf17fd334d78 to your computer and use it in GitHub Desktop.

Select an option

Save QiangF/a8de949fef0cd2748c6dcf17fd334d78 to your computer and use it in GitHub Desktop.
Debugger entered--Lisp error: (args-out-of-range " " 0 -143)
term-emulate-terminal(#<process mistty tty *mistty*> "\33[47h\33[?7l\33[?1000h\33[?1002h\33[?1006h\33[44A\33[G\33[K\15\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m ...")
(progn (fset 'term--handle-colors-list vnew) (fset 'term-buffer-vertical-motion vnew) (mistty-log "RECV[%s]" str) (term-emulate-terminal proc str))
(unwind-protect (progn (fset 'term--handle-colors-list vnew) (fset 'term-buffer-vertical-motion vnew) (mistty-log "RECV[%s]" str) (term-emulate-terminal proc str)) (fset 'term--handle-colors-list old) (fset 'term-buffer-vertical-motion old))
(let* ((vnew #'(lambda (count) (let ((start-point ...) (res ...)) (setq res (- count res)) (if (and ... ... ... ...) (progn ...)) res))) (vnew (let ((real-handle-colors-list (symbol-function 'term--handle-colors-list))) #'(lambda (parameters) (funcall real-handle-colors-list parameters) (setq term-current-face (mistty--clear-term-face-value term-current-face))))) (old (symbol-function 'term--handle-colors-list)) (old (symbol-function 'term-buffer-vertical-motion)) (inhibit-read-only t)) (unwind-protect (progn (fset 'term--handle-colors-list vnew) (fset 'term-buffer-vertical-motion vnew) (mistty-log "RECV[%s]" str) (term-emulate-terminal proc str)) (fset 'term--handle-colors-list old) (fset 'term-buffer-vertical-motion old)))
mistty--emulate-terminal(#<process mistty tty *mistty*> "\33[47h\33[?7l\33[?1000h\33[?1002h\33[?1006h\33[44A\33[G\33[K\15\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m ...")
funcall(mistty--emulate-terminal #<process mistty tty *mistty*> "\33[47h\33[?7l\33[?1000h\33[?1002h\33[?1006h\33[44A\33[G\33[K\15\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m ...")
(if (string-empty-p data) nil (funcall dest proc data) (setq needs-postprocessing t))
#f(lambda () [(data "\33[47h\33[?7l\33[?1000h\33[?1002h\33[?1006h\33[44A\33[G\33[K\15\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[44A\15\33[44B\15\33[;m \15\33[;1;38;5;110m>\33[0m\33[;38;5;110m \33[0m\33[;1m\33[0m\33[;1m\33[0m\33[1A\15\33[;1;38;5;148m\342\240\207\33[0m\33[;m \33[;38;5;144m0/0\33[0m\33[;38;5;59m \33[0m\33[;38;5;59m\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\33[0m\33[;m \33[1B\15\33[2C\33[1A\15\33[;m \33[;m \33[;38;5;144m17/17\33[0m\33[;38;5;59m \33[0m\33[;38;5;59m\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\342\224\200\33[0m\33[;m \33[1A\15\33[;1;38;5;161;48;5;236m\342\226\214\33[0m\33[;48;5;236m \33[0m\33[;1;38;5;254;48;5;236mdir\33[0m\33[;m \15\33[150C\33[;m \15\33[150C\33[1A\15\33[;48;5;236m \33[0m\33[;m \33[;mmistty-accum.el\33[0m\33[;m \15\33[150C\33[;m \15\33[150C\33[1A\15\33[;48;5;236m \33[0m\33[;m \33[;mmistty-accum-macros.el\33[0m\33[;m \15\33[150C\33[;m \15\33[150C\33[1A\15\33[;48;5;236m \33[0m\33[;m \33[;mmistty-autoloads.el\33[0m\33[;m \15\33[150C\33[;m \15\33[150C\33[1A\15\33[;48;5;236m \33[0m\33[;m \33[;mmistty-changeset.el\33[0m\33[;m \15\33[150C\33[;m \15\33[150C\33[1A\15\33[;48;5;236m \33[0m\33[;m \33[;mmistty.el\33[0m\33[;m \15\33[150C\33[;m \15\33[150C\33[1A\15\33[;48;5;236m \33[0m\33[;m \33[;mmistty.info\33[0m\33[;m \15\33[150C\33[;m \15\33[150C\33[1A\15\33[;48;5;236m \33[0m\33[;m \33[;mmistty-launch.el\33[0m\33[;m \15\33[150C\33[;m \15\33[150C\33[1A\15\33[;48;5;236m \33[0m\33[;m \33[;mmistty-log.el\33[0m\33[;m \15\33[150C\33[;m \15\33[150C\33[1A\15\33[;48;5;236m \33[0m\33[;m \33[;mmistty-osc7.el\33[0m\33[;m \15\33[150C\33[;m \15\33[150C\33[1A\15\33[;48;5;236m \33[0m\33[;m \33[;mmistty-osc-colors.el\33[0m\33[;m \15\33[150C\33[;m \15\33[150C\33[1A\15\33[;48;5;236m \33[0m\33[;m \33[;mmistty-pkg.el\33[0m\33[;m \15\33[150C\33[;m \15\33[150C\33[1A\15\33[;48;5;236m \33[0m\33[;m \33[;mmistty-project.el\33[0m\33[;m \15\33[150C\33[;m \15\33[150C\33[1A\15\33[;48;5;236m \33[0m\33[;m \33[;mmistty-queue.el\33[0m\33[;m \15\33[150C\33[;m \15\33[150C\33[1A\15\33[;48;5;236m \33[0m\33[;m \33[;mmistty-term.el\33[0m\33[;m \15\33[150C\33[;m \15\33[150C\33[1A\15\33[;48;5;236m \33[0m\33[;m \33[;mmistty-undo.el\33[0m\33[;m \15\33[150C\33[;m \15\33[150C\33[1A\15\33[;48;5;236m \33[0m\33[;m \33[;mmistty-util.el\33[0m\33[;m \15\33[150C\33[;m \15\33[150C\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[1A\15\33[;m \15\33[44B\15\33[2C\33[?7h\33[?7l\15\33[2C\33[?7h") (proc #<process mistty tty *mistty*>) (needs-postprocessing nil) (dest mistty--emulate-terminal)] (if (string-empty-p data) nil (funcall dest proc data) (setq needs-postprocessing t)))()
funcall(#f(lambda () [(data "\33[47h\33[?7l\33[?1000h\33[?1002h\33[?1006h\33[44A\33[G\33[K\15\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m ...") (proc #<process mistty tty *mistty*>) (needs-postprocessing nil) (dest mistty--emulate-terminal)] (if (string-empty-p data) nil (funcall dest proc data) (setq needs-postprocessing t))))
(progn (let ((tail (reverse wrappers))) (while tail (let ((wrapper (car tail))) (setq func (let ((f func)) #'(lambda nil ...))) (setq tail (cdr tail))))) (funcall func))
#f(lambda (wrappers func) [t] (progn (let ((tail (reverse wrappers))) (while tail (let ((wrapper (car tail))) (setq func (let ((f func)) #'(lambda nil (funcall wrapper f)))) (setq tail (cdr tail))))) (funcall func)))(nil #f(lambda () [(data "\33[47h\33[?7l\33[?1000h\33[?1002h\33[?1006h\33[44A\33[G\33[K\15\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33...") (proc #<process mistty tty *mistty*>) (needs-postprocessing nil) (dest mistty--emulate-terminal)] (if (string-empty-p data) nil (funcall dest proc data) (setq needs-postprocessing t))))
funcall(#f(lambda (wrappers func) [t] (progn (let ((tail (reverse wrappers))) (while tail (let (...) (setq func ...) (setq tail ...)))) (funcall func))) nil #f(lambda () [(data "\33[47h\33[?7l\33[?1000h\33[?1002h\33[?1006h\33[44A\33[G\33[K\15\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m ...") (proc #<process mistty tty *mistty*>) (needs-postprocessing nil) (dest mistty--emulate-terminal)] (if (string-empty-p data) nil (funcall dest proc data) (setq needs-postprocessing t))))
(let ((data (funcall --cl-fifo-to-string-- processed))) (funcall --cl-run-wrapped-- around-process-filter #'(lambda nil (if (string-empty-p data) nil (funcall dest proc data) (setq needs-postprocessing t)))))
#f(lambda (proc) [(--cl-run-wrapped-- #f(lambda (wrappers func) [t] (progn (let ((tail (reverse wrappers))) (while tail (let ((wrapper (car tail))) (setq func (let ((f func)) #'(lambda nil (funcall wrapper f)))) (setq tail (cdr tail))))) (funcall func)))) (--cl-fifo-to-string-- #f(lambda (fifo) [t] (let ((lst (mistty--fifo-to-list fifo))) (let* ((val (length lst))) (cond ((eql val 0) (let nil "")) ((eql val 1) (let nil (car lst))) (t (let nil (mapconcat #'identity lst)))))))) (needs-postprocessing nil) (processed #s(mistty--fifo :newest nil :oldest nil)) (around-process-filter nil) (dest mistty--emulate-terminal)] (let ((data (funcall --cl-fifo-to-string-- processed))) (funcall --cl-run-wrapped-- around-process-filter #'(lambda nil (if (string-empty-p data) nil (funcall dest proc data) (setq needs-postprocessing t))))))(#<process mistty tty *mistty*>)
funcall(#f(lambda (proc) [(--cl-run-wrapped-- #f(lambda (wrappers func) [t] (progn (let (...) (while tail ...)) (funcall func)))) (--cl-fifo-to-string-- #f(lambda (fifo) [t] (let ((lst ...)) (let* (...) (cond ... ... ...))))) (needs-postprocessing nil) (processed #s(mistty--fifo :newest nil :oldest nil)) (around-process-filter nil) (dest mistty--emulate-terminal)] (let ((data (funcall --cl-fifo-to-string-- processed))) (funcall --cl-run-wrapped-- around-process-filter #'(lambda nil (if (string-empty-p data) nil (funcall dest proc data) (setq needs-postprocessing t)))))) #<process mistty tty *mistty*>)
(progn (funcall --cl-process-data-- proc) (funcall --cl-flush-- proc) (funcall --cl-post-process-- proc))
(if (funcall --cl-toplevel-accumulator-p-- proc) (progn (funcall --cl-process-data-- proc) (funcall --cl-flush-- proc) (funcall --cl-post-process-- proc)))
#[(proc data) ((if t nil reset-f add-processor-f add-post-processor-f add-around-f) (mistty--fifo-enqueue unprocessed data) (setq unprocessed-bytes (+ unprocessed-bytes (length data))) (if (funcall --cl-toplevel-accumulator-p-- proc) (progn (funcall --cl-process-data-- proc) (funcall --cl-flush-- proc) (funcall --cl-post-process-- proc)))) ((reset-f . #[nil ((progn (setq post-processors nil) (setq processors nil) (setq around-process-filter nil) (setq processors-dirty t))) ((processors-dirty) (processors #s(mistty--accum-processor "\33\\[\\(?:47\\|\\?\\(?:104[79]\\|47\\)\\)l" ("\33" "\33\\[" "\33\\[\\?104" "\33\\[\\?10" "\33\\[\\?1" "\33\\[\\?" "\33\\[\\?4" "\33\\[4" "\33\\[\\(?:47\\|\\?\\(?:104[79]\\|47\\)\\)") #[(ctx str) ((mistty--accum-ctx-push-down ctx "\33[47l") (mistty--accum-ctx-flush ctx) (mistty--leave-fullscreen proc)) ((proc . #<process mistty tty *mistty*>))]) #s(mistty--accum-processor "\33\\[\\?25l" ("\33" "\33\\[" "\33\\[\\?" "\33\\[\\?2" "\33\\[\\?25") #[(_ _) ((mistty-log "Hide cursor") (let ((buf buf)) (if (buffer-live-p buf) (progn (save-current-buffer (set-buffer buf) (mistty-log "Hide cursor in %s" major-mode) (mistty--hide-cursor)))))) ((buf . #<buffer *mistty*>))]) #s(mistty--accum-processor "\33\\[\\?25h" ("\33" "\33\\[" "\33\\[\\?" "\33\\[\\?2" "\33\\[\\?25") #[(_ _) ((mistty-log "Show cursor") (let ((buf buf)) (if (buffer-live-p buf) (progn (save-current-buffer (set-buffer buf) (mistty-log "Show Cursor in %s" major-mode) (mistty--show-cursor)))))) ((buf . #<buffer *mistty*>))]) #s(mistty--accum-processor "\33[=>]" ("\33") ignore) #s(mistty--accum-processor "\33][0-9]*;[^\0-\7\16-\37\177]*\\(?:\7\\|\33\\\\\\)" ("\33" "\33]" "\33][0-9]*" "\33][0-9]*;" "\33][0-9]*;[^\0-\7\16-\37\177]*" "\33][0-9]*;[^\0-\7\16-\37\177]*\33") #[(ctx arg0) ((progn (ignore (stringp arg0)) (let* ((x148 (let ((s arg0)) (and (string-match "\33]\\(?1:[0-9]*\\);\\(?2:[^\0-\7\16-\37\177]*\\)\\(?:\7\\|\33\\\\\\)" s) (cons (match-string 1 s) (match-string 2 s)))))) (progn (ignore (consp x148)) (let* ((x149 (car-safe x148)) (x150 (cdr-safe x148))) (let ((code x149) (text x150)) (let* ((handler (and t (cdr (assoc-string code mistty-osc-handlers))))) (if handler (progn (mistty--accum-ctx-flush ctx) (let ((inhibit-modification-hooks t) (inhibit-read-only t)) (funcall handler code (decode-coding-string text locale-coding-system t)))) nil)))))))) (t)])) (around-process-filter) (post-processors))]) (add-processor-f . #[(processor) ((progn (setq processors (cons processor processors)) (setq processors-dirty t))) ((processors-dirty) (processors #s(mistty--accum-processor "\33\\[\\(?:47\\|\\?\\(?:104[79]\\|47\\)\\)l" ("\33" "\33\\[" "\33\\[\\?104" "\33\\[\\?10" "\33\\[\\?1" "\33\\[\\?" "\33\\[\\?4" "\33\\[4" "\33\\[\\(?:47\\|\\?\\(?:104[79]\\|47\\)\\)") #[(ctx str) ((mistty--accum-ctx-push-down ctx "\33[47l") (mistty--accum-ctx-flush ctx) (mistty--leave-fullscreen proc)) ((proc . #<process mistty tty *mistty*>))]) #s(mistty--accum-processor "\33\\[\\?25l" ("\33" "\33\\[" "\33\\[\\?" "\33\\[\\?2" "\33\\[\\?25") #[(_ _) ((mistty-log "Hide cursor") (let ((buf buf)) (if (buffer-live-p buf) (progn (save-current-buffer (set-buffer buf) (mistty-log "Hide cursor in %s" major-mode) (mistty--hide-cursor)))))) ((buf . #<buffer *mistty*>))]) #s(mistty--accum-processor "\33\\[\\?25h" ("\33" "\33\\[" "\33\\[\\?" "\33\\[\\?2" "\33\\[\\?25") #[(_ _) ((mistty-log "Show cursor") (let ((buf buf)) (if (buffer-live-p buf) (progn (save-current-buffer (set-buffer buf) (mistty-log "Show Cursor in %s" major-mode) (mistty--show-cursor)))))) ((buf . #<buffer *mistty*>))]) #s(mistty--accum-processor "\33[=>]" ("\33") ignore) #s(mistty--accum-processor "\33][0-9]*;[^\0-\7\16-\37\177]*\\(?:\7\\|\33\\\\\\)" ("\33" "\33]" "\33][0-9]*" "\33][0-9]*;" "\33][0-9]*;[^\0-\7\16-\37\177]*" "\33][0-9]*;[^\0-\7\16-\37\177]*\33") #[(ctx arg0) ((progn (ignore (stringp arg0)) (let* ((x148 (let ((s arg0)) (and (string-match "\33]\\(?1:[0-9]*\\);\\(?2:[^\0-\7\16-\37\177]*\\)\\(?:\7\\|\33\\\\\\)" s) (cons (match-string 1 s) (match-string 2 s)))))) (progn (ignore (consp x148)) (let* ((x149 (car-safe x148)) (x150 (cdr-safe x148))) (let ((code x149) (text x150)) (let* ((handler (and t (cdr (assoc-string code mistty-osc-handlers))))) (if handler (progn (mistty--accum-ctx-flush ctx) (let ((inhibit-modification-hooks t) (inhibit-read-only t)) (funcall handler code (decode-coding-string text locale-coding-system t)))) nil)))))))) (t)])))]) (add-post-processor-f . #[(post-processor) ((setq post-processors (cons post-processor post-processors))) ((post-processors))]) (add-around-f . #[(func) ((setq around-process-filter (cons func around-process-filter))) ((around-process-filter))]) (--cl-process-data-- . #[(proc) ((while (not (mistty--fifo-empty-p unprocessed)) (let ((data (concat incomplete (funcall --cl-fifo-to-string-- unprocessed)))) (setq unprocessed-bytes 0) (setq incomplete nil) (while (not (string-empty-p data)) (funcall --cl-update-processor-regexps--) (if (and overall-processor-regexp (string-match overall-processor-regexp data)) (let* ((before (substring data 0 (match-beginning 0))) (matching (substring data (match-beginning 0) (match-end 0))) (processor (let* ((i 1) (--cl-var-- processors) (p nil) (--cl-flag-- t) --cl-var--) (while (and (consp --cl-var--) (progn (setq p (car --cl-var--)) (setq --cl-flag-- (not (setq --cl-var-- (if (match-beginning i) (progn p))))))) (setq i (+ i 1)) (setq --cl-var-- (cdr --cl-var--))) --cl-var--))) (setq data (substring data (match-end 0))) (if (string-empty-p before) nil (funcall --cl-push-down-- before)) (let ((buf (process-buffer proc))) (if (buffer-live-p buf) (progn (save-current-buffer (set-buffer buf) (catch 'mistty-abort-processor (funcall (let* ((cl-x processor)) (progn (or (let* ((cl-x cl-x)) (progn (and (memq (type-of cl-x) cl-struct-mistty--accum-processor-tags) t))) (signal 'wrong-type-argument (list 'mistty--accum-processor cl-x))) (aref cl-x 3))) (let ((flush-f #'(lambda nil (funcall --cl-flush-- proc) (if (buffer-live-p (process-buffer proc)) nil (throw 'mistty-abort-processor nil)))) (push-down-f --cl-push-down--) (look-back-f --cl-look-back--)) (progn (record 'mistty--accum-ctx flush-f push-down-f look-back-f))) matching))))))) (if (and overall-hold-back-regexp (string-match overall-hold-back-regexp data)) (progn (setq incomplete (match-string 0 data)) (setq data (substring data 0 (match-beginning 0)))) (let* ((val (mistty--split-incomplete-chars data))) (progn (ignore (consp val)) (let* ((x107 (car-safe val)) (x108 (cdr-safe val))) (progn (setq data x107) (setq incomplete x108)))))) (funcall --cl-push-down-- data) (setq data "")))))) ((--cl-look-back-- . #[nil ((let* ((len (ring-length look-back-ring)) (str (make-string len 0))) (let* ((i 0) (--cl-var-- len)) (while (< i --cl-var--) (let* ((v str) (v i)) (aset v v (ring-ref look-back-ring (- len i 1)))) (setq i (+ i 1))) nil) str)) ((look-back-ring 2 8 . [55 104 91 50 67 27 91 63]))]) (--cl-push-down-- . #[(str) ((progn (let ((len (length str))) (let* ((i (max 0 (- len (ring-size look-back-ring)))) (--cl-var-- len)) (while (< i --cl-var--) (ring-insert look-back-ring (aref str i)) (setq i (+ i 1))) nil)) (mistty--fifo-enqueue processed str))) ((look-back-ring 2 8 . [55 104 91 50 67 27 91 63]) (processed . #s(mistty--fifo nil nil)))]) (--cl-update-processor-regexps-- . #[nil ((if processors-dirty (progn (setq overall-processor-regexp (funcall --cl-build-overall-processor-regexp--)) (setq overall-hold-back-regexp (funcall --cl-build-overall-hold-back-regexp--)) (setq processors-dirty nil)))) ((--cl-build-overall-hold-back-regexp-- . #[nil ((let ((regexps nil)) (let ((tail processors)) (while tail (let ((p (car tail))) (let ((tail (let* ((cl-x p)) (progn (or (let* ((cl-x cl-x)) (progn (and (memq (type-of cl-x) cl-struct-mistty--accum-processor-tags) t))) (signal 'wrong-type-argument (list 'mistty--accum-processor cl-x))) (aref cl-x 2))))) (while tail (let ((r (car tail))) (setq regexps (if (member r regexps) regexps (cons r regexps))) (setq tail (cdr tail))))) (setq tail (cdr tail))))) (if regexps (progn (concat "\\(?:" (mapconcat #'identity regexps "\\|") "\\)\\'"))))) ((processors #s(mistty--accum-processor "\33\\[\\(?:47\\|\\?\\(?:104[79]\\|47\\)\\)l" ("\33" "\33\\[" "\33\\[\\?104" "\33\\[\\?10" "\33\\[\\?1" "\33\\[\\?" "\33\\[\\?4" "\33\\[4" "\33\\[\\(?:47\\|\\?\\(?:104[79]\\|47\\)\\)") #[(ctx str) ((mistty--accum-ctx-push-down ctx "\33[47l") (mistty--accum-ctx-flush ctx) (mistty--leave-fullscreen proc)) ((proc . #<process mistty tty *mistty*>))]) #s(mistty--accum-processor "\33\\[\\?25l" ("\33" "\33\\[" "\33\\[\\?" "\33\\[\\?2" "\33\\[\\?25") #[(_ _) ((mistty-log "Hide cursor") (let ((buf buf)) (if (buffer-live-p buf) (progn (save-current-buffer (set-buffer buf) (mistty-log "Hide cursor in %s" major-mode) (mistty--hide-cursor)))))) ((buf . #<buffer *mistty*>))]) #s(mistty--accum-processor "\33\\[\\?25h" ("\33" "\33\\[" "\33\\[\\?" "\33\\[\\?2" "\33\\[\\?25") #[(_ _) ((mistty-log "Show cursor") (let ((buf buf)) (if (buffer-live-p buf) (progn (save-current-buffer (set-buffer buf) (mistty-log "Show Cursor in %s" major-mode) (mistty--show-cursor)))))) ((buf . #<buffer *mistty*>))]) #s(mistty--accum-processor "\33[=>]" ("\33") ignore) #s(mistty--accum-processor "\33][0-9]*;[^\0-\7\16-\37\177]*\\(?:\7\\|\33\\\\\\)" ("\33" "\33]" "\33][0-9]*" "\33][0-9]*;" "\33][0-9]*;[^\0-\7\16-\37\177]*" "\33][0-9]*;[^\0-\7\16-\37\177]*\33") #[(ctx arg0) ((progn (ignore (stringp arg0)) (let* ((x148 (let ((s arg0)) (and (string-match "\33]\\(?1:[0-9]*\\);\\(?2:[^\0-\7\16-\37\177]*\\)\\(?:\7\\|\33\\\\\\)" s) (cons (match-string 1 s) (match-string 2 s)))))) (progn (ignore (consp x148)) (let* ((x149 (car-safe x148)) (x150 (cdr-safe x148))) (let ((code x149) (text x150)) (let* ((handler (and t (cdr (assoc-string code mistty-osc-handlers))))) (if handler (progn (mistty--accum-ctx-flush ctx) (let ((inhibit-modification-hooks t) (inhibit-read-only t)) (funcall handler code (decode-coding-string text locale-coding-system t)))) nil)))))))) (t)])))]) (--cl-build-overall-processor-regexp-- . #[nil ((if processors (progn (let ((index 0)) (mapconcat #'(lambda (p) (setq index (1+ index)) (format "\\(?%d:%s\\)" index (let* ((cl-x p)) (progn (or (let* ((cl-x cl-x)) (progn (and (memq (type-of cl-x) cl-struct-mistty--accum-processor-tags) t))) (signal 'wrong-type-argument (list 'mistty--accum-processor cl-x))) (aref cl-x 1))))) processors "\\|"))))) ((processors #s(mistty--accum-processor "\33\\[\\(?:47\\|\\?\\(?:104[79]\\|47\\)\\)l" ("\33" "\33\\[" "\33\\[\\?104" "\33\\[\\?10" "\33\\[\\?1" "\33\\[\\?" "\33\\[\\?4" "\33\\[4" "\33\\[\\(?:47\\|\\?\\(?:104[79]\\|47\\)\\)") #[(ctx str) ((mistty--accum-ctx-push-down ctx "\33[47l") (mistty--accum-ctx-flush ctx) (mistty--leave-fullscreen proc)) ((proc . #<process mistty tty *mistty*>))]) #s(mistty--accum-processor "\33\\[\\?25l" ("\33" "\33\\[" "\33\\[\\?" "\33\\[\\?2" "\33\\[\\?25") #[(_ _) ((mistty-log "Hide cursor") (let ((buf buf)) (if (buffer-live-p buf) (progn (save-current-buffer (set-buffer buf) (mistty-log "Hide cursor in %s" major-mode) (mistty--hide-cursor)))))) ((buf . #<buffer *mistty*>))]) #s(mistty--accum-processor "\33\\[\\?25h" ("\33" "\33\\[" "\33\\[\\?" "\33\\[\\?2" "\33\\[\\?25") #[(_ _) ((mistty-log "Show cursor") (let ((buf buf)) (if (buffer-live-p buf) (progn (save-current-buffer (set-buffer buf) (mistty-log "Show Cursor in %s" major-mode) (mistty--show-cursor)))))) ((buf . #<buffer *mistty*>))]) #s(mistty--accum-processor "\33[=>]" ("\33") ignore) #s(mistty--accum-processor "\33][0-9]*;[^\0-\7\16-\37\177]*\\(?:\7\\|\33\\\\\\)" ("\33" "\33]" "\33][0-9]*" "\33][0-9]*;" "\33][0-9]*;[^\0-\7\16-\37\177]*" "\33][0-9]*;[^\0-\7\16-\37\177]*\33") #[(ctx arg0) ((progn (ignore (stringp arg0)) (let* ((x148 (let ((s arg0)) (and (string-match "\33]\\(?1:[0-9]*\\);\\(?2:[^\0-\7\16-\37\177]*\\)\\(?:\7\\|\33\\\\\\)" s) (cons (match-string 1 s) (match-string 2 s)))))) (progn (ignore (consp x148)) (let* ((x149 (car-safe x148)) (x150 (cdr-safe x148))) (let ((code x149) (text x150)) (let* ((handler (and t (cdr (assoc-string code mistty-osc-handlers))))) (if handler (progn (mistty--accum-ctx-flush ctx) (let ((inhibit-modification-hooks t) (inhibit-read-only t)) (funcall handler code (decode-coding-string text locale-coding-system t)))) nil)))))))) (t)])))]) (overall-hold-back-regexp . "\\(?:\33][0-9]*;[^\0-\7\16-\37\177]*\33\\|\33][0-9]*;[^\0-\7\16-\37\177]*\\|\33][0-9]*;\\|\33][0-9]*\\|\33]\\|\33\\[\\?25\\|\33\\[\\?2\\|\33\\[\\(?:47\\|\\?\\(?:104[79]\\|47\\)\\)\\|\33\\[4\\|\33\\[\\?4\\|\33\\[\\?\\|\33\\[\\?1\\|\33\\[\\?10\\|\33\\[\\?104\\|\33\\[\\|\33\\)\\'") (overall-processor-regexp . "\\(?1:\33\\[\\(?:47\\|\\?\\(?:104[79]\\|47\\)\\)l\\)\\|\\(?2:\33\\[\\?25l\\)\\|\\(?3:\33\\[\\?25h\\)\\|\\(?4:\33[=>]\\)\\|\\(?5:\33][0-9]*;[^\0-\7\16-\37\177]*\\(?:\7\\|\33\\\\\\)\\)") (processors-dirty))]) (--cl-flush-- . #[(proc) ((let ((data (funcall --cl-fifo-to-string-- processed))) (funcall --cl-run-wrapped-- around-process-filter #'(lambda nil (if (string-empty-p data) nil (funcall dest proc data) (setq needs-postprocessing t)))))) ((--cl-run-wrapped-- . #[(wrappers func) ((progn (let ((tail (reverse wrappers))) (while tail (let ((wrapper (car tail))) (setq func (let ((f func)) #'(lambda nil (funcall wrapper f)))) (setq tail (cdr tail))))) (funcall func))) (t)]) (--cl-fifo-to-string-- . #[(fifo) ((let ((lst (mistty--fifo-to-list fifo))) (let* ((val (length lst))) (cond ((eql val 0) (let nil "")) ((eql val 1) (let nil (car lst))) (t (let nil (mapconcat #'identity lst))))))) (t)]) (needs-postprocessing) (processed . #s(mistty--fifo nil nil)) (around-process-filter) (dest . mistty--emulate-terminal))]) (--cl-fifo-to-string-- . #[(fifo) ((let ((lst (mistty--fifo-to-list fifo))) (let* ((val (length lst))) (cond ((eql val 0) (let nil "")) ((eql val 1) (let nil (car lst))) (t (let nil (mapconcat #'identity lst))))))) (t)]) (overall-hold-back-regexp . "\\(?:\33][0-9]*;[^\0-\7\16-\37\177]*\33\\|\33][0-9]*;[^\0-\7\16-\37\177]*\\|\33][0-9]*;\\|\33][0-9]*\\|\33]\\|\33\\[\\?25\\|\33\\[\\?2\\|\33\\[\\(?:47\\|\\?\\(?:104[79]\\|47\\)\\)\\|\33\\[4\\|\33\\[\\?4\\|\33\\[\\?\\|\33\\[\\?1\\|\33\\[\\?10\\|\33\\[\\?104\\|\33\\[\\|\33\\)\\'") (overall-processor-regexp . "\\(?1:\33\\[\\(?:47\\|\\?\\(?:104[79]\\|47\\)\\)l\\)\\|\\(?2:\33\\[\\?25l\\)\\|\\(?3:\33\\[\\?25h\\)\\|\\(?4:\33[=>]\\)\\|\\(?5:\33][0-9]*;[^\0-\7\16-\37\177]*\\(?:\7\\|\33\\\\\\)\\)") (incomplete) (unprocessed-bytes . 0) (unprocessed . #s(mistty--fifo nil nil)) (processors #s(mistty--accum-processor "\33\\[\\(?:47\\|\\?\\(?:104[79]\\|47\\)\\)l" ("\33" "\33\\[" "\33\\[\\?104" "\33\\[\\?10" "\33\\[\\?1" "\33\\[\\?" "\33\\[\\?4" "\33\\[4" "\33\\[\\(?:47\\|\\?\\(?:104[79]\\|47\\)\\)") #[(ctx str) ((mistty--accum-ctx-push-down ctx "\33[47l") (mistty--accum-ctx-flush ctx) (mistty--leave-fullscreen proc)) ((proc . #<process mistty tty *mistty*>))]) #s(mistty--accum-processor "\33\\[\\?25l" ("\33" "\33\\[" "\33\\[\\?" "\33\\[\\?2" "\33\\[\\?25") #[(_ _) ((mistty-log "Hide cursor") (let ((buf buf)) (if (buffer-live-p buf) (progn (save-current-buffer (set-buffer buf) (mistty-log "Hide cursor in %s" major-mode) (mistty--hide-cursor)))))) ((buf . #<buffer *mistty*>))]) #s(mistty--accum-processor "\33\\[\\?25h" ("\33" "\33\\[" "\33\\[\\?" "\33\\[\\?2" "\33\\[\\?25") #[(_ _) ((mistty-log "Show cursor") (let ((buf buf)) (if (buffer-live-p buf) (progn (save-current-buffer (set-buffer buf) (mistty-log "Show Cursor in %s" major-mode) (mistty--show-cursor)))))) ((buf . #<buffer *mistty*>))]) #s(mistty--accum-processor "\33[=>]" ("\33") ignore) #s(mistty--accum-processor "\33][0-9]*;[^\0-\7\16-\37\177]*\\(?:\7\\|\33\\\\\\)" ("\33" "\33]" "\33][0-9]*" "\33][0-9]*;" "\33][0-9]*;[^\0-\7\16-\37\177]*" "\33][0-9]*;[^\0-\7\16-\37\177]*\33") #[(ctx arg0) ((progn (ignore (stringp arg0)) (let* ((x148 (let ((s arg0)) (and (string-match "\33]\\(?1:[0-9]*\\);\\(?2:[^\0-\7\16-\37\177]*\\)\\(?:\7\\|\33\\\\\\)" s) (cons (match-string 1 s) (match-string 2 s)))))) (progn (ignore (consp x148)) (let* ((x149 (car-safe x148)) (x150 (cdr-safe x148))) (let ((code x149) (text x150)) (let* ((handler (and t (cdr (assoc-string code mistty-osc-handlers))))) (if handler (progn (mistty--accum-ctx-flush ctx) (let ((inhibit-modification-hooks t) (inhibit-read-only t)) (funcall handler code (decode-coding-string text locale-coding-system t)))) nil)))))))) (t)])))]) (--cl-toplevel-accumulator-p-- . #[(proc) ((if processing-pending-output (prog1 nil (let ((duration (time-to-seconds (time-subtract (current-time) processing-pending-output)))) (if (or (>= duration mistty--max-accumulate-delay) (>= unprocessed-bytes mistty--max-accumulate-bytes)) (progn (throw 'mistty-stop-accumlating nil))))) (prog1 t (unwind-protect (progn (setq processing-pending-output (current-time)) (catch 'mistty-stop-accumlating (accept-process-output proc 0 nil 'just-this-one))) (setq processing-pending-output nil))))) ((processing-pending-output) (unprocessed-bytes . 0))]) (--cl-post-process-- . #[(proc) ((if needs-postprocessing (progn (setq needs-postprocessing nil) (let ((tail (reverse post-processors))) (while tail (let ((p (car tail))) (let ((buf (process-buffer proc))) (if (buffer-live-p buf) (progn (save-current-buffer (set-buffer buf) (funcall p))))) (setq tail (cdr tail)))))))) ((needs-postprocessing) (post-processors))]) (--cl-flush-- . #[(proc) ((let ((data (funcall --cl-fifo-to-string-- processed))) (funcall --cl-run-wrapped-- around-process-filter #'(lambda nil (if (string-empty-p data) nil (funcall dest proc data) (setq needs-postprocessing t)))))) ((--cl-run-wrapped-- . #[(wrappers func) ((progn (let ((tail (reverse wrappers))) (while tail (let ((wrapper (car tail))) (setq func (let ((f func)) #'(lambda nil (funcall wrapper f)))) (setq tail (cdr tail))))) (funcall func))) (t)]) (--cl-fifo-to-string-- . #[(fifo) ((let ((lst (mistty--fifo-to-list fifo))) (let* ((val (length lst))) (cond ((eql val 0) (let nil "")) ((eql val 1) (let nil (car lst))) (t (let nil (mapconcat #'identity lst))))))) (t)]) (needs-postprocessing) (processed . #s(mistty--fifo nil nil)) (around-process-filter) (dest . mistty--emulate-terminal))]) (unprocessed-bytes . 0) (unprocessed . #s(mistty--fifo nil nil))) nil mistty--accumulator](#<process mistty tty *mistty*> "\33[?1049h\33[?7l\33[?25l\33[?1000h\33[?1002h\33[?1006h\33[44A\33[G\33[K\15\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m \15\33[1B\15\33[;m ...")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment