Questions tagged [shell]

Questions relating to commands for passing single command lines to shell sub-processes, running a shell interactively with input and output to an Emacs buffer, and for running a shell in a terminal emulator window.

Filter by
Sorted by
Tagged with
2
votes
1answer
204 views

emacs daemon and ssh agent forwarding

In order to use ssh agent forwarding with emacs in daemon mode, running on a remote server, I've come-up with the following. I have an alias for the client like so: alias emacsclient="update_agent;/...
0
votes
0answers
23 views

shell: comint-dynamic-list-input-ring interactively in ido mode?

windows 10, emacs 26.1 M-x shell Press C-c C-l run command "commint-dynamic-list-input-ring" and as result show Possible history references: in the *Input History* buffer. OK. But it's very slow. ...
0
votes
0answers
22 views

helm-comint-input-ring - get error: shell-mode-map

windows 10, emacs 26.1, helm 3.0 I use C-c C-l (comint-dynamic-list-input-ring) I get something like this: But I don't like this. I want to use helm-comint-input-ring. I want to get something like ...
0
votes
2answers
238 views

When I start Emacs: Symbol's value as variable is void: shell-mode-map [duplicate]

System: Windows 10, Emacs 26.1, Helm 3.0 In my init.el: ;; Shell commands history (define-key shell-mode-map (kbd "C-c C-l") 'helm-comint-input-ring) When I start Emacs I get the following error: ...
3
votes
1answer
218 views

How to force new `shell` to appear in current window?

Whenever I run M-x shell, a buffer appears almost randomly somewhere - splitting current windows as it sees fit. I cannot work out the logic behind it. The docstring says: (shell &optional ...
0
votes
1answer
119 views

Term double prompting (duplicate prompts) in Emacs

My term in emacs appear: 0;me@debian: ~me@debian:~$ instead of me@debian:~$ ~$ echo $PS1 \[\e]0;\u@\h: \w\a\]\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;33m\]\w\[\033[00m\]\[\033[0;35m\]$\[\033[0m\] ...
1
vote
2answers
66 views

How filter text in shell interactively (“on fly”)?

windows 10, Emacs 26.1 M-x shell I start Android application that very long time generate many lines in shell. adb logcat -vtime Here example: In all of this text I need only lines that contain ...
0
votes
1answer
39 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
136 views

Using pipe in a shell command

Say I am in dired and the pointer is on a file called test which contains: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. I type ! to run a shell command ...
3
votes
0answers
68 views

Switch between term and shell keeping directory

I am a beginner user of emacs so please answer being aware of this. I use dired to connect to a remote computer and navigate directories. I sometimes want to go to a shell or terminal on the remote ...
2
votes
2answers
75 views

Displaying a second buffer with a shell?

I would like to have a text buffer for writing to a file on the left side and a shell (zsh) on the right side for interacting with a REPL. Is that possible? At the moment I realize that with tmux ...
1
vote
1answer
79 views

sub shell does not open on the same window I want

I have a little issue, not too big but a little annoying. Suppose I open 3 windows in my Emacs GNU like this: Once I position myself in any window (the largest one, in this screenshot) and press/...
0
votes
2answers
86 views

Break (C-c C-c) in ESS-remote R shell

I am running my R scripts on a remote shell using M-x shell ssh -X -C name@server.edu srun -p nodeX --pty R (slurm command to start R) M-x ess-remote and select 'R' everythink works fine, until I ...
0
votes
2answers
47 views

Split window with new buffer and spawn a new shell in same (possibly remote) directory as old buffer

In tmux, I can press some key combination and split the current window into two windows in the same directory. I've tried the split-window-* function, but found it just duplicates the same buffer in ...
1
vote
1answer
418 views

Emacs shell does not work

I have problem starting shell in Emacs. When I do "M-x shell", this error message come up in shell buffer: no sessions open terminal failed: terminal does not support clear Process shell ...
5
votes
3answers
449 views

How to autoscroll a window to always show the end of a growing buffer?

Context: I have a window that shows the output of a shell command. As new lines are added, I'd like the window to always show the most recent lines. Example: (let ((temp-window (or (get-buffer-...
1
vote
1answer
139 views

How to scroll back through the command line history in the Emacs interactive subshell?

Let us say in the interactive subshell I run these commands: command_a command-b command_c ... command_z I type M-p to go back to command_z. But how can I scroll back the history of commands until ...
1
vote
0answers
332 views

From Org code block on *nix run (Power-)Shell (scripts) on MS Windows via SSH

To better integrate my Windows DevOps into Emacs Org-mode, I'd like to use my local emacs as an IDE for a remote Powershell. SSH was easily setup, from Linux shell ssh I can successfully login to a ...
2
votes
0answers
57 views

How to run process in administrative mode from Emacs?

I've been using powershell.el in MS Windows Emacs, but I sometimes want to be administrative mode so that I can do software installation via chocolatey, etc. Is there any way to call shell command, ...
1
vote
0answers
35 views

Terminfo database in Emacs shell not updated after (text-scale-adjust)

The following sequence of commands shows that the number of columns in terminfo's database inside an Emacs shell buffer is not updated when the user decreases the size of the font with "C-x C--" (text-...
1
vote
1answer
127 views

Set custom bashrc or PS1 variable

I'm using, at the terminal on my android device, an simple approach to show the path to my location (export PS1="(\w)$ "). However, the \w seems to not be working in emacs shell emulator running ...
0
votes
0answers
27 views

How narrow shell output?

Emacs 25.1. I start M-x shell. And run some process that generate text to output. How can I filter this output?
0
votes
1answer
92 views

How to send few chars to shell buffer automatically/periodically

I would like Emacs to send a few chars (command, ideally) to a specific buffer (ssh shell) so that the session does not terminate. How can I achieve this?
4
votes
0answers
175 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 ...
4
votes
1answer
73 views

autosave on shell buffers

How can I set things up so the buffer being used to run an inferior shell will be autosaved periodically to a file? The file to save in could be named "shell-2018-01-22". I thought this would be ...
0
votes
1answer
296 views

Shell IO Behavior For Emacs' Shells

The GNU page for Eshell says that Eshell is not a replacement for system shells such as bash or zsh. Use Eshell when you want to move text between Emacs and external processes; if you only want to ...
0
votes
0answers
75 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 ...
2
votes
1answer
736 views

fix “Terminal is not fully functional”

What can I do about this issue? I'm using psql, inside a ssh tunnel to ubuntu, inside a M-x shell, inside a emacsclient -nw
2
votes
3answers
793 views

Send region to shell in another buffer

Is this possible with stock emacs: I'm editing a .txt file that has a snippet of bash code When I do C-x b RET I can switch to a preopened M-x shell buffer named guesuser@...
1
vote
0answers
40 views

how can I see the result of 'ping -c 5 127.0.0.1' live using org babel session

https://github.com/whacked/ob-shstream/blob/master/ob-shstream.el There's an add-on for org babel that let's you see streaming output of bash shell blocks. It's documentation reads like this: ;; the ...
0
votes
1answer
54 views

shell script: emacs does not align case if pattern involves $

Let us start with an unaligned piece of code case $word in pattern1) command1 ;; *) command_defaultcase ;; esac I can align this code by selecting the lines and pressing TAB. The result is: case $...
0
votes
1answer
391 views

Open file in existing GUI Emacs from shell

I would like to set the shell EDITOR to use the existing running instance of GUI Emacs. On macOS I can type open -a Emacs file to edit file that way. But how would EDITOR look to work that way? What ...
0
votes
1answer
127 views

Running python script from shell in Emacs results in delayed output

I'm trying to run a python script from a Windows shell (invoked via M-x shell or M-x powershell) inside Emacs. However, no output is shown via print statements until I after I hit a raw_input ...
4
votes
1answer
758 views

Remote shell path - env: No such file or directory

In Emacs, when I open the file /ssh:USER@HOST:/PATH, Tramp mode kicks in and everything is great. While editing the file, I want to open a remote shell as well using M-x shell, but its behaviour is ...
0
votes
1answer
283 views

Git bash opens in window outside of emacs

When running Emacs on Windows 10, I am able to launch git bash from within Emacs using the information given here, here, or here. For example, I can just add these two lines to my .emacs: (setq ...
1
vote
2answers
138 views

How to evaluate the selection through Python and replace the selection with it's result?

Being more familiar with Python then elisp, I'd like to evaluate the selection as as Python snipped - as a short-cut to opening a calculator or Python prompt and copy-pasting between them. Is there a ...
1
vote
1answer
187 views

tramp + async-shell-command ignores shell-file-name

If I locally call async-shell-command it takes the shell from shell-file-name (/bin/bash). However if I use su or ssh via tramp to invoke a shell command remotely it always runs as /bin/sh. The ...
1
vote
1answer
47 views

How to configure mouse button to execute a program in emacs

I have a lot of video files I want to filter through and delete if they are uninteresting. I opened the directory of video files in emacs and I want a left-click on the file to play that file in vlc. ...
2
votes
1answer
51 views

How to check if emacs shell buffer busy or not?

If I start a long-running process in an emacs shell create by (shell), the shell will be busy for a while. How can I detect that programmatically (i.e., using elisp)? I tried: get the process by (...
2
votes
1answer
257 views

Prevent bash-completion adding an extra space when the word is incomplete

When using Emacs shell with the auto-completion feature enabled, I notice that whenever I perform typing and auto-completing a command, Emacs shell always adds an extra space after the first word. I ...
1
vote
1answer
348 views

Windows 10, Emacs 25.1, shell: Grep not work immediately

Windows 10 (64 bit), Emacs 25.1. I has Android application. And in console I start Android command "adb logcat" to show logs from Android device. But it's show many text. And I want to filter to show ...
1
vote
2answers
281 views

emacs opens shells in a random window, how to change this?

Try splitting the frame repeating some times the command C-x 3. Then try open the shell with M-x shell. It will open in a random window and not the one which you have typed the command from. Why?
3
votes
1answer
82 views

Saving raw ANSI escape codes in M-x shell, M-x eshell, or M-x term

Each of M-x shell, M-x eshell, and M-x term in Emacs lets me save the buffer to a text file. But the terminal colors are not saved. How do I save the raw ANSI escape sequences too?
0
votes
1answer
102 views

redirect stderr to a file in call-process-region

I have been reading the documentation for call-process-region here and I am trying to redirect stderr to a file. from the the documentation, this looks correct (call-process-region beg end perltidy-...
2
votes
0answers
91 views

Emacs shell and telnet buffer auto jumps to end of buffer while browsing buffer contents

Was recently required to update to RHEL 7.x and with that came a newer release of Emacs (24.3.1). With emacs I am a big user of shells and telnet sessions within emacs so that I can easily browse the ...
0
votes
1answer
412 views

C++ “std::cin >> ” is not pausing to read input from Emacs shell

The following program is from https://www.cs.bu.edu/teaching/tool/emacs/programming/ #include <iostream> int main() { int howmany; std::cout << "Enter a number: "; std::cin >&...
0
votes
2answers
111 views

How to troubleshoot and diagnose escaped-character display errors in Emacs shell?

I make much use of sub-shells within Emacs (initiated via M-x shell), and, because of this, I run into problems like the one illustrated1 below way too often: $ python -m pdb /tmp/hello_world.py [2] ...
2
votes
1answer
343 views

How to open system's command line at the directory of the current buffer?

Is there any easy way to open the system command line interface (e.g., cmd in Windows) at the directory containing the current buffer (if any)? Note that M-x shell open a command line interface within ...
1
vote
2answers
303 views

tramp and fish shell (local)

How to setup emacs tramp to open remote files while local shell is fish? More precisely is how to ask tramp to use bash shell instead of one named in SHELL environment variable?
0
votes
0answers
61 views

Retaining focus while displaying graphics windows

NB: The Emacs world uses the word frame to refer to what in most other contexts is called window, and uses the word window to describe something else. In this post, however, the word window always ...