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
2
votes
1answer
305 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
152 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
84 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
73 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
231 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 ...
3
votes
0answers
468 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
144 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
373 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
260 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
183 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
113 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
517 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
71 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
151 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
80 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
815 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
136 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
503 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
86 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
906 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
53 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
208 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-...
7
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-...
7
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
63 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
179 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
150 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 ...
9
votes
1answer
905 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
227 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 ...
5
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
460 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
38 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
72 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
31 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
42 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
610 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-...
1
vote
1answer
62 views

How to know output type

I've got this code: (defun insert-random-uuid () (interactive) (shell-command "uuidgen" t)) which produces a uuid that looks like this ffc715d2-1e10-4faf-b1f6-f85cae88a7d7. However, I believe it'...
7
votes
1answer
702 views

File and directory autocompletion in remote shell

In my local shell, completion-at-point after cd returns a list of directories. However, when I ssh into a remote, Emacs thinks I'm still in my local home directory. How can I configure Emacs to give ...
5
votes
1answer
582 views

Key binding with an argument

Say I have a shell command foo that I want to bind to a key. I could do for example: (global-set-key (kbd "C-c f") (lambda () (interactive) (shell-command "foo"))) I would like to be able to pass an ...
13
votes
2answers
4k views

Tramp mode is much slower than using terminal to ssh

I am using the Macports flavor of Emacs on OSX Yosemite, and have looked through every thread here on Tramp being slow without any solution. Tramp is usable, but there is about a 100ms delay between ...
3
votes
1answer
339 views

How can I connect to a REPL and send and read data?

Let us say I have a command to start a REPL. How do I most easily read output and send input? A minimal example with shell, sending ls and reading the output would be appreciated. The shell should ...
4
votes
1answer
806 views

/bin/ls --color=always fails to produce colorized output in shell-mode

I have run M-x ansi-color-for-comint-mode-on. Also, when I use /bin/ls --color=always (or /bin/ls --color=auto) in a regular terminal, I do see colors in the output. It's only within Emacs' shell-...
4
votes
2answers
333 views

Discard stderr in start-process

I'm using start-process to run mplayer and when playing videos I get a ton of output to stderr from "vdp_...". On the command line I usually just 2>/dev/null but start-process runs it directly without ...
7
votes
3answers
2k views

How to make terminal/shell spawned inside Emacs running on a Mac inherit the environment variables of the native terminal?

The terminal natively on Mac i.e. spawned through Spotlight or Launchpad, adopts the desired environment variables including the customization in ~/.bash_profile. But when I run Emacs (Emacs.app taken ...
0
votes
0answers
182 views

Incorrect Line Spacing in (term-mode, ansi-term, eshell, shell) Output

The output of certain commands in multiple major modes (term-mode, ansi-term, shell, eshell) is incorrectly spaced (see images). This occurs for numerous commands and does not occur in other emulators ...