Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

How can I "page down" in the terminal?

share|improve this question
add comment

3 Answers

up vote 5 down vote accepted

In addition to VxJasonxV’s answer (which is correct), if you want to modify your terminal behavior so using up or down does a pageup/pagedown in vim (and others), you can go to:

Terminal -> Preferences -> Click on the Settings Toolbar, then the Keyboard Tab.

Add a new keys like this: (showing one example below)

  • Page Up: \033[5~
  • Page Down: \033[6~
  • Home: \033[4~
  • End: \033[1~

Here’s an example with the “Cursor up”:

alt text

Now you can press Up/Down and it will do the pageup/down. I suggest you add a modifier (like Control). Sadly, you can’t use the “Fn” key as a modifier.

Note: By default, Control + Cursor Left is delete until the end of the line and control+cursor right is insert (in vim at least), so you can use another modifier if you don’t want to change those.

share|improve this answer
    
Where can I find the correct control sequences? Such as the \033[5~ in your screen shot? –  topskip Dec 4 '10 at 13:18
    
@Patrick Here’s a list of some of them: web.mit.edu/gnu/doc/html/screen_10.html (googled it) ;) –  Martín Marconcini Dec 4 '10 at 17:39
    
Thanks! I didn't know what to search for. Now that I know the page, it is clear to me. –  topskip Dec 4 '10 at 18:39
add comment

There are two answers to this question.

The first is globally useable. I'll assume you're on a narrow/laptop keyboard. In those instances, Fn+Down ▼ acts as Page Down, and just to expand that thought out entirely:

  • Fn+Up ▲ = Page Up

  • Fn+Left ◀ = Home

  • Fn+Right ▶ = End

This will not work properly in some applications. Those that come to mind are things like vim, less, screen, and other "full screen/ncurses menued" programs. The above keystrokes scroll the terminal window, but if the terminal window has not been paged, then scrolling won't accomplish anything.

The second half of the answer is one that I can't answer without more detail.

Example:

  • In less, the spacebar or ctrl ^+f will page down one screen full.

  • In vim, ctrl ^+f will page down one screen full.

  • In screen, you will probably never have to Page Down, but if you scrolled back in copy mode, ctrl ^+f works there too.

If I haven't answered your question, you will need to elaborate on it, heavily.

share|improve this answer
add comment

In order to send a page up/down keystroke to the application, as opposed to scrolling Terminal's window, hold down the shift key while pressing your page up/down keys (or fn-arrows as appropriate for your keyboard).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.