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
6
votes
2answers
501 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
3k 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
215 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 ...
10
votes
3answers
4k views

How do you configure emacs for julia?

What is a recomended way for making emacs as julia code editor? The things which I would like to have are: autocomplete julia shell in emacs with abbility to send the code from buffer debugging
1
vote
1answer
853 views

How to automatically run inferior process when loading major mode?

Like suggested in this question How to automatically run inferior process when loading major mode for the first time? I want to automatically run run-python when entering python major mode. However, (...
5
votes
2answers
1k views

Binding shell commands to hotkeys

Been scouring the internet for a couple days now trying to figure out the solution to my question with no luck. Hopefully someone here knows how to do this. I'm currently trying to set up my EMACS ...
2
votes
1answer
185 views

How to make the init file compatible with X and console at the same time?

I have customized the .emacs file a little to suit my taste, and it works fine when run in its own window. But when I try to run it in my terminal using the command emacs -nw, it throws up the ...
5
votes
2answers
961 views

Can emacs commands be called from a shell script?

I have a directory ~/foo that contains several org files. I'd like to use htmlize to convert each org file into an html file. Ideally this would be done with a shell script. Is there a way to make a ...
5
votes
1answer
252 views

Output to magit-process

When I run built-in magit commands, they output to the magit-process buffer. How can I do the same with a custom magit command that generates shell output?
3
votes
1answer
63 views

org hyperlink multiple actions

How do you execute multiple actions on a single org-link? Org-mode has links that can initiate actions, such as elisp: and shell:. It would be nice to initiate several such actions on following a ...
0
votes
2answers
645 views

In shell, eshell and comint-modes, the cursor moves back one chacacter when I switch buffers

When I'm in a shell and I change buffers, if I switch back to the shell buffer, the cursor has moved back a character and I can't start typing new shell commands until I hit -> first. This happens ...
6
votes
1answer
2k views

Why Emacs overrides my PATH when it runs bash?

Why do (shell-command-to-string "echo $PATH") and echo $PATH in eshell differ from echo $PATH from ansi-term and gnome terminal in Ubuntu? Some paths are missing from (shell-command-to-string "echo $...
0
votes
1answer
62 views

Prompt can be be deleted in run-scheme but not in run-python?

Prompt can be deleted when I do a run-scheme but not in run-python. Is there a way to make it standard i.e not to delete the prompts? I checked the comint-mode manual but couldn't find anything that ...
3
votes
1answer
677 views

Inferior Python shell slow/crash on long lines

so I've learned that emacs cannot handle multi-line strings very well, for example printing big data structures in inferior python shell (invoked with run-python) is dangerous and usually ends with ...
8
votes
3answers
1k views

How to make a shell command totally silent (preventing it to split window or to open a new frame/window etc)

Is it possible to run a shell command silently (in background)? When I use async-shell-command, emacs split the windows. I would like that an specific shell command to be totally in background (...
5
votes
2answers
4k views

How to open `shell` or `eshell` in a new window or frame

By M-x eshell or M-x shell Emacs opens a shell or an eshell in the current window. How to open this shell or eshell in a new window?
4
votes
3answers
846 views

dirtrack mode with fish-shell

I recently started using the fish shell. I tried using it in term-mode in Emacs. One characteristic of this shell is that it shortens the current working directory before printing it as the prompt. ...
1
vote
1answer
320 views

Repeat last shell command shortcut

How can you repeat last shell command with a single shortcut (and no y/n prompts)? How to replace this sequence: C-u C-x s (or equivalent) to save all buffers M-! for (shell-command COMMAND &...
5
votes
1answer
247 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
813 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
52 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
1k 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 ...
22
votes
6answers
16k 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
660 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
144 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
279 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
127 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
2k 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
166 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
621 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
245 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
2k 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
337 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
550 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
1k 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
873 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
190 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 ...
4
votes
3answers
3k 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
2answers
2k 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 ...
8
votes
2answers
3k 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
186 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
1k 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 ...
6
votes
1answer
363 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
343 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 ...
8
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
1k 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 ...
8
votes
1answer
778 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
1k 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 ...

1
3 4 5
6
7