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
3answers
179 views

run emacs function in the shell with parameter

Since there is parameter I need to use, so I will not use single quote as the question's answer First, I try emacsclient -q --eval (progn (find-file "ORG/${UN}.org") (org-latex-export-to-pdf)) ...
1
vote
3answers
626 views

How to execute shell command from editor window?

I have two windows open - one in editor mode with some SQL, bash, etc and the other in ansi-term. I want to mark my text and then execute it in the ansi-term window. Yes, I could make a shortcut ...
1
vote
0answers
272 views

byte-recompilation of files under a directory

As I move all my emacs.d between my machines using Git, and, obviously, I don’t version control byte-compiled files (*.elc), I sometimes get into a situation when my .el files are newer then the ...
4
votes
2answers
912 views

Execute current line in shell

I often find myself copying commands line by line from an emacs buffer to my terminal. How do i bind a shortcut which sends the current line/selection in emacs to my gnome-terminal?
1
vote
1answer
66 views

Is there a package to send a piece of text to shell and get the result back?

I want to know if there is a package to send a piece of text to shell commands like sed, awk or other text processing utilities and then get the result back to emacs? Thanks.
2
votes
1answer
116 views

Can't parse the output of manpages in pcmpl-args.el in Emacs 25.1.1

This is a followup to this question, as I originally was uncertain as to how to make this question into a suitable format for this site. So, I'm a user of pcmpl-args.el, which is an Emacs package that ...
3
votes
2answers
1k views

TERM, terminfo, termcap. What are they how does Emacs use it?

I have a few questions about the relationship between TERM, terminfo and termcap and Emacs. I do not know exactly what TERM, terminfo and termcap are. I am on OS X. I do not know what values (and ...
2
votes
3answers
691 views

Open shell on Mac OS X

I'm very new to emacs and am currently using it to edit files on mac os x. How do I open instances of the shell from inside emacs so that I can execute the code I'm working on?
0
votes
1answer
65 views

In a new shell, move to directory of other current buffer being edited?

I am using emacs to edit Latex. My work flow is to open the latex file, open a new buffer in a separate window via C-x 2. Then moving the context into the new windowbuffer via C-x o, I type M x shell ...
2
votes
1answer
459 views

How to console inside of emacs?

I have spacemacs and a problem I have compared to using terminal+vim is that I could do everything in the terminal : create files, directories, whatever and whenever I need to edit a file I just type ...
0
votes
1answer
168 views

Limit virtual memory for all emacs sub-processes

I know I can use ulimit -v ###KiloBytes### to limit the virtual memory of a shell and all subprocesses started by it, but it's annoying to have to open emacs from a shell everytime just for such a ...
1
vote
1answer
100 views

How to get shell mode to properly handle my PS1, which involves user-defined function calls?

My bash_profile includes a couple functions to build the prompt. This is a super-simplified version, which I'm using to try to debug the problem with: custom_git_function () { echo "git" } ...
0
votes
1answer
75 views

Is there a key-binding to move the cursor to the last character in the buffer

Is there a key binding that moves the cursor to the last character in a buffer? I'm asking because I often find myself at a point other than the last character, where I want to be, in the interactive-...
37
votes
2answers
7k views

Weird shell output when using IPython 5

I just upgraded to the latest version of IPython and now something is wrong when using it in emacs. When using it in a regular terminal it works fine (colors, tab-completion, etc.), however either ...
1
vote
1answer
248 views

scilab-mode : how to interpret a .sci file?

I work on ubuntu 14.04 with scilab installed. I put Alexander Vigodner's scilab.el in my init.el load path and I created a scilab-startup.el file loaded by the init file. My question is, how to ...
4
votes
0answers
511 views

FZF broken displaying in emacs terminal

I'm struggling to run fzf in emacs but cannot figure out whats my problem. When I run fzf - and start typing - text gets mess up, similar to this: I tried run fzf in term, eshell, ansi-term, multi-...
1
vote
1answer
145 views

help with dired function i wrote..how to insert current file at point into buffer?

i have zero coding skills but somehow (mainly goggle) managed to write this script (defun z/dired-shell-other-window-beets () "Open a shell with dired path in a new window and issue beet import on ...
6
votes
2answers
382 views

Emacs is garbled by output of a background process running in the same terminal emulator

My Emacs is running in foreground in terminal emulator, where I am also running some background processes. My Emacs is garbled by the stdout and stderr output of the background process. Besides ...
2
votes
0answers
314 views

Custom Bash prompt doesn't display correctly in shell mode [closed]

In my .bashrc file I've set the PS1 variable to this to customize my prompt: export PS1='[\D{%Y-%d-%m} \t \u@\h \W]\n$ ' The format strings are explained in the Bash manual. This one gives me a ...
0
votes
1answer
191 views

Emacs shell send ^] (hat-right-sqare-bracket)

Trying to run telnet in Emacs shell I cannot figure out how to send ^] to terminate it.
3
votes
2answers
122 views

How to launch terminal.app from elisp

I've been using shell-pop recently, and it's nice how I can pop to default-directory in term immediately. For the times I'd rather use a dedicated terminal, is it possible to create an equivalent for ...
2
votes
1answer
590 views

Run a shell command as lisp

When I write, for example, (format "The value is %d." fill-column) and type C-c p after it, it outputs a result. How could I do the same with a shell command? That is, to run a shell command within a ...
0
votes
2answers
74 views

`M-! enter shell command enter` in org mode does not insert output in current buffer

When I run M-! enter shell command enter in org mode, I expect the output to be inserted into the buffer I have active. Instead, emacs opens a second buffer (splitting the window in two) and inserts ...
2
votes
1answer
162 views

How to call “echo ${GOPATH}” with call-process?

I try to execute echo ${GOPATH} with call-process as below: (call-process "echo" nil t nil "${GOPATH}") But it only output "${GOPATH}" not the value of that value. Would anyone please let me know ...
0
votes
1answer
90 views

shell-command and C-h

If I create a string from the output of a shell command, using shell-command-to-string, I sometimes see ^H characters in the string, when I guess those characters were supposed to result in ...
9
votes
3answers
7k views

Git Bash in emacs on Windows

I can run the Bash shell that comes with Git for Windows. I put this in my .emacs: (defun git-bash () (interactive) (let ((explicit-shell-file-name "D:/Program Files/git/bin/bash")) (call-...
0
votes
2answers
907 views

Can't see pdb output from shell-mode

I'm on Windows, for what it's worth. Just to make sure that it wasn't something that I did, I fired up emacs using -Q to avoid loading my init.el and attempted to run some python with a breakpoint ...
1
vote
0answers
156 views

How to enable control character (e.g. carriage return) handling in emacs shell

I run compilation processes that, in a terminal, list what was built all on the same line. In emacs shell they are all on separate lines, filling my shell buffer with unwanted output. I realize I ...
14
votes
1answer
546 views

How to prevent backspace from deleting my shell prompt?

It is a usual shell display: ME@mycomputer: ~$ echo When I do backspace several times It becomes: ME@mycompu How to prevent the system word from deleting
1
vote
1answer
90 views

Can magit-git-command use Emacs mini-buffer when prompted?

In my company we use a Git extension which has command-line interface that requires interaction (answering prompt). I would like to extend Magit to be able to deal with our extension. Unlike most of ...
1
vote
1answer
962 views

Windows 10 + Emacs shell--can't run processes from eshell; unwanted cmd windows open

I've been upgraded at work to a Windows 10 machine, from Windows 7. Apparently, this has caused problems. First, eshell doesn't seem to be able to launch windows processes anymore. I get "Spawning ...
2
votes
1answer
54 views

Specify and use inferior shell only once

I know you can customize settings or set environmental variables to get emacs to use other shells in shell-mode (1, 2). Is it possible to simply start a shell specifying which shell you want to use ...
2
votes
1answer
225 views

How to discard stderr when running a shell function?

If I run (setq some-variable (shell-command-to-string some-command)) ...and the execution of the command in some-command results in some output sent to stderr, this stderr output ends up in some-...
8
votes
2answers
2k views

Should I have removed `(shell . t)` to clear an ob-shell initialization error?

First post. I'd like to confirmation whether I sucessfully troubleshooted an install of Emacs, and, if I didn't, direction on where and how to proceed. My setup: Emacs 24.5 Macbook Pro Core Duo (mid-...
8
votes
1answer
2k views

How to prevent Emacs from showing passphrase in `M-x shell`?

I tried using attic with a passphrase to backup my files from inside M-x shell. The shell exposed the passphrase as plain text in the buffer and made it available by typing M-r as well as by looking ...
0
votes
1answer
69 views

automatically run command when establishing ssh connection

I often work on remote hosts and I mostly need to be root, but I can't login as root. It would be convenient, if sudo -s is being executed automatically when I establish a connection with shell/eshell....
2
votes
1answer
241 views

How can i use a different shell in Emacs Shell?

I am currently using Zsh in my regular terminal app on my Mac OS X. However, it's heavily customized and colors don't appear properly inside Emacs. So I am thinking, I should probably use shell-mode ...
2
votes
0answers
153 views

Basic process management under Windows

I've got the following elisp: (setq proc (start-process "powershell" "*powershell*" "powershell.exe")) Unfortunately, I can't seem to get proc to do anything. For instance, in an normal shell, I ...
2
votes
1answer
1k views

How to run tmux in Aquamacs

I quite like tmux and Aquamacs. I've recently been interested in how to integrate the two together. As far as I know, one cannot run Aquamacs within a terminal even with the Aquamacs CLI tool, so the ...
2
votes
2answers
40 views

Take path preceding cursor and run a shell command on it

Consider a buffer holding the following contents: foo ... some text /foo/bar/hello.csv𝙸 ... bar where 𝙸 represents the location of cursor. I would like to have an interactive function that ...
10
votes
1answer
962 views

Is it possible to read user input from STDIN while tangling a source block?

Is it possible to read user input from STDIN while tangling a source block with org-babel-tangle? I am aware of this: Org Mode Babel - Interactive code block evaluation. That doesn't help solve this ...
1
vote
2answers
3k views

weird characters in shell mode with zsh

I recently switched to zsh (with oh-my-zsh) as my primary shell, but running the shell from emacs results in some strange (for lack of a better word) "residural" characters; however changing to bash ...
1
vote
0answers
236 views

Send Python Buffer to ansi-term

I recently started using emacs to code in Python. I currently prefer to use python mode (defined in python.el) alongside ansi-term for the python interactive shell. I'm trying to change the behavior ...
6
votes
1answer
2k views

Org-babel invoking cmd.exe

Is there a simple configuration to get org-babel to invoke cmd.exe that doesn't involve modifying the org-babel source? Googling for ["org-babel" sh "cmd"] finds this email list discussion from 2010: ...
5
votes
2answers
584 views

Print process output line by line

Read process output line by line gives some partial ideas about how to deal with sub-process output in an intelligent manner, but no example and no working solution. I have a couple of examples, one ...
0
votes
1answer
42 views

Exports in compile command

I'm using the Anaconda distribution for Numpy, Ipython etc. and during the installation the following was added to my .bashrc: # added by Anaconda2 2.4.0 installer export PATH="/home/matthias/...
0
votes
1answer
74 views

Terminfo does not export the up arrow resource

When I use TRAMP and a remote shell, terminfo doesn't export the kcuu1 (up arrow) resource. How can I get Emacs to provide this?
0
votes
0answers
33 views

UI issues in Spacemacs shell [duplicate]

I'm using Spacemacs and multi-term on OS X 10.11. Preferred shell in zsh with oh-my-zsh installed. In the Spacemacs shell window, there are two weird UI issues: Command line never scrolls to the ...
2
votes
1answer
44 views

Manual pages priority in Emacs

Emacs provides a nice manual viewer which could be used for obtaining documentation for C syscalls (at point with Man-default-man-entry. However, it always starts searching manuals from section 0. How ...
1
vote
1answer
652 views

Remapping Esc to Tab in Spacemacs

I'm accustomed to remapping Esc to Tab in Vim. In Spacemacs this can be done with: (define-key evil-insert-state-map [tab] 'evil-normal-state) (define-key evil-visual-state-map [tab] 'evil-normal-...