Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to scroll up in Emacs ansi-term

Tags:

emacs

I've been Googling around and looking at Emacs built-in help but I have yet to determine how to scroll up (or down) in Emacs ansi-term.

I'm using Emacs 23.3.1, OS X, in iTerm2. Thanks!

Edit: I've noticed most the advice people give me doesn't work in ansi-term but does work in eshell. I have since moved to eshell.

like image 727
Mauvis Ledford Avatar asked May 12 '11 16:05

Mauvis Ledford


2 Answers

In general, if you don't need full screen terminal emulation, shell or eshell are better choices.

However, if you decide to stick with ansi-term, press C-c C-j to go into line mode. Then you can move around normally with the usual cursor movement keys. Press C-c C-k to get back into char mode to interact with the terminal.

Alternatively, you can scroll backwards a screen at a time with C-c C-v and just enter text to scroll back to the terminal input point.

Take a look at the Emacs documentation on term-mode (most of which applies equally to ansi-term) for more information.

like image 72
ataylor Avatar answered Oct 01 '22 20:10

ataylor


Shift-page up/down (in Emacs-speak, S-prior/S-next) will work using the default bindings.

(While the normal C-h m/C-h b don't work to see mode information and bindings in this mode, you can still use C-c M-x describe-mode/describe-bindings, or depending on your setup, use F1 or the help key instead of C-h.)

like image 45
Nicholas Riley Avatar answered Oct 01 '22 19:10

Nicholas Riley