is the command interpreter mode for interacting with external processes. Using the base comint-mode, Emacs provides derived modes for specific process-in-a-buffer. Common ones are shell, lisp, scheme, cmutex (for TeX and LaTeX). Support for programming languages with REPL interfaces, such as Haskell, are also derived from comint-mode. Such buffers share the same key bindings, shortcuts, and history manipulation facilities.
Questions tagged [comint]
81 questions
13
votes
1 answer
Asynchronously wait for output from a comint process
First of all, a disclaimer. I have researched this many times, and I
am pretty sure that I have already found the answer one way or
another, but I just don't understand it.
My problem is the following:
I have a process running through comint
I want…

T. Verron
- 4,233
- 1
- 22
- 55
12
votes
1 answer
Remembering history between sessions in Inferior Emacs Lisp Mode
I can't make Emacs remember the history for *ielm* buffers between sessions. As far as I can tell, such history is recorded in the buffer-local variable comint-input-ring. Therefore I have added the following expression to my init file:
(setq…

Eleno
- 1,428
- 11
- 17
11
votes
1 answer
Is it possible to read user input from STDIN while tangling a source block?
Is it possible to read user input from STDIN while tangling a source block with org-babel-tangle?
I am aware of this: Org Mode Babel - Interactive code block evaluation.
That doesn't help solve this particular use-case, as it still doesn't allow…

gsl
- 1,742
- 17
- 34
10
votes
1 answer
How do I prevent one subprocess from starving others?
To be clear, I'm not talking about anything that should require emacs to be multithreaded (though that would probably also solve this). To reproduce:
emacs -Q # I'm running 24.4.1
Make a second frame
Switch back to first frame
M-x shell
M-x…

Joseph Garvin
- 2,061
- 8
- 21
10
votes
4 answers
How to make shell-command run using shell profile and current directory hooks (ex. direnv)
I am trying to get shell-command and async-shell-command to integrate seamlessly with a couple of programs in my .bashrc file, specifically direnv in this example.
I found that if I customized shell-command-switch, I could get shell processes to…

waymondo
- 1,384
- 11
- 16
8
votes
1 answer
How should comint-derived modes keep track of buffers and processes?
Having written a couple of custom comint-derived modes, I often find it tricky to decide how to keep track of buffers and processes: for instance, to associate different source buffers with different interpreters. Is it better to keep a reference…
user1968
8
votes
1 answer
Read process output line by line
If there a way to read the output of a subprocess line by line, or at least to get it in small batches?
I have a subprocess doing work in the background, and printing a line every time it completes a task. There are many such small tasks, so I…

Clément
- 3,924
- 1
- 22
- 37
6
votes
0 answers
Return System Notification When Long-running Comint Process Completes?
I often have long-running processes in comint shells (e.g. SQL or fitting statistical models, both usually via an R/ESS shell).
While they're running I navigate away and do something in another buffer, and try to remember to check-back periodically.…

computer_guy
- 61
- 2
6
votes
0 answers
How do I reliably get output from a process?
I have created a comint mode for using mongo. The mode works fine in the buffer, and now I am trying to use it programmatically where I need to get the output from commands.
Getting input to the process works fine. Getting output from the process…

John Kitchin
- 11,555
- 1
- 19
- 41
5
votes
3 answers
savehist the comint input ring
I've got helm installed to work with comint mode either in eshell or when running python in an inferior comint process. I'd like to preserve the command line history, especially in the python mode.
Tried
(setq savehist-additional-variables…

Delta_Fore
- 151
- 3
5
votes
3 answers
Sending `C-c C-c` to the process window without swithcing to it
In ESS mode, I sometimes send some code to the process buffer and want to cancel it using C-c C-c. Can I do this without actually switching to the process window from the script window?

Arktik
- 932
- 4
- 15
5
votes
1 answer
Shell coding system
If, before M-x shell, I run C-x RET c
(universal-coding-system-argument) I can change the coding system used by the shell.
Therefore, given
echo Straße > foo
foo will be encoded in the related CS.
How can I change the coding system after…

antonio
- 1,762
- 12
- 24
5
votes
2 answers
multi line inputs in ipython
Say, I typed
In [1]: def foo(a, b):
...: return a+b
...:
in the normal, non-emacs ipython shell. Pressing the up arrow key afterwards, allows me to get the complete multi-line input back which I then can edit.
In [2]: def foo(a, b):
…

Martin R. Albrecht
- 497
- 3
- 10
4
votes
3 answers
How to determine which program is running inside an emacs shell buffer?
I have an emacs shell buffer which may or may not be running a certain interactive program such as ftp or python. I wish to write a lisp function which will interact with this program, but I would first like to make sure that said program is indeed…

Ruy
- 787
- 4
- 11
4
votes
2 answers
Cargo-process does not accept user input
Using the Emacs mode for Cargo, I'm able to build and run Rust code inside Emacs. However, the terminal that opens when executing cargo-process-run does not accept user input.
For example, when running
use std::io;
fn main() {
let mut input =…

Safron
- 171
- 7