The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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

How to remove message `Indentation setup for shell type sh`

I open shell files at startup and often get this in *Messages*: Setting up indent for shell type sh Indentation variables are now local. Indentation setup for shell type sh All my files cause this ...
0
votes
0answers
25 views

Skim: search backward generates shell buffer in Emacs

I have configured forward and backward search between Emacs and Skim (MacOS) for my LaTeX work. While the search works fine, every time I do an backward search from Skim, an additional shell buffer ...
0
votes
0answers
43 views

run shell command interactively and insert final output into main buffer

I'm something of an Emacs newbie. I would like to run a shell script I've written and insert the output into the buffer I'm working in. But the script requires some interaction, so ideally I'd like ...
1
vote
1answer
54 views

how to enable pager like behavior in a shell buffer?

I can't believe I'm saying this, but one thing that is "nice" about windows cmd is the pager. When I do man grep in a bash shell inside emacs buffer it spits out the entire content at once. Is there a ...
1
vote
1answer
61 views

How can I tell when non-interactive bash process is done executing a command?

I'm trying to write a different shell command line interface where the input line stays at the top. Output of previous commands should stack below: > INPUT LINE LAST OUTPUT (of command 1) ...
0
votes
0answers
34 views

Emacs shell slow compile

So I've been searching around for this particular problem and apparently I found no solutions. There are posts on reddit about this: https://www.reddit.com/r/emacs/comments/3scsak/...
0
votes
0answers
14 views

(comint-magic-space) in Eshell

I like to interact with the history of my bash commands. For instance, !?python would run the last command that contains python. Since the outcome is quite unpredictable, I often expand it before ...
0
votes
0answers
18 views

Is there a way to speed up emac's “shell” mode?

I am new to emacs. I know we can open a shell, eshell, or term with M-x shell, M-x eshell and M-x term. I have a program that needs to run make then run. On an external terminal app, I am on XFCE so ...
0
votes
1answer
48 views

send custom commands to shell

I have just joined the Emacs church. I would like to know if the following can be done. Say I have a project folder, I would like to run some custom commands that tie to some keyboard shorcuts for ...
0
votes
2answers
47 views

1 single custom command to compile and run executable

In my emacs init file, I have this: (add-hook 'c++-mode-hook (lambda () (set (make-local-variable 'compile-command) (concat "g++ " buffer-file-name)))) Then, ...
3
votes
3answers
100 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 ...
0
votes
0answers
16 views

In a terminal (not in Emacs), how can I use emacs helm/swipe to choose old shell command from bash_history?

In a terminal, we can use C-r to search a command from bash_history, but it is far less powerful than the Emacs package like helm-swoop or ivy-swipe. How can I use a shortcut in terminal (e.g., C-r) ...
1
vote
1answer
74 views

Elisp: How to accumulate function return into a list

I have this small snippet of Elisp code that decodes kernel traces: (defvar projbase "/my/proj/base") (setq my_shell_output (substring (shell-command-to-string (concat "/home/demetra/scripts/...
0
votes
1answer
31 views

Emacs / Projectile complains about no job control with Bash/terminal

I use Emacs 27.0.50 on Ubuntu 18.04. Fish is my default shell. When a file from a directory with .git is being loaded into the buffer, I'm trying to start projectile-find-file , I see the following ...
1
vote
1answer
46 views

How do I make file paths clickable/navigable in Shell as described in the documentation?

For the life of me, I cannot get this functionality to work: https://wikemacs.org/wiki/Shell#Make_file_paths_clickable I've run (add-hook 'shell-mode-hook 'compilation-shell-minor-mode) in my .emacs ...
0
votes
0answers
36 views

How do I generate a swiper like list from a custom input?

I need help with creating a tool. So I have some lines selected by a region, that I need to feed line by line to a shell/python script. The output of shell/python script will be of the form: 0xabcd ...
1
vote
1answer
53 views

M-x shell's M-r doesn't search bash_history

All, When I in the emacs shell (run by M-x shell) and press M-r, it only search a very limited command history and doesn't search the bash_history file. But it is said Emacs shell will read my bash's ...
0
votes
1answer
19 views

always prompt for default directory when opening interactive subshell

When I invoke C-u M-x shell while visiting a local file or scratch buffer, emacs does not prompt me to enter the default directory for the shell. But if I'm visiting a remote file or directory ...
0
votes
0answers
85 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
78 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
64 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
57 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
56 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
63 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
56 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
45 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
271 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
39 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
134 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
44 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
45 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
144 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
62 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
30 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
41 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
72 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
122 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
139 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
45 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
44 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
104 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
53 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
88 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
47 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
105 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
72 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
77 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
172 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
160 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
45 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?