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.

Filter by
Sorted by
Tagged with
0
votes
1answer
11 views

Create shortcut for interactive compile command

I know that we can start compile interactively using C-u M-x compile. Is there a way to start this whenever I run M-x compile? If that cannot be done, how do I create a shortcut to C-u M-x compile? ...
0
votes
0answers
7 views

How to disable interpretation of !! in the shell-mode history feature?

If I open a shell buffer with M-x "shell", !! is replaced with the previous command when added to the history, even when not in a shell context e.g. in a python REPL, and even if the replace does not ...
0
votes
0answers
17 views

How does one debug errors in a process filter, (setq debug-on-error t) does not pop up a *Backtrace*?

With annoying frequency I get errors in my *Messages* buffer that seem to come from process-filters however, I never get a *Backtrace* for them. So, I have to play around and do similar experiments ...
2
votes
0answers
9 views

SQL comint history saves spaces are \40

When accessing a database through an inferior process (M-x sql-msql) the history for the current session history (M-p/n) works Ok. But when restoring history entries from a previous session the string ...
0
votes
0answers
22 views

M-x shell truncates commands to 4096 characters

Using M-x shell, I have encountered a problem with commandlines being truncated to 4095 characters. Steps to reproduce: perl -e 'print "0" x 5000 . "\n"' Select output for next command echo <5000 ...
1
vote
0answers
30 views

Abort output in currently executing command in shell mode

Sometimes in shell I end up executing a command which results in too much output. For example, consider a wrong grep on a huge text file which results in 10,000 matches. The grep command completes ...
0
votes
0answers
184 views

interactively load Cabal packages within haskell-mode

I really like how I can interactively load packages and experiment at will in Common Lisp, and would like to get a similar workflow in Haskell. I've settled on Cabal (v3.0.0.0 - new command set by ...
0
votes
1answer
43 views

Is there a way to connect to a REPL without comint?

The performance of comint is not good when handling outputs of some REPL. Is there a way to connect to some REPL outside Emacs and let result display there, like in a terminal/browser/something else? ...
5
votes
3answers
86 views

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?
3
votes
3answers
179 views

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

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

Associate a buffer with a process

I am using Python with elpy. I am trying to use a Python shell opened on the remote computer using a shell buffer. I can cheat elpy by renaming the shell buffer with Python running in it to *Python*. ...
0
votes
1answer
21 views

comint: show the original input when match-cycling through history

Currently, I have bindings for comint-previous-matching-input-from-input and comint-next-matching-input-from-input. My problem is this. Suppose I am on a prompt with some text (say, "x = ") and issue ...
0
votes
1answer
104 views

Deleting temporary files left over from inferior-python-mode

I am using emacs on a server so files in /tmp are not automatically cleared down. Every time inferior-python-mode runs, it leaves files in /tmp (e.g. /tmp/py15458epk). I'm looking for a more elegant ...
3
votes
1answer
53 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
386 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
47 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
2answers
142 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
67 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
242 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
48 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
48 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
1answer
235 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
104 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
169 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
250 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
213 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
48 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
717 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"
1
vote
2answers
329 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 ...
4
votes
0answers
69 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 ...
2
votes
0answers
173 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 (...
4
votes
0answers
596 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
394 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 ...
2
votes
3answers
844 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
56 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
161 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
181 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
607 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
231 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 ...
10
votes
1answer
1k 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
863 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
637 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 ...
7
votes
1answer
205 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
60 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 ...
5
votes
2answers
4k 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
519 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
381 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
448 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
498 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 ...