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
0answers
22 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?
0
votes
1answer
20 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 ...
2
votes
1answer
83 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 ...
0
votes
1answer
35 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 ...
0
votes
0answers
29 views

Emacs gives `stty: 'standard input': Inappropriate ioctl for device` in ZSH shell

I am running emacs inside ZSH shell. I have current lines in .zshrc file, which I believe affects the emacs behavior it is using shell within: stty eof undef stty sane && stty erase "^H&...
1
vote
0answers
26 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 ...
1
vote
1answer
28 views

Elisp - Changing directory in shell buffer

I want to open an instance of a terminal emulator (in my case term) and go to a specific directory, all with a single Elisp function. My idea was to send a specific string programmatically to the ...
0
votes
0answers
21 views

/bin/top not found in eshell over ssh

How does eshell resolve its PATH? If I run my top in eshell on my local machine, it opens a new buffer and shows the output of the command in it. However, if I do the same on an eshell run on a remote ...
0
votes
2answers
19 views

How to not let a shell to capture the space key in Spacemacs?

In spacemacs, the space key is used to trigger the command shortcut, and an extra space can lead to a input/search of emacs command. Now I run into this situation: I use SPC b n to switch to next ...
1
vote
2answers
77 views

how can I run conda in emacs shell?

I've been using Python command 'conda' in the terminal on my Mac. But when I run a command like 'conda activate ...' in Emacs's shell (M-x shell), it gives me this objection: CommandNotFoundError: ...
0
votes
1answer
23 views

Run latexmk inside z shell instead of shell

Problem I am using latexkm to compile .tex documents, and recently I got this error while compiling: Running `latexmk' on `AF2021_serie5' with ``latexmk -bibtex-cond -pdf -synctex=1 AF2021_serie5'' Rc ...
0
votes
0answers
25 views

Dealing with unwanted output

If you used shell-mode for a while, you probably ran into situation where there's a process spitting lots of output very fast, so that C-g and C-c C-c don't really help. One way I found to be somewhat ...
1
vote
1answer
28 views

Can I format the arguments in a table and provide the rows to a shell block as arguments?

In org-mode, is possible to provide arguments formatted as a table to a shell block? E.g. argument |a|b| |c|d| shell script echo $a expected results a b c d Basically, I want org-mode to read the ...
1
vote
0answers
50 views

org-babel: zsh sessions use bash

#+BEGIN_SRC zsh :session z1 echo $HOME $0 #+END_SRC #+RESULTS: : /Users/evar /bin/bash I am thinking of trying the workaround outlined here, but shouldn't this work out of the box? Update: I couldn'...
0
votes
0answers
20 views

Emacs PNG as a text showing freezes

I am trying to see image as a text but when I compile this program in Emacs it freezes. Is the problem in Emacs when showing images as text? My Python code is right below. import requests as req ...
0
votes
0answers
27 views

How to get rvm to work with projectile-compile-project and shell-command (Emacs macOS GUI)

I'm using the exec-path-from-shell package to copy my environment variables, including PATH. But shell-command (M-! which ruby RET) only finds the system ruby, not my user-local rvm ruby. Similarly, ...
4
votes
1answer
116 views

Org Src Block does not return any output

TL;DR: How do I get the stderr of my source block to be part of the #+RESULTS block, without changing the contents of the block? I can only get stdout to appear. [Long and winding explanation] While ...
0
votes
1answer
53 views

Starting a shell then cd to a specific directory

I want to go to a specific directory after I start a shell. So I put these lines in my .emacs file: (shell) (shell-command "cd C:/MyStartUp/ThisDirectory") (setq default-directory "C:/...
0
votes
0answers
32 views

is there a way to make compile shell process happen in eshell / “real” shell?

i wanted to bind a key to a compile and run command, then i found this post, Compile and run single file c++ programs in Emacs[SOLVED] ( last answer) It works perfectly fine and as intended. The only ...
2
votes
1answer
22 views

Fixed length buffer for shell

I launch a shell in my session with M-x shell and then I launch a python script that produces a lot of output to stdout---so many lines of output that my emacs session beomes quite slow. Is there a ...
1
vote
1answer
60 views

Process shell exited abnormally with code 53 on windows 10

I'm using emacs 26.2 installed through msys2. Recently starting subprocesses from emacs has stopped working for me. Specifically M-x shell and shell-command-to-string. I get the feeling this is due to ...
1
vote
1answer
58 views

M-x compile hangs with WARNING: terminal is not fully functional

I have been using M-x compile for ages. Lately (our sysadmin has updated many things) it hangs after giving this message: WARNING: terminal is not fully functional - (press RETURN). Pressing return ...
0
votes
0answers
80 views

Python : name '__file__' is not defined

So as you can see, in my terminal, I was able to execute the file without error, but once I tried from the python shell, whether in the terminal or the one integrated in Emacs, there is an error, it ...
0
votes
0answers
17 views

Using extended glob quantifiers break Zsh mode indenting and highlight

This is a small issue, but annoying to deal with. Suppose I have the following function: function zicompinit_fast () { setopt extended_glob local_options autoload -Uz compinit local zcompf="...
0
votes
0answers
52 views

Execute a command from a buffer

Say, you create a new buffer (Fundamental), type a shell command and want it executed. Like you can do in a *scratch* buffer with lisp code (C-x C-e). Or you have a text file, that has text ...
1
vote
0answers
24 views

How could I see the output of my Python code in the echo area?

When I press C-c C-c(python-shell-send-buffer), I get output shown below. Afterwards when I do the same operation (C-c C-c) I always see Sent: #!/usr/bin/env python3... in the echo area. I just want ...
0
votes
0answers
33 views

Emacs shell isn't opening correctly

I have just installed Emacs, but when I try to open the shell, this error comes up: emacs: /usr/bin/fish: No such file or directory Process shell exited abnormally with code 127 I used to have fish ...
0
votes
1answer
55 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
57 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 ...
1
vote
0answers
50 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
48 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
28 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
1answer
22 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 ...
0
votes
1answer
48 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
2answers
66 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
26 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 ...
0
votes
0answers
13 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
35 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 ...
0
votes
1answer
75 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
33 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) ...
1
vote
2answers
443 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]?
0
votes
1answer
61 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
0answers
58 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
169 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
22 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
140 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.
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
28 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
1answer
70 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
2 3 4 5 6