Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

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
1 answer
17 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 ...
user avatar
0 votes
1 answer
31 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 ...
user avatar
  • 581
0 votes
1 answer
24 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 ...
user avatar
1 vote
1 answer
108 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, ...
user avatar
0 votes
2 answers
34 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 ...
user avatar
0 votes
1 answer
42 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 ...
user avatar
  • 103
0 votes
1 answer
21 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]...
user avatar
0 votes
1 answer
23 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 ...
user avatar
  • 229
3 votes
1 answer
29 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 ...
user avatar
0 votes
0 answers
28 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 ...
user avatar
  • 607
3 votes
1 answer
47 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 ...
user avatar
  • 3,845
0 votes
0 answers
37 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 ...
user avatar
0 votes
1 answer
29 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 ...
user avatar
  • 522
0 votes
1 answer
55 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 ...
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/...
user avatar
1 vote
1 answer
35 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 ...
user avatar
  • 3,845
1 vote
1 answer
26 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 ...
user avatar
  • 3,845
0 votes
1 answer
241 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 ...
user avatar
  • 223
3 votes
3 answers
58 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 ...
user avatar
  • 1,668
0 votes
1 answer
75 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 ...
user avatar
  • 314
1 vote
1 answer
80 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) (...
user avatar
  • 113
1 vote
1 answer
36 views

emacs 28.0.50 `sh-quoted-exec` has different coloring for `sh` and `bash`

In Shell-script[bash] mode, coloring differs for sh-quoted-exec in #!/bin/sh and #!/bin/bash. If #!/bin/sh is the first line: // I prefert this If #!/bin/bash is the first line: Would it be possible ...
user avatar
  • 1,112
0 votes
0 answers
72 views

How to create shell aliases in Emacs [GUI] in Windows?

In Linux this can be done by something like: alias cdwww="cd /srv/www" In Windows there is an equivalent command called DOSKEY, used for example like this: doskey ls=dir $* The above works ...
user avatar
  • 113
1 vote
0 answers
49 views

Two prompt lines using emacs shell and plink

I am using emacs M-x shell command to create a shell, and from this shell I connect to a remote machine by using plink (PuTTY on windows). I have a problem with the prompt being presented twice. I ...
user avatar
  • 41
2 votes
1 answer
77 views

How to define global key binding for `C-c >` and `C-c <` using `defhydra`

I am trying to apply following solutions's key binding to overwrite all mode's key bindings for C-c > and C-c <. From the answer for Can we do C-c > and > and > to continue indentation:...
user avatar
  • 1,112
0 votes
2 answers
220 views

How to "pipe" a string to a shell command in elisp rather than give it as an arg?

The command I'm trying to duplicate: curl https://example.com | readability https://example.com As far as I can see, though, using that | pipe is NOT the same as passing the string in as an arg. If I ...
user avatar
0 votes
0 answers
181 views

How to use nvm with spacemacs?

How can I use nvm with spacemacs? I want to be able to access nvm from any shell in spacemacs. I have installed nvm and it works with no problem from the terminal. When I open some shells in ...
user avatar
  • 155
0 votes
1 answer
36 views

From an org item, launch a shell command with the item text as parameter

From an org list item, I want a function that I can bind to a shortkey or an org-speed shortcut, to be able to launch a shell command with the org list item text as parameter. Then I want to add tag ...
user avatar
  • 103
0 votes
0 answers
149 views

How to run shell scripts at startup of Emacs/EXWM?

I have configurations I would generally run on the startup of DWM. Now, I would like to do the same with EXWM/Emacs. Is there any Elispian way to do it? EDIT: arrived in conjunction with @lawlist OBS: ...
user avatar
  • 257
0 votes
0 answers
37 views

Specify which emacs to open for a file when running shell inside emacs

Consider a scenario I run an emacs instance E01, and use the shell inside emacs to find the file I want to open; I found the file file using this shell. Now I'm ready to open it through the shell ...
user avatar
0 votes
0 answers
116 views

Interactive terminal solution for Emacs on Windows?

I recently tried to move from over to Emacs but hit a brick wall while trying to setup a terminal. While shell and eshell work fine, they are not really interactive so you can't really run things such ...
user avatar
  • 123
1 vote
2 answers
51 views

Custom compilation command fails on Windows due to slashes in paths

when i type on "shell": c:\Users\TR\Desktop\emacs-27.2-x86_64\bin\GAMES\game3>love . works fine but when i put (defun insert-file-name () (interactive) (let ((compilation-ask-about-...
user avatar
1 vote
1 answer
34 views

Tramp with Dired produces unwanted //DIRED// line

Connected via Tramp to an old remote system, when I list a directory using Dired, I get: /plink:user@example.com:/tmp: total used in directory 549 available 114.7 MiB drwxrwxrwt 3 root ...
user avatar
  • 989
6 votes
1 answer
1k views

How to get the PATH from the SHELL

When launched at system start-up, the Emacs daemon doesn't pick up modifications to the PATH introduced by shell initialization scripts. Emacswiki suggests to use this function to update Emacs' PATH, (...
user avatar
  • 1,392
0 votes
2 answers
270 views

pipe result of elisp function to a shell command

I wanna pipe the output of an elisp function (emacs-version) to a shell command (xclip). How can I do this? I accept vanilla emacs and evil solutions.
user avatar
1 vote
1 answer
179 views

How to make emacs shell the same as system terminal experience?

On macOS, using iTerm2. It looks like In Emacs For Mac OS X, it looks like I copied system's ~/.zshrc file to ~/.profile and ~/.bash_profile, but doesn't they read configrations when start emacs?
user avatar
0 votes
1 answer
127 views

Launch an external command prompt (cmd.exe) in a specific folder [duplicate]

I'm trying to build a cmd interactive function in Emacs, which would open a Windows command prompt - exactly like Win+R cmd does. Within Emacs, it would be accessible with M-x cmd, and it would open ...
user avatar
  • 421
1 vote
2 answers
2k views

How to use doom emacs as a golang ide quickly?

I installed the newest doom emacs on macOS. Also configed language packages as $ emacs ~/.doom.d/init.el :lang (go +lsp) :tools lsp $ ~/.emacs.d/bin/doom sync When I open a .go file, the code became ...
user avatar
0 votes
1 answer
96 views

Repeating characters in `python-mode.el` shell interaction

I experience strange behaviour when using python-mode. When sending characters to the shell using C-c C-e, the first string works well. After that, the characters start repeating, in a manner that is ...
user avatar
  • 103
1 vote
0 answers
60 views

Unexpected local shell in TRAMP mode

I have a clear installation of spacemacs with layer shell on. I open remote dir SPC f f ssh:<host>:<path> I open shell SPC ' Shell is local (I expect it to be opened on the remote host)
user avatar
4 votes
0 answers
298 views

How do I make compilation use vterm instead of the default shell it is using?

I am running M-x compile commands in my Projectile projects. I would like to use vterm for running them as the compilations are getting very slow because the project is very large. How do I make ...
user avatar
  • 141
0 votes
1 answer
216 views

How to send keyboard interrupt to running program in shell mode?

I wish to achieve what a C-c (send a keyboardinterrupt) would do in a terminal outside of Emacs. How do I do that in Emacs shell mode?
user avatar
  • 79
1 vote
1 answer
42 views

Emacs unable to execute shell commands despite them being in the Emacs shell PATH

I am on Ubuntu. I'm trying to run the latex command to run in the Emacs shell. I have done some research, and have already done the following: I noticed that running env in the Emacs shell gave a ...
user avatar
1 vote
1 answer
326 views

What is causing Emacs remote shell to be slow on completion?

So basically I am doing the following: Opening a dired buffer with tramp on a remote. Opening a shell on the remote (M-x shell) Then if I try for example to type any command such as ls -la the ...
user avatar
0 votes
0 answers
22 views

How to run shell command in function and intercept standard output

Tell me how to use the trans command of the trans-shell package for translation. I need to write a function that will intercept the output translated text.
user avatar
  • 59
0 votes
0 answers
34 views

emacs opens py file as sh file

Emacs has opened a py file as a shell script. What went wrong and how to change?
user avatar
  • 665
0 votes
1 answer
121 views

How can I move the cursor from a shell window to another window in Evil mode?

Imagine I have following four windows in Emacs: Window 1 is a shell window (M-x shell). Windows 2, 3, and 4 are normal windows with files open. Evil mode is enabled. If I am the shell window, how can ...
user avatar
  • 175
2 votes
1 answer
154 views

Run an external shell command to mutate text

I would like to run par or fmt to format my .md file. In vim this would be %!fmt (for the whole buffer) or 13,16!fmt (for line 13 - line 16). What's the "emacs way" to achieve something like ...
user avatar
0 votes
1 answer
125 views

How to print colorful and bold string in the mini-buffer

When I do echo "\033[1;31mThis is bold red text\033[0m" it should print This is bold red text as red and bold. When I try it in the emacs's shell it prints it as it is instead showing the ...
user avatar
  • 1,112
2 votes
0 answers
69 views

Can desktop sessions be used to save and restore shell buffers?

Is it possible to use desktop-save-mode to save and partially restore my shell buffers? I realize shell buffers have quite a bit of state that isn't under the direct control of emacs, so specifically ...
user avatar

1
2 3 4 5
7