Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [comint]

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.

3
votes
1answer
27 views

How to copy output from ess to the kill ring?

Q: how can I automatically copy output from ess to the kill ring? Background I use ess to conduct statistical analysis. On occasion, I need to copy its raw output into another buffer (usually ...
0
votes
1answer
31 views

Shell mode - clear screen but keep scrollback

When using a normal terminal application (like Konsole, for example), I regularly use Control-L or the clear command to clear the terminal's contents, leaving the cursor on the top. When I do this, I ...
0
votes
1answer
30 views

Why isn't the flushed output from my Emacs shell buffer getting into the kill ring?

Following the advice given on p. 121 of Learning GNU Emacs, 2nd Ed., I'm entering the command sequence: C-c C-o, immediately after executing a command in my Emacs shell buffer. And I'm seeing the ...
4
votes
1answer
59 views

How to get rid of flickers in python shell?

In a fresh emacs session, each time I hit enter in inferior-python-mode, the window flickers. This does not happen in shell-mode. One can see the cursor goes to the middle of current window when ...
1
vote
1answer
33 views

How can I have comint buffer input histories betweens different comint sessions?

I'm missing the input histories like what's in IPython. But it seems that the defaults do not keep input histories after the comint buffer is killed. Also I'd like to keep them between emacs sessions.
1
vote
1answer
93 views

Using xonsh as python shell

I'm trying to use xonsh as my python interpreter in Emacs (the one invoked by run-python). I tried to do this by setting python-shell-interpreter to "xonsh". This works, but there are two issues: The ...
0
votes
1answer
27 views

Shell buffer echoes partial long lines

I've written a command that ssh-es to a remote host and runs an interactive command there. Something like: (defun remote-command () (interactive) (pop-to-buffer (get-buffer-create "*remote-...
1
vote
0answers
24 views

comint-input-ring-size ignored in shell-mode

I am trying to change comint-input-ring-size in shell mode in Emacs. The comint-input-file-name is correctly set to ~/.bash_history file which is a big file (around 5000 commands). However, if I set ...
4
votes
0answers
103 views

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 ...
0
votes
0answers
58 views

shell-mode C-c C-c kill keybinding

With some regularity, I am using bash with M-x shell, and out of muscle memory I hit C-c C-c, with dramatic results: the comint prompt streams a long error message with a large number of escaped ...
0
votes
1answer
104 views

Error when trying to advice python-shell-send-string

I'm trying to write advice such that each time I eval a python snippet, it automatically output the exception time in the emacs python shell (defun python-send-with-time-record (orig-func string &...
4
votes
1answer
189 views

(How) can I emulate {eshell,comint}-output-filter-functions in term?

What I want to do from inside a term shell is have a function called when there is new output or a certain regexp (e.g. a prompt) appears in in a term's output. The callback function should then be ...
1
vote
2answers
134 views

Where does the Python shell from `run-python` store its input history?

As in the question title, I want to know where the inferior Python shell stores its command history (the history you cycle through through with the up arrow). I've been searching high and low. I'm ...
0
votes
0answers
39 views

comint-mode problem with C++ style comments (and quotes)?

This is a rephrase of my SO question https://stackoverflow.com/questions/44147993, which didn't receive much attention in SO. Basically, I suspect that I enountered a problem with nodejs-repl.el (...
3
votes
1answer
401 views

How to clear shell in ielm?

I am trying the clear the inferior emacs lisp mode(ielm) buffer. Solutions applicable to shell are not applicable here - the erase-buffer command says "Test is read only"
0
votes
0answers
127 views

comint based REPL (q-mode) does not respond

I installed q-mode in Emacs 24.5.1 with Spacemacs. I am running emacs in the terminal mode (Ubuntu server): root@ubuntu-kdb:~# emacs Pressing SPC SPC q launches inferior q shell and I am getting the ...
1
vote
2answers
160 views

content was split in the functions of comint-preoutput-filter-functions

Consider the following snippet (defun python-shell-filter-long-lines (string) (print string) string) (push 'python-shell-filter-long-lines comint-preoutput-filter-functions) and M-x run-python ...
3
votes
0answers
53 views

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 ...
1
vote
0answers
131 views

Output of ipython shell much slower than python shell

Even turning off font-lock-mode and set (setq python-shell-font-lock-enable nil), the output of an ipython shell (setq python-shell-interpreter "ipython") seems much slow than the python shell (...
5
votes
0answers
305 views

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 ...
1
vote
1answer
263 views

I need example of correct using of comint and getting last comand output

I had a problem with execution of (comint-simple-send process command). My previous example would not show the last output because I didn't use the hook and the result was being dispalyed before the ...
3
votes
3answers
529 views

How can Emacs set an environment/shell variable in a subordinate shell?

I often use subordinate shells within Emacs. (I instantiate these shells with M-x shell.) I put all these shells under auto-save-mode (through my shell-mode-hook; see below). Is there some way that ...
0
votes
0answers
42 views

comint-exec with very large argument list on windows

I wish to start a command that has a very large argument list (10s or 100s of thousand characters) with comint-exec but when I do this on Windows it fails to start. The only error is apply: Spawning ...
1
vote
0answers
123 views

do not echo commands to comint-mode buffer

I have a comint managing a subprocess and I want to send a huge text payload to it that the user doesn't need to see (it's a multi-page configuration string that must be provided this way). Text sent ...
2
votes
1answer
139 views

How do I filter for IPython prompt characters on Mac OS? [duplicate]

I've debugged to this point: OS X El Capitan (10.11.5) Emacs 24.5.1 with Cocoa (installed from homebrew) python.el 0.24.5 Python 3.5.1 IPython 5.0.0 I've configured IPython to use NoColor mode in ...
0
votes
1answer
473 views

why tmux under ansi-term so slow?

I use colorized output in ghci. And if run it: in comint-mode, or in eshell, then colors displayed fine, but a lot of escape sequences displayed like ^A^Bλ ^A^B> ^A^B^B. in ansi-term, then I got ...
3
votes
0answers
200 views

Emacs 25 + comint + -nw = eaten newlines

I've been building and running Emacs 25 prereleases on a recent Fedora system that I usually access via ssh. I usually run this emacs in a terminal, and I'm fond of using ansi-term inside it. I've ...
9
votes
1answer
768 views

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 ...
2
votes
1answer
572 views

How to combine maxima-mode with *imaxima*?

How can I setup emacs to evaluate maxima code from a buffer in maxima-mode in the *imaxima* buffer rather than the default *maxima* one? While I can copy and paste the code between buffers, I'm ...
0
votes
2answers
534 views

In shell, eshell and comint-modes, the cursor moves back one chacacter when I switch buffers

When I'm in a shell and I change buffers, if I switch back to the shell buffer, the cursor has moved back a character and I can't start typing new shell commands until I hit -> first. This happens ...
6
votes
1answer
161 views

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 ...
0
votes
1answer
52 views

Prompt can be be deleted in run-scheme but not in run-python?

Prompt can be deleted when I do a run-scheme but not in run-python. Is there a way to make it standard i.e not to delete the prompts? I checked the comint-mode manual but couldn't find anything that ...
4
votes
2answers
2k views

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 ...
4
votes
1answer
434 views

Replicate ipython history behaviour in Emacs

Say, we've entered the following in the normal ipython shell. In [1]: 1+1 Out[1]: 2 In [2]: 1+2 Out[2]: 3 In [3]: 2+4 Out[3]: 6 If I now enter: In [4]: 1+ and press the up arrow key, ipython ...
3
votes
1answer
275 views

How does comint-mode override beginning of line behavior? I want same functionality to eshell

My Emacs version is 24.5.1. Comint-mode protects the prompt by somehow defining the beginning of line to start directly after the prompt regex. This works for normal motion commands like move-...
1
vote
1answer
371 views

Getting helm to do completion-at-point in comint-mode(and child modes)

Background I am working with prolog in emacs and using prolog-inferior-mode which has comint-mode as a parent mode. The default completion in comint-modes is rather terrible, and I was hoping to be ...
3
votes
1answer
390 views

How to go through command history based on what's been typed (matlab style)

Using examples from octave mode to explain this, but it would be useful in other places as well. When going through the command history it would be nice to only display entries that match what's ...
1
vote
2answers
174 views

js-comint mode (node) returning too many undefined responses?

I am using js2-mode and comint-mode to run the Node REPL in emacs. For some reason the prompt is returning a lot of undefined and ...undefined responses, which it wouldn't do normally. for instance, ...
2
votes
1answer
190 views

Size of process output sent to filter functions

I'm using comint to communicate with a REPL. From time to time the REPL sends large amounts of data. This causes a significant lag (about one second), because my filter function gets called on a ...
2
votes
1answer
91 views

How can I tell if a buffer is a comint buffer, eshell buffer or neither?

I have Emacs Lisp program that I want to work inside either a comint process buffer or an eshell buffer. The code I currently am using is: https://github.com/rocky/emacs-dbgr/blob/master/realgud/...
2
votes
2answers
605 views

Python interactive buffer showing completions of the empty string instead of regular output

I am working with python code, and I would like to be able to evaluate it in an emacs buffer, rather than using another terminal window. I am working with the python-mode from python.el, bundled with ...
3
votes
2answers
398 views

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. ...
1
vote
1answer
234 views

zsh EXTENDED_HISTORY corrupts shell-mode history

I use zsh with the EXTENDED_HISTORY option, which makes it so that in the shell history timestamps are stored which is useful for going back and diagnosing how you screwed up production. I'm trying to ...
10
votes
1answer
136 views

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 ...
0
votes
2answers
125 views

move-beginning-of-line broken in comint mode

After a while running emacs (typically days) all comint buffers start to behave strangely (shell, python, SQL). The ones I have already opened and the new ones that I open. When I am after prompt, C-...
2
votes
1answer
231 views

Using ESS in console Emacs

When I start Emacs 24.4.1 for Windows with the -nw option, I am unable to start R via Meta+R. Emacs becomes unrensponsive and I have to kill the process. The problem seems connected with the call ...
9
votes
1answer
337 views

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 ...
3
votes
1answer
164 views

Emacs 24.4 no longer highlights keywords in `M-x run-python`

With Emacs 24.3 I get certain keywords highlighted in an inferior Python buffer: This is no longer the case for Emacs 24.4: What could possibly cause this? I've made sure it's not my configuration ...
2
votes
1answer
70 views

How to explain this strange comint behavior?

I have the following issue with comint, it could be a bug. It holds true in different derived modes, such as python or gdb. How to see the strange behavior: run-python Enter some stuff: M-20 a, don'...
1
vote
0answers
305 views

Python-emacs communication broken

When I call run-python, I get the buffer with python REPL and the prompt. I can type stuff, but when I press enter there is no reaction (except the cursor moves in new line). If I press C-c C-c (...