[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master bdbbc65 5/6: Remove ANSI schmutz from zshdb output
From: |
Rocky Bernstein |
Subject: |
[elpa] master bdbbc65 5/6: Remove ANSI schmutz from zshdb output |
Date: |
Tue, 2 Aug 2016 12:31:36 +0000 (UTC) |
branch: master
commit bdbbc65028af8deb55a4e474be43b5b99e6cc539
Author: rocky <address@hidden>
Commit: rocky <address@hidden>
Remove ANSI schmutz from zshdb output
---
realgud/debugger/zshdb/core.el | 9 +++++++++
realgud/debugger/zshdb/zshdb.el | 20 ++++++++++++++------
test/test-zshdb.el | 4 +++-
3 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/realgud/debugger/zshdb/core.el b/realgud/debugger/zshdb/core.el
index e8c5a6e..20a7cbe 100644
--- a/realgud/debugger/zshdb/core.el
+++ b/realgud/debugger/zshdb/core.el
@@ -157,6 +157,15 @@ Note that path elements have been expanded via
`realgud:expand-file-name-if-exis
realgud:zshdb-minibuffer-history
"sh" "\\.\\(?:z\\)?sh$"))
+(defun realgud:zshdb-remove-ansi-schmutz()
+ "Remove ASCII escape sequences that node.js 'decorates' in
+prompts and interactive output with"
+ (add-to-list
+ 'comint-preoutput-filter-functions
+ (lambda (output)
+ (replace-regexp-in-string "\033\\[\\?[0-9]+[GKJhl]" "" output)))
+ )
+
(defun zshdb-reset ()
"Zshdb cleanup - remove debugger's internal buffers (frame,
breakpoints, etc.)."
diff --git a/realgud/debugger/zshdb/zshdb.el b/realgud/debugger/zshdb/zshdb.el
index 2b07cc1..0812997 100644
--- a/realgud/debugger/zshdb/zshdb.el
+++ b/realgud/debugger/zshdb/zshdb.el
@@ -1,4 +1,4 @@
-;; Copyright (C) 2011, 2014-2015 Free Software Foundation, Inc
+;; Copyright (C) 2011, 2014-2016 Free Software Foundation, Inc
;; Author: Rocky Bernstein <address@hidden>
@@ -14,6 +14,7 @@
(require-relative-list '("../../common/run") "realgud:")
(require-relative-list '("core" "track-mode") "realgud:zshdb-")
+(declare-function realgud:zshdb-remove-ansi-schmutz 'realgud:zshdb-core)
(declare-function zshdb-track-mode (bool))
(declare-function zshdb-query-cmdline 'realgud:zshdb-core)
(declare-function zshdb-parse-cmd-args 'realgud:zshdb-core)
@@ -69,11 +70,18 @@ marginal icons is reset. See `loc-changes-clear-buffer' to
clear
fringe and marginal icons.
"
(interactive)
- (realgud:run-debugger realgud:zshdb-command-name 'zshdb-query-cmdline
- 'zshdb-parse-cmd-args
- 'realgud:zshdb-minibuffer-history
- opt-cmd-line no-reset)
- )
+ (let ((cmd-buf
+ (realgud:run-debugger realgud:zshdb-command-name 'zshdb-query-cmdline
+ 'zshdb-parse-cmd-args
+ 'realgud:zshdb-minibuffer-history
+ opt-cmd-line no-reset)))
+ (if cmd-buf
+ (with-current-buffer cmd-buf
+ ;; FIXME should allow customization whether to do or not
+ ;; and also only do if hook is not already there.
+ (realgud:zshdb-remove-ansi-schmutz)
+ )
+ )))
(defalias 'zshdb 'realgud:zshdb)
diff --git a/test/test-zshdb.el b/test/test-zshdb.el
index 86eb5e5..a908777 100644
--- a/test/test-zshdb.el
+++ b/test/test-zshdb.el
@@ -35,7 +35,9 @@
(assert-equal expanded-name script-filename "file name check")
(assert-equal (list expanded-name "3" "5")
(cdr cmd-args) "command args listified")
- ))
+ )
+ (current-buffer)
+ )
(note "zshdb-parse-cmd-args")
(assert-equal (list nil '("zshdb")
- [elpa] master updated (ad8d826 -> 181d24d), Rocky Bernstein, 2016/08/02
- [elpa] master 2f85d6a 4/6: Merge branch 'master' of github.com:realgud/realgud, Rocky Bernstein, 2016/08/02
- [elpa] master bbb86b7 3/6: Wrong require - thanks stephan, Rocky Bernstein, 2016/08/02
- [elpa] master bf0841a 2/6: Merge pull request #144 from npostavs/nosearch, Rocky Bernstein, 2016/08/02
- [elpa] master bdbbc65 5/6: Remove ANSI schmutz from zshdb output,
Rocky Bernstein <=
- [elpa] master 42bd040 1/6: Don't add subdirectories to load-path, Rocky Bernstein, 2016/08/02
- [elpa] master 181d24d 6/6: Merge commit 'bdbbc65028af8deb55a4e474be43b5b99e6cc539', Rocky Bernstein, 2016/08/02