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

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

[nongnu] elpa/bash-completion 666244383e 296/313: Workaround for command


From: ELPA Syncer
Subject: [nongnu] elpa/bash-completion 666244383e 296/313: Workaround for command-line being echoed.
Date: Sat, 3 Dec 2022 10:59:39 -0500 (EST)

branch: elpa/bash-completion
commit 666244383e33a8af4f28a340940870179259442e
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>

    Workaround for command-line being echoed.
    
    This change introduces some logic for detecting when the command line
    has been echoed, in single-process mode, and to remove that echo before
    processing the output any further.
---
 bash-completion.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/bash-completion.el b/bash-completion.el
index 8a492884bd..c6228a8b00 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -1494,6 +1494,12 @@ Return the status code of the command, as a number."
                 "%s bash-completion process.\nProcess output: <<<EOF\n%sEOF")
                (if bash-completion-use-separate-processes "separate" "single")
                (buffer-string)))
+      (when pre-command
+        ;; Detect the command having been echoed and remove it
+        (save-excursion
+          (goto-char (point-min))
+          (when (looking-at pre-command)
+            (delete-region (match-beginning 0) (line-beginning-position 2)))))
       (let ((status-code (string-to-number
                           (buffer-substring-no-properties
                            (1+ (point))



reply via email to

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