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
0 answers
13 views

Single stepping through shell script

Is there an emacs package that would enable single stepping through a shell script, or some facility for setting breakpoints or viewing variables?
balanga's user avatar
  • 21
0 votes
0 answers
5 views

Weird behaviour on emacs with running django server in terminal

something weird is going on in my 'emacs-IDE'. I am editing some javascript files in a django project using spacemacs. Some tools I use are treemacs and lsp-mode. In order to test my code I call up a ...
mor3dr3ad's user avatar
0 votes
0 answers
30 views

Shell Environment in emacs sessions

I noticed that terminal-based emacs and GUI emacs seems to work differently in terms of shell environment, even if they are started in the same terminal session. For example, I'm working with roslisp ...
Herman He's user avatar
1 vote
1 answer
32 views

How to start a terminal program in vterm from org mode?

I'm currently using xterm using following line below to open data.csv with visidata from xterm. How can I achieve similar behaviour though with vterm instead? example.org: [[elisp:(start-process "...
jjk's user avatar
  • 749
0 votes
0 answers
57 views

`shell-command` repeats my input characters multiple times

whenever I run this command (shell-command "chatgpt install &") my input characters gets repeated like this: 1> hi hi Hello! How can I assist you today? 2> hi again hhii ...
ntriisii's user avatar
0 votes
0 answers
39 views

With tramp, how to use a remote-shell that contains spaces in the path?

I'm using Linux and I'm trying to tramp into a Windows machine. I'm trying to set the remote-shell option of tramp because tramp's default of /bin/sh doesn't work for a Windows remote host. I'd like ...
John Smith Optional's user avatar
0 votes
0 answers
52 views

desktop+ not saving term/shell buffer

For session management, I was happy with inbuilt desktop.el except that it could not retain the term/shell buffers. Everytime I quit emacs, it asked to kill the term/shells. Then I read the ability of ...
user_0525's user avatar
0 votes
1 answer
22 views

On tramp shell, commands like `head`, `tail`, `man`, `git log`, etc... output all text at once instead of prompting

I use tramp-shell for ssh to another machine. Setup as follows: (defun spawn-shell (name) "Invoke shell test" (interactive "MName of shell buffer to create: ") (pop-to-buffer ...
Noah's user avatar
  • 121
0 votes
0 answers
30 views

Best way to get man to open in emacs by default

I currently have: man () { emacs -nw --eval "(man \"$1\")"; } in my .zshrc. However, this has the problem of not working with something like read(2) or command-line arguments to ...
user129393192's user avatar
0 votes
1 answer
74 views

How to stop a process gracefully before killing its buffer?

I want to make a function that stops the ESS inferior process (e.g. an R or Julia shell), kills its buffer and deletes its window. ess-inf.el provides the function ess-quit to exit the inferior ...
Arch Stanton's user avatar
  • 1,545
0 votes
1 answer
52 views

can't run shell on emacs for osx

When I run M-x shell, I see the following warning (and no shell): Process shell exited abnormally with code 127 I freshly installed emacs v. 28.2 for osx. I put my stuff in my .emacs file, but I ...
David J.'s user avatar
  • 153
1 vote
1 answer
70 views

Org Babel Shell Command

I'm trying to set the shell command for org-babel with this: (setq org-babel-sh-command "/home/luser/bash-redir-stderr.sh") , but it doesn't seem to have any effect. My blocks are named &...
Jason Hunter's user avatar
1 vote
0 answers
32 views

How to implement a "make check" to run checkers on my package?

I would like to be able to quickly run popular Emacs checking utilities on my package, for example: checkdoc package-lint relint check-declare byte-code-compile Perhaps some others. Is there a way ...
ideasman42's user avatar
  • 8,405
0 votes
0 answers
22 views

How to cleanly copy command output in shell-mode?

I can use following commands to navigate prompts in M-x shell C-c C-p runs the command comint-previous-prompt C-c C-n runs the command comint-next-prompt But if I have multi-line prompt, e.g. user@...
phoxd's user avatar
  • 231
0 votes
1 answer
133 views

How to make inferior shell inherit environment variable?

I would like to set the environment variables defined within Emacs available to inferior shells launched afterwards. My use-case is to be able to switch Python (conda) environment within Emacs. If I ...
ldc's user avatar
  • 211
0 votes
0 answers
80 views

Getting an error for creating python dedicated shells

Some time ago, I asked this question, which is how to create new python shells that get renamed based on the script from which they are run, e.g., foo.py should create a shell *Python[foo.py]*, and ...
Schach21's user avatar
1 vote
0 answers
16 views

Transfer focus to started asynchronous process

I have the opposite issue from How to avoid losing focus after starting an asynchronous process?. I would like to call start-process and have the resulting window be focused. Specifically, I am ...
xeruf's user avatar
  • 324
0 votes
0 answers
25 views

How to kill process similar to kill buffer

Whenever I run into infinite loops in a script and it produces a lot of output, C-c C-c (comint-interrupt-subjob) does not reach the process and cannot be killed; being over SSH hangs communication as ...
phoxd's user avatar
  • 231
2 votes
4 answers
356 views

Running and viewing results from bash scripts

How can I run bash scripts from emacs and show the result in emacs?
Dilna's user avatar
  • 1,183
0 votes
1 answer
34 views

Emacs shell - git diff not displaying inserted ("+") lines with dos file endings and color

If I modify a file checked into version control with DOS line endings, on a normal terminal I can see the change: # Normal terminal... $ git diff diff --git a/a b/a index c113281..85c3ecd 100644 --- a/...
John Graham's user avatar
0 votes
1 answer
44 views

Change Emacs prompt [duplicate]

I have Emacs running as a package in MobaXterm The problem is that Emacs has very ugly prompt. If I disable PS1 in .bashrc than it works in Emacs fine but change MobaXterm terminal as well. Hence I ...
susja's user avatar
  • 137
0 votes
0 answers
19 views

Issue seeing files in dired directory or shell on remote machine

This used to work fine but seems to have broken today and I have not knowingly made any explicit changes to configuration. If I use a standard terminal (mac) and ssh into my server I can visit a path ...
user27815's user avatar
  • 239
0 votes
1 answer
142 views

`M-x shell` not displaying colors

OS: Mac OS 12.5.1 Emacs: GNU Emacs 28.1 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 Version 10.14.6 (Build 18G95)) of 2022-05-11 (i.e. the 28.1-4 binary from https://emacsformacosx.com/) ...
tallow_amnesty's user avatar
1 vote
1 answer
77 views

Shell with unique buffer names

I use the following function to make a shell buffer, but the unique file name is not taking effect. (defun galaxy-shell () "Make a uniquely named buffer for executing shell commands." (...
Dilna's user avatar
  • 1,183
2 votes
2 answers
59 views

Emacs shows up a buffer even if I told it to not do so

I'm writing a couple of functions to help me in Java development (may turn into a package someday). To extract the classpath for my project, I use Maven (mvn dependency:build-classpath), then I filter ...
Alessandro Bertulli's user avatar
0 votes
1 answer
19 views

Outputs are truncated in a remote shell buffer over `tramp`

When I run ps -ef | grep python3 in my kitty terminal, I get root 2331 1 0 Jun22 ? 00:00:00 /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers root 2667 1 ...
Saddle Point's user avatar
1 vote
1 answer
26 views

How to stop shell buffers echoing directory path when `cd` into it?

When cd some_directory then RET in shell-mode, some_directory is printed in the echo area. How can I stop this?
Saddle Point's user avatar
0 votes
0 answers
19 views

`shell` process got killed when C-c C-c

When tramp-own-remote-path is add to tramp-remote-path, a shell buffer started with /ssh:/some_server:/bin/bash got killed when doing C-c C-c on a running process or empty prompt. The issue does not ...
Saddle Point's user avatar
1 vote
1 answer
112 views

How can I get the name of the file on the current Dired line?

I'm running emacs on WSL. The following function launches the binary file marked in dired: (defun wsl/execute () "execute file at point in dired" (interactive) (dired-do-shell-command ...
eatloaf's user avatar
  • 145
0 votes
0 answers
56 views

Shell: Is it possible to enter input to an interactive command inside the shell?

It doesn't work for me. e.g. Entering a command read -r value in a terminal would wait for an input from the user, and after user enters some value, we can see that value with echo $value. But is ...
deepanshu's user avatar
  • 141
0 votes
1 answer
114 views

How to get tab completion work properly in telnet-mode

I'm trying to get command and file tab completion to work in telnet-mode. For that, I did bind the TAB key to completion-at-point in telnet-mode-map. The function is called as expected but it does ...
PRouleau's user avatar
  • 754
0 votes
1 answer
36 views

A comparitive analysis of shell, eshell, and term: what are the similiraties? What are the differences between them? When to use each of them?

This question was previously answered in Unix Stack Exchange. It has not been answered here, in Emacs Stack Exchange. I believe new answers in a community fully dedicated to Emacs could go deeper. But ...
Pedro Delfino's user avatar
1 vote
1 answer
190 views

Why does `eshell` not create an active process In Emacs while `shell` and `term` do?

In Emacs, the features shell, term, and eshell are different commands used for similar goals. When executed, shell and term create active processes in Emacs. I expected the same for eshell. However, ...
Pedro Delfino's user avatar
0 votes
2 answers
190 views

Why does htop command does not work on *shell*?

I tend to prefer shell over term. With shell everything is text and I can use the Emacs bindings to move around. Also, I have been trying to avoid opening my nixOS terminal. I have been trying to stay ...
Pedro Delfino's user avatar
1 vote
1 answer
120 views

Why does org see this source block as having "unbalanced parentheses"?

Here is a terse snippet with which you can recreate the issue, I hope: #+begin_src sh for x in $(for y in $(cmdA '"'); do cmdB $y; done); do cmdC $x; done #+end_src Here if I try to operate with ...
theherk's user avatar
  • 113
0 votes
1 answer
33 views

Being in *shell* buffer, is it possible to open a file with the current Emacs application from a shell command?

After executing the shell command, I have a shell buffer inside Emacs. After executing classic ls -l, there is a file listed that I want to open in Emacs: [pedro@system:~/projects/career-opportunities]...
Pedro Delfino's user avatar
0 votes
1 answer
103 views

Open shell from find-file interactively

Currently, I can use C-x C-f to find-file (or ido-find-file) then open a dired directory and launch M-x shell. Is it possible to interactively navigate a path be it a local ~/Documents or tramp shell ...
phoxd's user avatar
  • 231
3 votes
1 answer
141 views

How to run a buffer/region with shell commands as root user?

I need to copy-paste a bunch of shell commands to emacs and run them as root/sudo. How do I do it? For instance, while configuring samba, I come across this instruction from the documentation: Become ...
Ananth Pattabiraman's user avatar
0 votes
0 answers
127 views

How to have a multiple line prompt terminal?

Using mainly ansi-term,term or vterm I'd like the prompt to contain a line with informations for directory,user and git, whilst the actual input prompt line to be below. I've heard of zsh though doubt ...
jjk's user avatar
  • 749
3 votes
1 answer
226 views

Comint input and output text positioning

I'm using Emacs as a TCP client for a remote Python debugger I wrote. I can connect and interact with the server, but I'm not able to get the comint buffer used as the client to align input and output ...
Lorem Ipsum's user avatar
  • 4,337
0 votes
0 answers
86 views

Emacs shell make a new shell in a new numbered *shell<n>* buffer, same window

I updated from emacs 27 to emacs 29, and I find that now when I run M-x shell It overwrites the file/buffer I am currently using with a new shell, rather than starting a new shell in the current ...
Mittenchops's user avatar
0 votes
1 answer
47 views

Completely removing all python-shell functionality

I'm running emacs 27.2 under Linux. I want to totally and completely remove all python-shell-* functions. I know how to unmap the python-shell-related keymappings, but I want to go further and remove ...
HippoMan's user avatar
  • 594
0 votes
1 answer
73 views

Dedicated python shells that runs the code

This answer how to map C-c ! to create a new python shell for the current buffer. The main code is this: (defun my-python-start-or-switch-repl (&optional msg) "Start and/or switch to the ...
Schach21's user avatar
2 votes
1 answer
13 views

SICSTus Emacs Interface - Installation

I am currently trying to install the SICSTus Emacs Interface on Ubuntu to use Emacs to program in Prolog, but it seems that I am too stupid to do so. On https://sicstus.sics.se/sicstus/docs/4.3.5/html/...
Sven Madson's user avatar
1 vote
1 answer
155 views

call windows batch from shell

I'm trying to run QGIS from the command-line on Windows. QGIS provides a batch file for this, "C:\Program Files\QGIS 3.20.3\bin\qgis.bat". When I run this from within Emacs shell, the load ...
Lorem Ipsum's user avatar
  • 4,337
1 vote
1 answer
75 views

clean weird characters from org source shell

When I run a shell command in Org I sometimes get back weird control characters: #+begin_src sh :results output :session test guix pull #+end_src #+RESULTS: : : Updating channel 'guix' from Git ...
Lorem Ipsum's user avatar
  • 4,337
1 vote
1 answer
856 views

How to read the shell environment variables?

I have the following command in my .emacs (setq org-roam-directory (concat (getenv "BASEDIR") "/data/org-roam/")) The purpose is to the set the directory for org-roam (but ...
point618's user avatar
  • 233
3 votes
3 answers
97 views

Use basename of the file

When I am done editing myfile.tex, I M-x shell-command RET. At the prompt, I manually enter pandoc -s myfile.tex -o myfile.org. What command will save me the trouble of having to type out the myfile ...
deshmukh's user avatar
  • 1,852
0 votes
1 answer
277 views

Automatically change encoding of process buffers

Platform Windows 10 with GNU Emacs 26.1 (build 1, x86_64-w64-mingw32). Goal To set the encoding of process buffers to UTF-8. I would like to set the input and output encoding of process buffers, like ...
henning's user avatar
  • 82
1 vote
1 answer
211 views

How to pass a string argument to a function from global-set-key definition inside .emacs

Inside my .emacs file I have these two functions: (defun bh/switch-to-vs () (interactive) (universal-argument) (shell "*vs*")) (defun bh/switch-to-android () (interactive) (...
W.M.'s user avatar
  • 113

1
2 3 4 5
8