emacs-devel
[Top][All Lists]
Advanced

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

Re: comint-output-filter-functions and multi-line input


From: Rudolf Adamkovič
Subject: Re: comint-output-filter-functions and multi-line input
Date: Wed, 19 Oct 2022 01:22:54 +0200

Ihor Radchenko <yantar92@posteo.net> writes:

> #+RESULTS:
> : > > > hello
>   ^ ^ ^
>   excessive empty output lines [...]

Given ...

#### (comint-run "/bin/bash")

... the following ...

#### (with-current-buffer "*bash*"
####   (insert "if true
#### then
#### echo hello
#### fi")
####   (comint-send-input))

... outputs ...

#### $ if true
#### then
#### echo hello
#### fi
#### > > > hello

Not good.

Similarly, ...

#### (with-current-buffer "*bash*"
####   (dolist (line (list "if true"
####                       "then"
####                       "echo hello"
####                       "fi"))
####     (insert line)
####     (comint-send-input)))

... also gives the same output.

(I took this as a minimal working bug reproducer).

After investigating, I found that ...

#### (with-current-buffer "*bash*"
####   (let ((comint-process-echoes t))
####     (dolist (line (list "if true"
####                         "then"
####                         "echo hello"
####                         "fi"))
####       (insert line)
####       (comint-send-input))))

... outputs (perhaps the desired) ...

$ if true
> then
> echo hello
> fi
hello

Would this help?

Rudy
-- 
"Logic is a science of the necessary laws of thought, without which no
employment of the understanding and the reason takes place."
-- Immanuel Kant, 1785

Rudolf Adamkovič <salutis@me.com> [he/him]
Studenohorská 25
84103 Bratislava
Slovakia



reply via email to

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