[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
comint-output-filter-functions and multi-line input
From: |
Ihor Radchenko |
Subject: |
comint-output-filter-functions and multi-line input |
Date: |
Sun, 16 Oct 2022 08:48:11 +0000 |
Hello,
I am trying to figure out how to programmatically capture output of a
multi-line bash script in comint buffer.
Consider:
[yantar92:/tmp] $
> if true
> then
> echo "hello"
> fi
hello
Each line is submitted to shell via comint-send-input and, AFAIK, the
result can be collected using `comint-output-filter-functions'.
I expect the `comint-output-filter-functions' to be called on "hello"
line. However, it does not seem to be the case. Empty "" corresponding
to "> " PS2 prompts upon sending incomplete script lines are also
passed.
Is it possible to distinguish the actual script output, empty lines in
the actual script output, and the incomplete prompts?
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
- comint-output-filter-functions and multi-line input,
Ihor Radchenko <=
Re: comint-output-filter-functions and multi-line input, Stefan Monnier, 2022/10/17