Function: shell-filter-ctrl-a-ctrl-b

shell-filter-ctrl-a-ctrl-b is a byte-compiled function defined in shell.el.gz.

Signature

(shell-filter-ctrl-a-ctrl-b STRING)

Documentation

Remove ^A and ^B characters from comint output.

Bash uses these characters as internal quoting characters in its prompt. Due to a bug in some bash versions (including 2.03,
2.04, and 2.05b), they may erroneously show up when bash is
started with the --noediting option and Select Graphic Rendition (SGR) control sequences (formerly known as ANSI escape sequences) are used to color the prompt.

This function can be put on comint-preoutput-filter-functions.

Source Code

;; Defined in /usr/src/emacs/lisp/shell.el.gz
(defun shell-filter-ctrl-a-ctrl-b (string)
  "Remove `^A' and `^B' characters from comint output.

Bash uses these characters as internal quoting characters in its
prompt.  Due to a bug in some bash versions (including 2.03,
2.04, and 2.05b), they may erroneously show up when bash is
started with the `--noediting' option and Select Graphic
Rendition (SGR) control sequences (formerly known as ANSI escape
sequences) are used to color the prompt.

This function can be put on `comint-preoutput-filter-functions'."
  (if (string-match "[\C-a\C-b]" string)
      (replace-regexp-in-string "[\C-a\C-b]" "" string t t)
    string))