Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am having difficulty working with Windows command console. It is especially difficult to do demos sometimes. Whatever I did last ends up appearing at the bottom. It would be great if it showed up at the top. In other words, whatever I did last should be shown the first.

Is there a way to configure the console to do that?

If not, is there a console/terminal application that can do this?

share|improve this question

migrated from Jun 3 '11 at 12:19

This question came from our site for professional and enthusiast programmers.

Is there any reason you can't create a GUI to do this? – Peter Lawrey Jun 3 '11 at 11:50
I don't see the difficulty... What makes having it go in the other direction less difficult? – Tom Wijsman Jun 3 '11 at 16:42
up vote 2 down vote accepted

Some terminal programs, such as PuTTY, will let you set the outer window border in pixels:

Settings -> Window -> Appearance -> Gap between text and window edge

The spacing will be equal on all four sides of the terminal (not just at the bottom as you probably prefer) but it may be similar to what you are looking for.

If you're familiar with Cygwin then you can use a Cygwin shell (instead of Windows' Command Prompt) by using the puttycyg patch.

Here's a screendump showing puttycyg running a bash shell with a 60 pixel border.

enter image description here

share|improve this answer

In short, no. The entire model of console based computing is tied to time, the direction we naturally read text, and input/output streams. This directional limitation might make more sense if we switch to world of fiction:

In the Voyage of the Dawn Treader by C.S Lewis, the dufflepuds washed the dishes before the meal to save time afterwords. They also tried planting baked potatoes. The experiment was a failure, but in Back to the Future, Doc Brown succeeds in modifying the input for programs that have already generated their output. In Groundhog Day the protagonist got to live the same day over and over and modify small bits at a time to test their affect.

For the rest of us, the river of time constantly flows down hill.

Edit: Start your demos by clearing the screen with clear or Ctrl+L. In supported terminals and shells this will blank the screen and start your command at the top left. After each major step or when you get too far down, you can clear and start over at the top. This will not mess the head of people that are familiar with console based programs and still help console newbies to understand the general flow of things.

Your keybindings may vary but having something bound to the clear command will even allow you to clear a screen from inside a program such as being at the sqlite prompt.

share|improve this answer
Also the fact that the early "consoles" were paper typewriters (more or less) – and those usually write from top to bottom. (See ASR-33, for example.) – grawity Jun 3 '11 at 15:40
As I replied to the others, I guess my problem is mostly related to the fact that whatever you are typing is not "centralized" on the screen. Think of it this way: as you type the console scrolls down automatically so that you do not end up typing at the very last line always. I guess this is what I am looking for. I agree that it may sound not intuitive, however, people also expect to see what is more important at the top of the screen not at the bottom during a demo. Assuming more recent command you type is more important, the current way is also not intuitive in this sense. – CEGRD Jun 6 '11 at 7:11
If you are demoing a command line program to anybody even vaguely familiar with the command line, they will expect and understand the normal behavior. If you are trying to demo a command line program to somebody who has never used one ... what the deuce are you doing demoing to them anyway? – Caleb Jun 6 '11 at 11:02

You're very unlikely to find a terminal program which will do this. If you did, your audience would probably be distracted by it and your presentation would be less effective than you think it is now.

share|improve this answer
The problem is whatever you type last eventually starts appearing at the last line of your console. Even if you have big window, you will eventually consume all the lines and you will have to work at the very last line. I'm aware of the commands like cls and clear to clear the screen. These, however, won't work when you are inside another console inside your command line (e.g., mysql console).I am looking for some way to show what I am typing may be more "central" on the screen. In other words, I am hoping to find a way, may be, to scroll down automatically as you press enter. – CEGRD Jun 6 '11 at 7:11
@CEGRD: I have added another answer based on your comment but I'm not sure that you'll find it useful because of the extra software required. If you want the active line to be more central on the screen then you're essentially not using the bottom part of the screen, so why not just use a smaller Command Prompt window positioned positioned further up the screen? For that to be effective, you'd want to use a plain desktop wallpaper of similar colour to your Command Prompt background. – Mike Fitzpatrick Jun 6 '11 at 9:05

Do you mean you want to clear the console before running your application?

If so, execute the "cls" command in the console. This will clear the screen and put the cursor back to the top.

You could also use a command line library to allow you to print at required locations on the screen. For example:

share|improve this answer
@Dave I am aware of commands like cls and clear. However, you cannot use them when you are demoing, for example, in sqlite3 console, or when you are inside irb (interactive ruby console). In other words anything that is running "inside" command console process such as sqlite3 console, or irb console won't allow you to do this. – CEGRD Jun 6 '11 at 7:10
@CEGRD: Not so my friend. See my edited answer but you can totally clear the screen from inside the sqlite3 console or anything else for that matter! – Caleb Jun 6 '11 at 11:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .