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
1 answer
15 views

Run ansi-term in a new frame

I have the following in my .emacs : (add-to-list 'display-buffer-alist '("\\`\\*e?shell" display-buffer-pop-up-frame)) And it opens shell or eshell buffer in the new frame when I run M-x ...
Mark's user avatar
  • 175
0 votes
1 answer
20 views

In shell-mode, Ruby interactive shell irb repeatedly echoes input line built up from every successive input character

As the title says, when I run the Ruby interactive shell irb in a shell-mode buffer on MacOS, my input line is echoed back many times, character by successive character. Example: irb(main):001> 1+...
Sean's user avatar
  • 941
0 votes
0 answers
11 views

Adding PS1's "user@machine" to the exported version of an org-babel shell block

I am using org-babel for running shell commands. I'd like to export the code block as if it was running from the terminal, so adding "user@machine" before each command. When I export the org ...
Peter Petigru's user avatar
0 votes
0 answers
32 views

How to open emacs magit on a specific bare repo from the command line?

I'm trying to switch over from neovim. I use this alias to open vimagit on my config bare repo: alias configit=GIT_DIR=$HOME/.cfg GIT_WORK_TREE=$HOME nvim -c MagitOnly. I use this command when I ...
Tony's user avatar
  • 1
0 votes
0 answers
17 views

How to put 'viper-change-state-to-emacs function on some hook

I am using viper-mode, which is vi emulator and can be switched to the original emacs mode with viper-change-state-to-emacs, when I edit program files. But, sometimes I want to create some special ...
20 Abbeyroad's user avatar
0 votes
1 answer
53 views

Shell echoing every command

(xpost from Unix Stack Exchange) I'm using a local shell via an Emacs shell buffer. Seemingly at random, my shell will start echoing back every command I type before the rest of the output. h ~ $ pwd ...
Eric Auld's user avatar
0 votes
0 answers
54 views

Emacs shell exits after executing a cygwin command

Windows, Emacs 27.2. I execute fairly simple cygwin commands from an Emacs shell - first tried unzip then backed up to test ls - and the shell exits. Why?
patfla's user avatar
  • 11
0 votes
1 answer
74 views

Fish and org-babel

I am having troubles with the output of a fish session in org-babel. It seems to be related to the bracketed paste, but only happens when :session is used. I was wondering if there is any way to clean ...
barbacoa's user avatar
0 votes
0 answers
34 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
  • 135
0 votes
0 answers
15 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
35 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
91 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
  • 744
0 votes
0 answers
68 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
108 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
88 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
27 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
36 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
110 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,657
0 votes
1 answer
64 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
  • 163
1 vote
1 answer
103 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,806
0 votes
1 answer
219 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
  • 221
0 votes
0 answers
132 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
17 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
  • 344
0 votes
0 answers
27 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
453 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
0 votes
1 answer
42 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
48 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
26 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
  • 249
0 votes
1 answer
206 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
99 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
2 votes
2 answers
64 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
25 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
28 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
23 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
142 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
60 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
141 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
  • 796
0 votes
1 answer
40 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
207 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
297 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
151 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
34 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
136 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
236 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
178 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
  • 744
3 votes
1 answer
296 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,507
0 votes
0 answers
116 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
56 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
  • 596
0 votes
1 answer
87 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

1
2 3 4 5
8