Stack Exchange Network

Stack Exchange network consists of 175 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.

0
votes
0answers
47 views

How to execute a shell script inside of emacs?

I simply want to execute the whole file I am editing right now in a small shell buffer just like I can run my python script. How can I do this?
0
votes
1answer
28 views

How can I set the default shell in spacemacs (Evil mode) when executing commands in a buffer?

I've downloaded spacemacs (configured with Evil mode) on a Windows PC and would like to use bash or wsl as the default. Example: Open the evil-tutor and execute command :!ls Desired Behaviour: I ...
4
votes
2answers
58 views

How to pipe large files through fold before opening?

On a regular basis I need to open files that have really long lines, which unfortunately causes emacs to grind to a halt. My understanding is that this is a long-term issue with the renderer. I've ...
2
votes
2answers
51 views

How to append an argument to an external command in init.el?

I 1must append a config file to 2package command, required as -p puppeteer-config.json. In my init.el, I tried changing the native command as shown below: From: (setq ob-mermaid-cli-path "~/...
3
votes
1answer
46 views

Spawn a bash outside emacs?

I am trying to spawn a shell outside emacs, not in a buffer. I have tried (start-process "firefox" nil "firefox"), wich does start a firefox process outside emacs, but when i tried (start-process "...
1
vote
2answers
33 views

Multi-processing via TRAMP with asynchronous shell commands

I found the following code in TRAMP: (defun tramp-adb-handle-shell-command (command &optional output-buffer error-buffer) "Like `shell-command' for Tramp files." (let* ((asynchronous (...
1
vote
1answer
33 views

How to make *Shell Command Output* buffer scroll to the end?

I often execute shell commands via M-! and their output is then shown in the buffer *Shell Command Output*. How can I make this buffer display the end (rather than the beginning) so that I can see ...
0
votes
1answer
34 views

How color specific text in shell?

Windows 10 (64 bit), Emacs 26.1 Here Windows console. Result of build my project: gradlew assemble here result: as you can see text BUILD SUCCESSFUL is on green color. Nice. Now same on Emacs's ...
0
votes
2answers
106 views

Tramp hangs in “Waiting for prompts from remote shell”

new emacs user here. I'm trying to get tramp to work but can't figure out what's wrong. I do: M-x councel-tramp select /ssh:myserver But I just get "Waiting for prompts from remote shell" and it ...
1
vote
1answer
31 views

Select *Input History* buffer

The Emacs *shell* has a nice command history accessible via C-c C-l (comint-dynamic-list-input-ring). However, in classic Emacs fashion, the *Input History* buffer which displays the history is not ...
0
votes
3answers
56 views

The elisp function to run the shell command in specific file path

Personally I need run many shell command in emacs, I find it is not convenient to run a shell engine (eshell) or using it separately (bash), so is there a elisp function (local provide by emacs or any ...
1
vote
1answer
31 views

How to create shortcut that will kill process for buffer with fixed name

I have code like this to run R command from Emacs: (defun call-r-command (command-list) "run R command in shell buffer window if there is displayed buffer that have shell it will use that window"...
1
vote
0answers
37 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*. ...
1
vote
0answers
80 views

Can't run Windows 10 Bash with ansi-term

I've got this error, when running M-x ansi-term C:/Windows/System32/bash.exe RET Spawning child process: invalid argument after running M-x debug-on-entry RET start-process RET when running M-x ...
1
vote
1answer
34 views

How do I use tramp to launch a remote PowerShell?

I'm trying to launch a PowerShell on a remote Windows system using tramp. So far all I've been able to do is start a PowerShell inside Emacs on the local (Windows) machine. What is the connection ...
1
vote
1answer
26 views

Is there a way to restrict history in shell-mode?

I run lots of test in shell-mode because I love being able to search through the history. However, some of these tests print lots of info to stdout and will cause my memory usage to go through the ...
0
votes
2answers
35 views

Shell-mode execute script every time a shell is invoked

I have changed the emacs-shell mode shell to WSL ubuntu but however, the prompt is not very user-readable. For this reason I would like to execute a script that changes it so that its more readable ...
0
votes
0answers
45 views

after connecting ssh in multi-term, prompt is messed up

After connecting ssh in emacs multi-term, prompt is repeated. How can I remove repeated prompt? I'm using OS X, OS X Terminal works well. It's only problem in emacs multi-term.
0
votes
1answer
67 views

Direct emacs that open file from the pwd from shell buffer

I use shell mode, often. I use the c-xc-f. Most of the time, the start directory for looking for file, correspond to the PWD of the emacs shell buffer. Can i set that it is always the case/or reset it?...
1
vote
1answer
105 views

Need emacs lisp function to execute command in *shell* buffer

How to write a function (it would go into .emacs) that sends some command to shell buffer (and initializes shell if needed)? Something like: (defun () (interactive) (shell) (sh-send-text "ssh ...
2
votes
1answer
43 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
43 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
72 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
43 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
64 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
34 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
98 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
61 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
66 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 ...
1
vote
1answer
112 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
119 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
31 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
29 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
55 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
67 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
131 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
169 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
17 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
150 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
185 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
105 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
62 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
36 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
111 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
60 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
70 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
71 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
76 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
40 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 ...