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
0
votes
1answer
14 views

How to pass arguments to a shell script using `make-process` function?

Consider a script file: ~/project/script.sh echo "arg 1 $1" echo "arg 2 $2" echo "arg 3 $3" And elisp file that invokes it using make-process: ~/project/special-mode/special-mode.el (let* ((...
1
vote
1answer
26 views

sage-shell-mode repeat the input in the output

I wanted to use sagemath straight in emacs instead of having a terminal open. I tried to use a shell (or eshell for that matters) in emacs and launch sage there, but every time I input a command, the ...
8
votes
3answers
2k views

how to name buffers (*shell*)

I'm interested in naming Emacs buffers. In particular I'd like to give names to shell buffers that I've started. That way I can easily tell them apart when switching buffers.
0
votes
1answer
43 views

How to show colours and clear when running React development server in eshell?

Here is how the usual Ubuntu terminal looks when you run the React development serving using npm start and make changes to your source: Say the server was already running and you tried to do npm ...
1
vote
0answers
32 views

Virtual environment management for python.el without changing the general PATH variable in Emacs

I try to use virtualenvwrapper.el with the build-in python.el and my virtual environments in a ./.venv directory inside each project. Because all virtual envs have the same name .venv I cannot make a ...
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
21 views

Unable to create a new commit using Magit on Windows

trying to commit using "M-x magit-status" followed by "c c", keep getting the following: 1 git.exe … "commit" "--" Aborting commit due to empty commit message. sh -c 'printf WITH-EDITOR:: $$: No such ...
0
votes
0answers
24 views

Opening a Remote Shell Renames Buffer Open to \*shell\*

here is a simple elisp program for opening a shell in a named buffer: (defun shell-make (dir buffer-name) (let* ((default-directory dir) (buffer (get-buffer-create buffer-name))) (set-...
0
votes
3answers
298 views

How can I start a server in the background from a source code block without freezing emacs?

I am creating several org-mode documents to track code example and would like to be able to view the results of tangling or executing these code blocks in a browser. In the example below, I've created ...
0
votes
2answers
128 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
1answer
14 views

How to use arrow keys to select a menu item from an emacs shell buffer

It is getting more and more common for clis to have little embedded menus (for example the Ionic cli does this, but so do many others) which you navigate with the arrow keys. Please select the ...
2
votes
1answer
425 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 ...
0
votes
1answer
28 views

How to fix docker command prompt

When I start emacs -q and run M-x shell there is formatting error when connecting to docker container as follows, $ docker container exec -it ...
0
votes
1answer
23 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 ...
1
vote
1answer
147 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 ...
1
vote
1answer
138 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
120 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 ...
0
votes
2answers
33 views

tramp — open shell prompt for existing connection

i started using the eldritch and mysterious tramp again because a user on here helped me fix it. (thanks michael: tramp runs on odt export --). i create org mode links to my commonly-used remote conf ...
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 ...
10
votes
3answers
4k views

How do you configure emacs for julia?

What is a recomended way for making emacs as julia code editor? The things which I would like to have are: autocomplete julia shell in emacs with abbility to send the code from buffer debugging
0
votes
0answers
12 views

After Filename Option Shell Command on Given File

How can be executed an shell command on given file with options AFTER the filename? Trying here to run convert ScramTree.pdf ScramTreeImg.png via ! on dired mode, but command runs minibuffer input ...
0
votes
0answers
28 views

Grep exited abnormally when using lgrep command

Debian 10, Emacs 26.1 I want to search word "The" for each file in folder test1, by using the command M-x lgrep The [Enter] test1 And the result is zsh:1: no matches found: .[!.]* I thought ...
2
votes
2answers
71 views

Specify and use inferior shell only once

I know you can customize settings or set environmental variables to get emacs to use other shells in shell-mode (1, 2). Is it possible to simply start a shell specifying which shell you want to use ...
0
votes
1answer
49 views

How to change current-directory with emacsclient?

I am trying to change the default directory using emacsclient, but it isn't working as I had hoped. $ cd $ emacsclient -e '(emacs-version)' "GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ ...
1
vote
0answers
32 views

Send a command to Emacs from an inferior process

Is it possible to send a command to Emacs from an inferior process? For my particular use-case, I would like to instruct Emacs to run the command inferior-ess-r-reload-hook (part of the ESS package) ...
0
votes
1answer
57 views

Shell doesn't accept commands after ssh login or R or Python

This used to work just until recently, no idea what happened maybe an updated version of something is causing the problem. In the shell buffer in Emacs, shell seems to stop working after SSH or ...
1
vote
2answers
209 views

Is there a command for opening emacs in shell mode?

Suppose I want to open emacs with a file and shell mode together. If there were two files I would do emacs file1 file2 and emacs opens them both. Is there a command to do this with emacs file [shell]?
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 ...
1
vote
0answers
52 views

How to pass bash commands from a script to terminal?

Let's say I have a bash script. Is there a way I can pass specific lines or blocks in the script to terminal process in EMACS? Just like how we do for R script using command C-c R
2
votes
1answer
61 views

How can I disable company-mode in a shell when it is remote?

I am using (global-company-mode 1) but using remote shell it is annoyingly slow. How can I disable company mode when I open a shell buffer, but only if it's a remote shell? The problem manifests ...
0
votes
0answers
20 views

shell blocks chaining with :post-processing calls and using stdin to create “filter” blocks

To increase modularisation of my emacs code blocks I'm attempting to factor out common functionality into separate function blocks. I'm running into difficulties with chaining :post calls, and using :...
0
votes
2answers
69 views

How to save and execute a python file?

I do not prefer python-mode. I would like a generic way so that I can understand emacs. I wish the file be saved and python file command then be run as if in a shell.
4
votes
2answers
1k views

Execute current line in shell

I often find myself copying commands line by line from an emacs buffer to my terminal. How do i bind a shortcut which sends the current line/selection in emacs to my gnome-terminal?
0
votes
0answers
14 views

Emacs continuously asking for input and not sure what is the cause

I have this function implemented to basically compile and run the cpp file I am writing. Some files needs input (cin) so running this function will not stop and would continuously showing this message:...
0
votes
0answers
25 views

Run elisp function from console against running emacs daemon?

If I have an emacs daemon already launched (which loads my config functions, etc) via $ emacs --daemon then how can I run (from linux console) some arbitrary elisp? In my case I'd like to run (org-...
6
votes
5answers
3k views

How to start python shell in appropriate working directory?

If I am editing a python file, and start a python shell using elpy-shell-switch-to-shell the process appears to set the working directory as the containing directory of the file. However, the file ...
2
votes
0answers
325 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 ...
3
votes
1answer
38 views

Chronos cannot speak French

I changed chronos-text-to-speech-notify acording to https://github.com/dxknight/chronos/issues/2. My Chronos config includes this: (setq chronos-text-to-speech-program-parameters "-s 50 -k 1 -a ...
1
vote
1answer
105 views

How to format shell commands run from Dired?

I want to execute a formatted shell command on a file from within Dired. I am aware that I can use dired-do-shell-command to run a shell command on a selected file file by entering ! <command> ...
0
votes
0answers
12 views

Shell 2 shows shell 1 Filename/Process

This has bugged me on and off forever. Why does my Ibuffer show shell<1> in the Filename/Process column for buffer named *shell*<2>? MRL Name Size Mode ...
39
votes
2answers
7k views

Weird shell output when using IPython 5

I just upgraded to the latest version of IPython and now something is wrong when using it in emacs. When using it in a regular terminal it works fine (colors, tab-completion, etc.), however either ...
2
votes
1answer
144 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 ...
8
votes
2answers
1k views

How to force an org-babel session to reset or initialize?

If I run the following babel shell blocks #+BEGIN_SRC sh :session one :results output ssh staging #+END_SRC #+BEGIN_SRC sh :session one :results output hostname #+END_SRC Org creates a shell ...
0
votes
0answers
48 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
58 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
128 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
67 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
93 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
16 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
43 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 ...

1
2 3 4 5 6