15
votes
Accepted
How can I quit Emacs from within a term within Emacs?
There are a few answers here.
Quitting Emacs without C-x C-c
First, you can quit emacs by running the command that C-x C-c is bound to: M-x save-buffers-kill-terminal.
Alternatives to recursive ...
12
votes
Accepted
How to remap backward-delete and help command while using Emacs from a terminal emulator?
From the Emacs manual, node DEL Does Not Delete:
On a text terminal, if you find that <BACKSPACE> prompts for a Help
command, like Control-h, instead of deleting a character, it means
...
9
votes
Accepted
Why does emacs (getenv "TERM") return incorrect data?
Quoting startup.el:
;; Subprocesses of Emacs do not have direct access to the terminal, so
;; unless told otherwise they should only assume a dumb terminal.
;; We are careful to do it late (after ...
8
votes
Is it possible to use Bash for Windows as the term in Emacs for Windows
In my .emacs I first define a function like so
(defun my-bash-on-windows-shell ()
(let ((explicit-shell-file-name "C:/Windows/System32/bash.exe"))
(shell)))
and I call at the bottom using:
(...
7
votes
Accepted
In term-mode how can I make line-mode the default
Looking at term.el it seems char mode is enabled right after running term-mode (and hence term-mode-hook) as such enabling term-line-mode in term-mode-hook would not work. The only option I can think ...
6
votes
Accepted
mutt (and others) in ansi-term - terrible refresh rate
The bi-directional text support introduced in Emacs 24 interacts badly with term.el when large numbers of spaces or tabs are inserted, and many applications clear the screen (often drawing a new ...
6
votes
TERM, terminfo, termcap. What are they how does Emacs use it?
TERM is an environment variable, you set it in your environment. This could be the environment of a particular shell that you've opened, by running export TERM=foo, or all of your shells by adding the ...
6
votes
Exit emacs client that runs inside emacs terminal buffer
If you're in term buffer in char mode, you have to escape C-c. So, if you're running a terminal Emacs instance inside the term buffer, running save-buffers-kill-terminal requires an extra C-c: C-x C-c ...
6
votes
Accepted
Conditional True color (24 bit color) support for iTerm2 and Terminal.app in OSX with Fish shell
I believe that the @ symbols in your terminfo example are part of the Texinfo markup, rather than part of the terminfo code. Your terminfo entry should look like:
# Use colon separators.
xterm-24bit|...
5
votes
Accepted
How to get a fully functional Julia REPL in emacs?
There is a way! The problem with using term is that term doesn't understand some of the escape sequences Julia sends, which causes term to put a bunch of extra prompts on the screen that make it ...
5
votes
Accepted
Term buffer font-size
I did this:
(defun shell-hook ()
(text-scale-decrease 1.1))
(add-hook 'term-mode-hook 'shell-hook)
and it worked beautifully
5
votes
Accepted
Colors illegible after upgrading OS
In general, a terminal application like emacs -nw has only very limited information about what colors are available. The shell will have an environment variable called TERM which contains the name of ...
5
votes
Accepted
TERM, terminfo, termcap. What are they how does Emacs use it?
Termcap and terminfo are both methods for an application running in a terminal to obtain information about the terminal — what it can do and how (e.g. its size, how to move the cursor around, etc.). ...
5
votes
Unable to change cursor type in terminal
On a terminal, you can't change the shape of cursor.
From the Emacs manual:
On a text terminal, the cursor’s appearance is controlled by the
terminal, largely out of the control of Emacs. Some ...
5
votes
Accepted
Nano not displaying correctly in term and ansi-term
It's an off by one error in term-handle-ansi-escape, I've posted a patch in Bug#31690.
--- c/lisp/term.el
+++ w/lisp/term.el
@@ -3386,11 +3386,10 @@ term-handle-ansi-escape
;; \E[B - cursor down (...
5
votes
Accepted
how to map <C-M-left>, <C-M-right> etc to the correct hex codes in iterm2
You can add:
For C-M-left: Send escape sequence: [1;7D
For C-M-right: Send escape sequence: [1;7C
For C-M-up: Send escape sequence: [1;7A
For C-M-down: Send escape sequence: [1;7B
And this will work ...
5
votes
Accepted
How to make M-x ansi-term behave like M-x shell (opening in new window)?
This is a simplified version of a function in my .emacs file:
(defun ml/bash ()
"Start a terminal emulator in a new window."
(interactive)
(split-window-sensibly)
(other-window 1)
(ansi-...
5
votes
Accepted
Howto display unicode character \u2026 in terminal mode in emacs
I found that I missed this in my .emacs.d configuration:
;; UTF-8 support
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-...
4
votes
Accepted
What linux terminal app is compatible with emacs keybindings?
No terminal emulator will default to supporting all of the key sequences you're asking about, because they are emulating terminals which did not support those sequences.
Furthermore, the only ...
4
votes
Emacs colors being set differently when TERM is 'screen-256color' and 'xterm-256color'
The problem is that I have no idea how the colors are set to begin with, and more importantly, why they are set differently.
Perhaps this discussion on StackOverflow is relevant - some detailed ...
4
votes
Accepted
How to launch terminal.app from elisp
(defun my-applescript-fn ()
"Open the Terminal.app, wait a second, and CD to the Emacs default-directory
of current buffer."
(interactive)
(do-applescript
(format
"tell application \"Terminal\"
...
4
votes
How do you set colors for term?
Since in zenburn theme terminal colors look good I added the following lines in my .emacs:
(custom-set-faces
'(term-color-black ((t (:foreground "#3F3F3F" :background "#2B2B2B"))))
'(term-color-...
4
votes
Accepted
Can I completely replace xterm with emacs' term mode?
I use ansi-term almost exclusively, so I would say "almost".
Speed is your main concern -- anything which rapidly generates large amounts of output is going to cause some pain, as Emacs won't keep up ...
4
votes
Accepted
Spacemacs - start popup terminal window in evil-normal-state
Perhaps (evil-set-initial-state 'term-mode 'normal) will do what you want.
4
votes
Accepted
C-x in terminal
It is possible to re assign C-x as an escape character:
(add-hook 'term-mode-hook
(lambda ()
;; C-x is the prefix command, rather than C-c
(term-set-escape-char ?\C-x)
(define-key ...
4
votes
How can I compile and run my C code from within Emacs like I would with the terminal?
I use the compile command, and also add a run target to my makefile like this
program: program.cpp
gcc program.cpp -o program
run: program
program
So you can just use make run to compile ...
4
votes
How to make M-x ansi-term behave like M-x shell (opening in new window)?
I am wondering if one could adjust the above so that the ansi-term behaves like M-x shell in the sense of opening in a new window (in the current frame -- at the bottom, just like M-x shell does).
...
4
votes
Accepted
Why does `eshell` not create an active process In Emacs while `shell` and `term` do?
As mentioned in the manual page on Processes, the term process refers to an OS process. Emacs runs in a process, but can invoke other external processes and manage them as subprocesses. When you run M-...
3
votes
Accepted
Long pause during Emacs startup, prior to init file running
A bit of added information for your init file processing time:
Put this at the very start of your init file:
(defvar my-init-load-start (current-time))
and this at the very end:
;; Display the ...
3
votes
Check if terminal supports Unicode
It's probably not just about whether Unicode is available but also whether a given font supports a particular Unicode character.
I'm not sure that it helps for non-graphic (i.e., console/terminal) ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
term × 183ansi-term × 32
shell × 28
key-bindings × 19
terminal-emacs × 18
eshell × 16
spacemacs × 9
osx × 9
colors × 9
multi-term × 9
python × 5
hooks × 5
evil × 4
microsoft-windows × 4
bash × 4
shell-mode × 4
linum-mode × 4
init-file × 3
buffers × 3
start-up × 3
ssh × 3
character-encoding × 3
cursor × 3
comint × 3
ubuntu × 3