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
37 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
8 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
39 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 ...
0
votes
0answers
19 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
32 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
33 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
37 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
32 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
37 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
25 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
18 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
29 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
40 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 ...
0
votes
0answers
12 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
31 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
57 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
32 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
248 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
59 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
53 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
74 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
21 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
80 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
27 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
51 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 ...
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
118 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
12 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 ...
2
votes
1answer
152 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 ...
0
votes
0answers
50 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
66 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
136 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
68 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
100 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
18 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
45 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
1answer
103 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 ...
0
votes
2answers
116 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, ...
3
votes
3answers
189 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 ...
0
votes
0answers
26 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) ...
1
vote
1answer
122 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
1answer
133 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 ...
2
votes
1answer
115 views

How do I make file paths clickable/navigable in Shell as described in the documentation?

For the life of me, I cannot get this functionality to work: https://wikemacs.org/wiki/Shell#Make_file_paths_clickable I've run (add-hook 'shell-mode-hook 'compilation-shell-minor-mode) in my .emacs ...
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
vote
1answer
114 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 ...
0
votes
1answer
25 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 ...
0
votes
0answers
336 views

How to execute a shell script inside of emacs?

I simply want to execute the whole file I am editing right now in a small shell buffer just like I can run my python script. How can I do this?

1
2 3 4 5 6