Questions tagged [ansi-term]

is for the Emacs ansi terminal emulator. Emacs supports ANSI-standard VT100-style escape sequences recognized by such modern terminals as xterm. `M-x ansi-term` command starts a terminal, which by default runs in a sub-shell in a buffer named `*ansi-term*` with `term-mode`.

Filter by
Sorted by
Tagged with
25
votes
1answer
611 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?
14
votes
1answer
1k views

Getting more than 8 colors in a terminal emulator inside Emacs

My understanding is that ansi-term only supports 8 colors (a good discussion of this in reddit here). Meanwhile, an increasing number of terminal emulators (e.g. tmux or iTerm2 in OS X) support True ...
12
votes
1answer
1k views

Automatically update default-directory when PWD changes in shell-mode and term-mode

Are there any options or packages which cause default-directory to be updated if the working directory changes in shell-mode and term-mode? I.e. when using cd, but the solution would have to be more ...
10
votes
1answer
1k views

Stray trailing 4m before prompt with Zsh in M-x ansi-term

I recently read Running Shells in Emacs, and spend some time to adapt my elaborate Zsh prompt to work with the limited capabilities of M-x shell and M-x ansi-term. Following this effort I'm now ...
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 ...
5
votes
3answers
1k views

locale when launching Emacs.app on OS X

I'm running OS X Yosemite and Emacs 24.3 from Homebrew. The locale setting for my user is: LANG="en_AU.UTF-8" LC_COLLATE="en_AU.UTF-8" LC_CTYPE="en_AU.UTF-8" LC_MESSAGES="en_AU.UTF-8" LC_MONETARY="...
4
votes
1answer
3k views

Can't use M-x in ansi-term mode

When in ansi-term, i can't use M-x, the keyboard shortcut doesn't do anything. Does anyone know how to fix this?
4
votes
2answers
838 views

Always enter emacs mode with ansi-term

I have a freshly installed spacemacs installation and I want to make it so that I ansi-term is in emacs mode. However, I try to add (add-to-list 'evil-emacs-state-modes 'term-mode) to my .spacemacs ...
4
votes
1answer
612 views

mutt (and others) in ansi-term - terrible refresh rate

I'm trying to run mutt in ansi-term in the GUI on OS X. The refresh rate is really slow for some reason, so when I try to navigate between emails the result is pretty much unreadable. Has anyone found ...
4
votes
1answer
567 views

How do I configure moving by and deleting words in ansi-term?

In ansi-term's "char run" mode, I can use C-<left> and C-<right> to move around in steps of one word, but as soon as I start typing again, the point moves back to where it was. They work ...
4
votes
1answer
633 views

How to copy command output in ansi-term mode?

In ansi-term mode, is there a way to copy the command output? This is quite easy in eshell, but sometimes eshell behavors not exactly the same with bash. For example: eshell doesn't know how to auto-...
4
votes
1answer
436 views

Undesirable Cursor Jump After Movement with M-left or M-right in Term-Mode

When I reposition the cursor in term-mode or ansi-term with M-left or M-right, it always returns to its original position (see animation below). Is this behavior standard? Is there a way to change it ...
4
votes
0answers
421 views

Tmux and term-mode

I've been running tmux inside of my term buffer but when I do that there are some issues and the buffer often becomes messed up, with the cursor being in the wrong spot and overwriting text or other ...
3
votes
3answers
129 views

Reading info files without knowing their path

If I'm in a terminal, I can just type info glibc and get info about glibc. Since emacs reads info files, it's silly to use M-x term to read info files from within emacs. I know you can use C-u C-h i ...
3
votes
2answers
742 views

How to define a function that calls a console process using ansi-term?

I'm using Julia within emacs, and I've found that despite the existence of ess and julia-mode, the best way for me to do that seems to be to use ansi-term and execute: ipython3 console --kernel=julia-...
3
votes
2answers
617 views

Interpret terminal escape codes in generic process output

I'm running a (start-process) which spits out terminal escape codes into a buffer and it looks ugly. Is there a mode that will interpret these codes into colors? Something similar to whatever ansi-...
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) ...
3
votes
1answer
116 views

Mongo console doesn't behave properly in ansi-term

In ansi-term when using mongo console (or 'repl') control codes do not seem to behave properly. When I move cursor it doesn't get redrawn at a expected location. Instead all entered text get appended ...
3
votes
2answers
279 views

Calling emacsclient from ansi-term makes emacsclient hang, how do I get around this?

Sometimes I use ansi-term in emacsclient instead of directly using my shell. When I do this, it is not an infrequent occurrence that I forget where I am and call emacsclient someFile, which freezes ...
3
votes
0answers
464 views

Terminal Buffer: error in process filter: Invalid face: unspecified

On Fedora 25 with GNU Emacs 25.1.90 (which I am running via an AppImage, you can download it from here and test out your theories as to what's wrong if you would like, remember AppImages will only ...
3
votes
0answers
481 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-...
3
votes
0answers
224 views

Emacs 25 + comint + -nw = eaten newlines

I've been building and running Emacs 25 prereleases on a recent Fedora system that I usually access via ssh. I usually run this emacs in a terminal, and I'm fond of using ansi-term inside it. I've ...
2
votes
2answers
104 views

How to make M-x ansi-term behave like M-x shell (opening in new window)?

I use (global-set-key (kbd "C-c a") '(lambda () (interactive) (ansi-term "/bin/bash"))) to open a bash ansi-term. Unlike M-x shell, this "occupies" the whole buffer/frame. I am wondering if one ...
2
votes
1answer
185 views

Nano not displaying correctly in term and ansi-term

Nano is displayed incorrectly in emacs when using term or ansi-term. This is what nano is supposed to look like (run in an ordinary terminal emulator): This is nano as run from ansi-term: In the ...
2
votes
1answer
486 views

Killing ansi-term says: “… has a running process”

Whenever I kill an ansi-term buffer I have to confirm due to the fact of: "ansi-term has a running process; kill it ?", (even if nothing is running btw). How could I have Emacs killing the term ...
2
votes
1answer
491 views

ansi-term scroll problem on fast output

I use a terminal from within Emacs via M-x RET ansi-term RET. The problem is that when I run a program which echoes a lot of output, ansi-term first scrolls with the output (such that the last line of ...
2
votes
1answer
62 views

How to have a buffer interpret C-m as an actual carriage return

I'm using the following elisp snippet in a dedicated buffer to track progress of a wget download. (with-current-buffer buf (setq proc (apply 'start-process "my-download" buf (list "wget" (...
2
votes
2answers
1k views

Fish shell looks weird in spacemacs

Any other shell besides eshell and shell in Spacemacs with Emacs v25.1.1 (GUI version) looks like this: To compare, the terminal in iTerm looks like this: The font that I use in my terminal is ...
2
votes
0answers
61 views

Multiline prompt with ansi-term

Running plain Emacs with emacs -Q then running ansi-term, if I input some long text in the prompt such that the text breaks into the next line (without hitting Return), then I hit C-x 2 to create ...
2
votes
0answers
206 views

Output reflow in ansi-term [duplicate]

In gnome-terminal, the output of some commands is automatically "reflowed", in the sense that if the file tmp has content 0000000000 and the terminal has width 9, the output will be displayed as $ ...
2
votes
0answers
138 views

ANSI TERM via `M-x TERM`: How to change line highlighting color?

How do you change the line-highlighting color in an ANSI-TERM?: I am using PDB++'s sticky mode for Python debugging. This is how to appears on a regular terminal (lubuntu 17.04): Notice the word ...
2
votes
0answers
300 views

How to make ansi-term output read only?

When using ansi-term in line mode emacs lets you edit the buffer arbitrarily, not just after the last prompt. I'm trying to make it read only so I stop fudging with command output. The problem is all ...
1
vote
2answers
48 views

Why can't I use my custom keybinding in ansi-term's char mode?

I'm an emacs noob —why can't I use this key (global-set-key (kbd "M-o") 'other-window) defined in my emacs config, in ansi-term char mode? Are all meta keybindings simply passed raw to the ...
1
vote
2answers
786 views

How to paste into ansi-term (evil-mode)

I want to copy some text from my browser and paste it into ansi-term. I am a vim user and I want to give spacemacs a try once again. Naturally what I did was: Opening ansi-term by typing SPC SPC ...
1
vote
1answer
307 views

Startup script for term-mode

In the documentation for shell-mode: Emacs sends the new shell the contents of the file ~/.emacs_shellname as input, if it exists, where shellname is the name of the file that the shell was ...
1
vote
3answers
660 views

How to copy text from a buffer to an ansi-term

If I create a second window with a terminal in it like: C-x 2; C-x o; M-x ansi-term How can I copy text from a buffer into this terminal? I seems like the ansi-terminal has its own kill-ring (maybe ...
1
vote
4answers
1k views

From eshell or ansi-term can I open a file in the same window without a new instance of Emacs?

I'm wondering if anyone knows of a clever way in Emacs when in a shell, can I directly open a file without having to open it in another Emacs instance.
1
vote
3answers
578 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
1answer
133 views

Some UTF-8 characters break my ansi-term. How to fix it?

I've got a script that generates some output. Some parts of the output are cyrillic letters, and they cause my ansi-term to break - I guess they are treated as control characters(they are displayed ...
1
vote
1answer
218 views

“smart” ansi-term on start-up?

I have the following line in my .init.el (ansi-term "/usr/bin/bash") , because I usually like to have a terminal running in my emacs. The problem is that sometimes I don't, for instance, when I just ...
1
vote
3answers
382 views

Honor default-directory in ansi-term

When I launch an ansi-term in a remote (TRAMP) buffer, I'd like the resulting shell to reflect the current default-directory. That is, I'd like ansi-term to give me a remote shell, so I can do things ...
1
vote
1answer
52 views

Launch ncurses application and cleanup once it exits

I'd like to occasionally use hg split and hg commit --interactive from Emacs, but those commands bring up a GUI. At the moment I either use a separate terminal or ansi-term for those, but would like ...
1
vote
1answer
44 views

How to call lynx on URL inside a program

During my LaTeX typesetting I need to "visually" check if URLs point to reacheable pages. I'd like to do it with lynx in a separate emacs buffer so I wrote this function: (defun urls-check-if-working-...
1
vote
1answer
232 views

Emacs opens gitbash in new system window

I've try to follow this question and sulution Git Bash in emacs on Windows I have this function: (prefer-coding-system 'utf-8) (defun git-bash () (interactive) (let ((explicit-shell-file-name "C:/...
1
vote
1answer
855 views

Emacs incompatible with oh-my-zsh?

I'm noticing something really odd in my ansi-term windows on my new Mac, see below: I am using: GNU Emacs 27.0.50 (build 1, x86_64-apple-darwin16.7.0, NS appkit-1504.83 Version 10.12.6 (Build ...
1
vote
1answer
197 views

How can I restart an ansi-term buffer?

I have an open buffer with major mode ansi-term, and with scrollback. This buffer has crashed. I'd like to "recycle" the buffer into a new ansi-term such that scrollback is kept. How can I do this?
1
vote
1answer
123 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
0answers
34 views

Truncation of text in Emacs terminal emulators

When I log in to the cluster using shell or eshell, I get the following message: 2018-04-11: The MEM1024 node is now back in the queue. The hardware had to be completely replaced, which means there ...
1
vote
0answers
34 views

spacemacs opens file in terminal split

I'm using neotree and as you know it opens a file in the most recent window split you accessed before switching to neotree (window 0). Sometimes this last accessed split is the ansi-term window I ...
1
vote
0answers
142 views

Can't run Windows 10 Bash with ansi-term

I've got this error, when running M-x ansi-term C:/Windows/System32/bash.exe RET Spawning child process: invalid argument after running M-x debug-on-entry RET start-process RET when running M-x ...