Living in Emacs: Copy & Paste with `ansi-term`
I got hooked on emacs way back and every time I try another text editor, I am always asking - why can’t this editor be more like emacs (or at least MY configuration emacs?!)
One area I thought that would just be a complete deal breaker in emacs
for me: getting text information out of the terminal modes, like
ansi-term
- which is an awesome terminal inside emacs and one thing
I always have running no matter what I am doing inside emacs.
I always hated to reach for the mouse to highlight and copy a command
from ansi-term
.
When I did a quick search to see if I can just have emacs copy the text out for me, I found the following commands:
M-x term-line-mode
or:C-c C-j
(make terminal editable)M-x term-map-mode
or:C-c C-k
(make terminal un-editable)
Oh wow - this makes working with terminal items in emacs a dream - simple copy/paste (kill/yank) just like a buffer.
Now there’s one less reason to leave emacs…