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
22 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
125 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
127 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
0answers
18 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
99 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
27 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
11 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
20 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
66 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
30 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
27 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
56 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
137 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
220 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
49 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
38 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
1answer
33 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 ...
0
votes
0answers
19 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
53 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
24 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-...
0
votes
2answers
124 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 ...
2
votes
1answer
402 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 ...
6
votes
5answers
2k 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
273 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
71 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
11 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 ...
38
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
109 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 ...
6
votes
2answers
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.
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
38 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
51 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
110 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
66 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
72 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
15 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
33 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
2answers
77 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, ...
0
votes
1answer
87 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 ...
3
votes
3answers
163 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 ...
1
vote
1answer
81 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 ...
1
vote
1answer
100 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
0answers
20 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) ...
4
votes
3answers
725 views

dirtrack mode with fish-shell

I recently started using the fish shell. I tried using it in term-mode in Emacs. One characteristic of this shell is that it shortens the current working directory before printing it as the prompt. ...
0
votes
0answers
38 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
2 3 4 5 6