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.

5
votes
1answer
216 views

M-x shell doesn't know about installed apps

I have to launch almost any application by specifying the whole path which is annoying. For example, git works fine, but lua does not. Both are installed in the same place: $ which git /usr/local/...
4
votes
1answer
538 views

How to sort file list in helm-find-files by date

How to sort file list in helm-find-files asks how to sort the file list so that directories float to the top. My question is different: Is it possible to sort the files returned by helm-find-files ...
1
vote
0answers
47 views

Can I have a separate shell switch when compiling?

Whenever I use M-x compile, I like to have the shell that's running to be configured with bash -ic so that I can easily type the compilation command (I switch between languages often, so the building ...
3
votes
1answer
1k views

Why does the Emacs ansi-term and Emacs shell PS1 prompt not match my system PS1?

I'm running Mac OS 10.10.3; Emacs is complied and installed via Homebrew; I run it as a GUI application and it reports This is GNU Emacs 24.4.1 (x86_64-apple-darwin14.1.0, NS apple-appkit-1344.72) ...
2
votes
1answer
826 views

Setting up company for shell autocompletion

When I use company-mode in shell-mode, by default company seems to pull candidates from tokens in open buffers. How can I set up the backend to get candidates from shell commands, directory names, and ...
16
votes
6answers
9k views

Emacs and command line $PATH disagreements on OSX

Having some issues with PATH settings on Emacs that are affecting my Haskell environment: I'm using ZSH, and when I go to the command line and call echo $PATH, it returns: /Users/g/Library/Haskell/...
2
votes
2answers
467 views

Sentence in text is read only even though the buffer is not, how to fix this?

I am running emacs 24 with the Inferior Python mode for the interpreter. See below for all the minor modes in effect. Basically the problem is that particular lines (say at the prompt) remain read-...
1
vote
1answer
121 views

Translating editing actions to keypresses for ansi-term?

For the speech recognition mode for emacs I'm working on I'd like to have support for working with the shell. I have shell-mode working fine but I'd really like to get ansi-term working since some ...
1
vote
2answers
219 views

What's a good workflow for having a few dedicated shell sessions?

At present I use a screen session in the terminal (outside of emacs), with window 0 devoted to running my web server, window 1 to running tests, and window 2 for general hacking. I like this flow and ...
1
vote
0answers
117 views

How to make dired-do-async-shell-command wait for all sub processes to finish

I'm trying to run the bash script, ~/bin/xlda, ... #!/bin/sh # ~/bin/xlda old_filename="$1" new_filename=`echo $old_filename | sed 's/\(.*\.\)flac/\1m4a/'` ~/bin/xld -f alac -o "$new_filename" "$...
8
votes
1answer
1k views

How do I start a shell automatically after starting emacs

One of my main reasons for using Emacs is to get a powerful environment after sshing into a remote machine. The first thing I do after starting Emacs is to run M-x shell to get a command line. As it ...
10
votes
1answer
137 views

How do I prevent one subprocess from starving others?

To be clear, I'm not talking about anything that should require emacs to be multithreaded (though that would probably also solve this). To reproduce: emacs -Q # I'm running 24.4.1 Make a second frame ...
4
votes
2answers
429 views

What is the syntax for a subshell in eshell?

How to write the analogue of a bash-command like: (cd ../repo && git fast-export master) | darcs convert import repo_master in eshell? Here a subshell is employed to restrict the effect of ...
1
vote
1answer
191 views

shell-mode prompt?

I have set in my ~/.emacs.d/init_bash.sh: export PS1='\h:\w$ ' without it, my prompt is bash-3.2$ but now it is bash-3.2$ computername:~/path/to/directory$ How do I make it just be ...
4
votes
1answer
1k views

transparently find file over ssh in *shell* directory

I ssh'd into a remote server from shell and tried to open a file on a directory path that also exists on my local system. The list of files I was able to open using helm-find-files was the list on my ...
0
votes
1answer
246 views

How to define custom compile commands in auctex?

I'm using TeXLive 2014 on MacOS X 10.6 and I'm currently working with Aquamacs 2.5. I'm currently using two different shell scripts for compiling my LaTeX document (thesis), which are located in ~/...
6
votes
1answer
406 views

How can I keep dired in sync with a shell buffer?

I have some work that requires I move around between various sub-directories. Thus, the easiest way I have found to do that is to use dired. I also have to view some files (plain text or code), so ...
8
votes
4answers
784 views

Async shell process buffer always clobbers window arrangement

I frequently launch external programs from emacs using M-!, such as Firefox or Evince, etc. Whenever I do, a buffer pops up full of results for the process, which clobbers whatever else I've got going ...
5
votes
1answer
1k views

Unwanted escape sequences in shell mode

Post title: Unwanted escape sequences in shell mode that are NOT due to colorizing-attempts (see update below) Any idea what can cause (unwanted) escape sequences to continue showing up in the ...
1
vote
1answer
743 views

IPython shell theme

I'm using solarized theme in emacs-24.3. While I'm quite happy with it generally, the IPython shell is blindingly ugly. It is quite clear that the font colors within it are not using solarized values. ...
1
vote
1answer
166 views

Green lines are invisible in diff output for some files in *shell*

I use Emacs a lot including for most terminal sessions. One of activities includes typing git commands inside a shell buffer. I found a very interesting color puzzle. After downloading forked ...
3
votes
3answers
2k views

How to run interactive bash command from Emacs?

I have a command my_cmd that is aliased to another command in my ~/.bashrc. From Perl and Python, I can run this command as bash -ic "my_cmd" (this also works from the terminal window, but here it is ...
8
votes
1answer
1k views

How to force an org-babel session to reset or initialize?

If I run the following babel shell blocks #+BEGIN_SRC sh :session one :results output ssh staging #+END_SRC #+BEGIN_SRC sh :session one :results output hostname #+END_SRC Org creates a shell ...
7
votes
2answers
2k views

Flush all output in shell buffer (and *Messages* too)

Is there any easy way to flush all output in the shell buffer? Since recently (I believe Emacs 24.4 already has this) *shell* buffers aren't editable, they behave similar to how typical terminal would ...
1
vote
1answer
144 views

Where is this cruft coming from in shell-mode and term-mode?

tcsh$ cd ~ ^[]0;sallred@calamity:/home/sallred^G tcsh$ cd bin ^[]0;sallred@calamity:/home/sallred/bin^G tcsh$ What is this cruft that is appearing before my prompt (or perhaps more appropriately, ...
9
votes
3answers
971 views

Any way to make prompts and previous-output uneditable in shell/term-mode?

This is admittedly a superficial question. Although ansi-term starts out behaving correctly when I first open it, it seems to degrade into an 'editable' mode after a few commands, e.g., when I do C-a ...
5
votes
1answer
256 views

Difference between shell and term [duplicate]

I would like to understand what is the difference between M-x shell and M-x term? Also under which circumstances should be used the first and under which the second?
4
votes
2answers
256 views

Advice on setting shell's character set

M-x shell has been my friend for decades, and I've always been comfortable even sympathetic with his insistence on being a dumb terminal (i.e. TERM=dumb). But recently I've found my self setting ...
9
votes
4answers
2k views

How to make shell-command run using shell profile and current directory hooks (ex. direnv)

I am trying to get shell-command and async-shell-command to integrate seamlessly with a couple of programs in my .bashrc file, specifically direnv in this example. I found that if I customized shell-...
2
votes
1answer
975 views

How to disable completion-at-point in emacs shell (i.e., so I can have my `TAB` key back)?

Any suggestions on how to disable completion-at-point in Emacs shell (see below)? I've looked in the GNU docs on the relevant hook (which is oddly named) - completion-at-point-functions - but given ...
7
votes
1answer
626 views

Change syntax highlighting without changing major mode?

I want to start a python-shell M-x python-shell. If I'm not happy with the syntax highlighting, is it possible to improve it (put more colors in the buffer) without changing major mode? In vim this ...
11
votes
1answer
871 views

Attach to running remote shell with eshell/TRAMP/dtach

I often use GNU Screen to keep remote sessions alive. Since I live in Emacs, I'd really like to be able to resume a running remote shell session from within Emacs. GNU Screen implements all sorts of ...
7
votes
1answer
2k views

“terminal is not fully functional” over ssh in a *shell* buffer

I'm using the shell (M-x shell) to connect to a remote host via SSH. After launching some command line tools (mostly psql, the postgresql command line interface, but man would be the same for example),...
8
votes
3answers
796 views

Persistent environment for M-x compile

When I run M-x compile it spawns a new subshell to execute my compile command. As soon as the compile command returns, the shell process is killed. I can see why this would be desirable in most cases, ...
23
votes
3answers
3k views

How can I run an async process in the background without popping up a buffer?

I have defined some functions to run async background process using async-shell-command in my .emacs, but everytime I run the commands a new window (not frame) is created and the process' buffer is ...
25
votes
1answer
589 views

What are all the ways of launching a shell from inside emacs and what are their various properties?

I know of at least four possibilities: eshell term ansi-term shell What's the complete list of tools built-in to emacs to launch a shell, and what benefits and drawbacks do they offer?