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 [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.

2
votes
1answer
35 views

How to open several shell buffers and rename them respectively?

I try to solve the problem like this in test.el: (shell) (rename-buffer "name1") (shell) (rename-buffer "name2") (shell) (rename-buffer "name3") However, when I use (eval-buffer) to execute, it ...
0
votes
1answer
36 views

Emacs subshell: how to select options by moving up and down arrow keys?

I open a subshell session using M + x shell and I create a Nuxt.js application using: yarn create nuxt-app myproject. During the installation process, I am suggested which packages/frameworks/...
2
votes
1answer
35 views

Setting :stdin with #+call in org-mode shell code block

I've got the following code: #+NAME: example-block1 #+BEGIN_EXAMPLE Lorem ipsum dolor sit amet, consectetur adipisicing elit. #+END_EXAMPLE #+NAME: example-block2 #+BEGIN_EXAMPLE Sed do eiusmod ...
0
votes
1answer
32 views

Wrong default-directory when inside a tmux session

I'm trying to use tmux inside emacs for a long time. I want to use it to attach to remote (long living) session. Attaching to sessions works fine but I have some problems in my daily workflow because ...
1
vote
0answers
42 views

How to mount/unmount devices?

I'm interested in mount/umount usb and other devices directly from emacs. In many file mangers (like nautilus) the devices are automatically discovered and indicated with an icon, it's possible to do ...
0
votes
0answers
10 views

Enter not sent to bash in shell buffer on Windows

I've asked this question: Emacs opens gitbash in new system window the solution make git bash run on windows but prompt was not read only. I've applied this solution Any way to make prompts and ...
0
votes
1answer
58 views

What is a default shell on emacs 26.1 on Windows 10

I've been using default shell in Emacs (not eshell) for some time, defined some useful macros etc. Installed cygwin and now my default shell is bash. All of my macros and functions stopped working. ...
0
votes
1answer
44 views

xclip fails to set selection when using tramp

I use Emacs in the terminal (emacs -nw) and xclip.el for synchronising the kill ring with the X clipboard. Under normal circumstances this works fine, but when visiting buffers with tramp xclip is not ...
0
votes
0answers
43 views

Run custom bash functions with M-!

I have a few custom bash functions that are defined is some file and are made available to me in regular terminals via the line . "/path/Custom Bash Functions.sh" in my ~/.bashrc. However, Emacs ...
0
votes
1answer
46 views

How disable show warning message in shell?

Emacs 26.1 Every time when I start shell I get the next message: How I can disable this message?
1
vote
0answers
42 views

Multi-term issue with line wrapping for shell but not applications

I use multi-term within spacemacs for most of my command-line operations. It works well except some annoying behavior in the shell prompt (zsh but similar for bash) on commands which go over the ...
1
vote
0answers
15 views

Why in shell mode not show row/column number in mode line?

Emacs 26.1 I use smart mode line https://github.com/Malabarba/smart-mode-line. Here result: As you can see in scratch buffer show row/column numbers. But in shell mode not. Why? How I can fix this?
1
vote
1answer
21 views

Elpy - Close Window when invoking elpy-shell-kill

Elpy helps a great deal, when editing Python-Code. For example it let's you run the current file with C-c C-c in a new Window with a REPL. When i'm done with this, i can hit C-c C-k (elpy-shell-kill) ...
1
vote
1answer
38 views

pipe buffer contents to shell as pseudo-file

I'd like to use wdiff to compare the contents of the current buffer to a previous version of the file the buffer is visiting. So, this would be a word-level live diff of the current buffer against a ...
1
vote
1answer
33 views

Have shell inherit buffer local process-environment

I have made buffer local changes to `process-environment' using the technique described in How can I get buffer-local environment variables via .dir-locals. I then call shell from that buffer. If I ...
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 ...
2
votes
1answer
88 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
14 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
12 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
66 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: ...
2
votes
1answer
75 views

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

Whenever I run M-x shell, a buffer appears almost randomly somewhere - splitting current buffers as it sees fit. I cannot work out the logic behind it. The docstring says: (shell &optional ...
-1
votes
1answer
60 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
45 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
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
78 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
34 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
57 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
46 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
0answers
17 views

How to replace a long path with its ENV var in prompt in `shell-mode`?

Based on another stackexchange thread, I modified my prompt and init file so emacs can better follow my current directory. However, this results in a really long prompt! I've done some hacks but was ...
0
votes
0answers
26 views

Escape codes in emacs' shell

Using ghci and stack ghci on M-x shell, I have noticed escape codes appearing in place of characters such as asterisk and backtick. Why does this happen and how can it be fixed?
0
votes
2answers
52 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
25 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 ...
0
votes
0answers
57 views

Customise M-x shell command prompt

I don't like the way the command prompt looks on emacs when running M-x shell on Windows. There is no space between the prompt and the command I want to write and a message is printed out repeating ...
1
vote
1answer
222 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
225 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
84 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 ...
0
votes
0answers
180 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 ...
3
votes
0answers
45 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
26 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
72 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
25 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
70 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?
0
votes
0answers
135 views

M-x shell bash ls command

I apologize if this question is documented somewhere and I just couldn't find it, but I've been searching for a couple hours now. When I use the ls command in bash outside of Emacs' M-x shell mode (e....
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 ...
4
votes
1answer
56 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
119 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
60 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
453 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
502 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
37 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 ...