Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I reach the bottom line,

Terminal

I want to be able to “scroll” down the virtual space so the prompt is at the top again (like in the beginning):

Terminal

Is there any way to do this?
This becomes even more painful in full-screen mode as it's hard to always type on the bottom line (and I don't want to clear the screen with +K because I need the scrollback).

share|improve this question
2  
Clear doesn't remove the history for me, and I have scroll bars at the side of the terminal which allow me to scroll it down/up –  blueberryfields Sep 17 '11 at 17:34
    
I wasn't clear enough. Clear (Command+K) removes the entries so I can't scroll up anymore. This doesn't suite me. Now, as for the scrollbars, I can't scroll down when I'm at the last command. If it helps, I want the prompt to be in the middle of the page, not at the bottom. –  Dan Sep 17 '11 at 17:41
    
@blueberryfields was referring to the literal clear command, not Terminal's View > Clear Scrollback (Command-K). Entering clear at the command prompt issues a control code that clears the current screen by scrolling it up into the "scrollback log" text. Dan Abramov was referring to Terminal's Clear Scrollback command, which discards the scrollback text in addition to clearing the screen. Dan, it could help clarify your question if you revised it to replace "I don't want to clear because" with "I don't want to use the Clear Scrollback command because". –  Chris Page Sep 17 '11 at 23:56
    
Dan, it could also help clarify if you replaced "because I need the history" with "because I need the scrollback". In the context of terminals, there are two very different things that people sometimes refer to as "history". One is the "command history" kept by the shell program, which you can typically view with the history command or by typing the Up/Down Arrow keys. The other is the "scrollback log" or "scrollback", which records everything that scrolls off the terminal screen and is managed by the terminal emulator program, which is why you use the menu bar or Command key to clear it. –  Chris Page Sep 18 '11 at 0:18
    
@Chris: Thanks for your input. I edited the question. Please feel free to edit it further if you think I missed something. Thanks. –  Dan Sep 18 '11 at 0:26

1 Answer 1

up vote 7 down vote accepted

Press Ctrl+l.
This will scroll the prompt to the first line without affecting the history.

share|improve this answer
    
Thanks a huge. –  Dan Sep 17 '11 at 17:51
2  
Typing in "clear" should also reset your prompt to the first line, without affecting history. –  blueberryfields Sep 17 '11 at 19:43
2  
To expand on this answer: Control-L is a keyboard command that the shell understands and it clears the screen exactly the way the clear command does, by issuing a terminal command code that clears the current screen by moving it into the "scrollback log". –  Chris Page Sep 18 '11 at 0:00
    
akira & @Chris Page - Very useful! +1 –  JRobert Sep 18 '11 at 0:37
    
Awesome! Thanks so much for that tip. –  daviesgeek Sep 21 '11 at 21:31

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.