Reversed Terminal / Command line window

command lineterminal

It occurred to me recently that it would occasionally be much better to type terminal/command line commands at the top of a window, with the last run commands below. The reverse of the usual display.

On smaller laptop screens for example, it's much more comfortable to focus at the top of the screen, than at the bottom.

Regardless of wether this is a good idea or not, does such a terminal / command line plugin exist for achieving this?

(I'm mostly OS X based, but interested in all platform solutions)

Best Answer

Here's something to play with in Bash.

To set it up:

$ bash    # try this in a subshell since ^C seems to cause it to exit
$ f () { sed "1s/^/$(tput cup 0 0)/;s/^/$(tput il1)/"; }
$ PROMPT_COMMAND='tput cup 0 0;tput il1; echo'
$ exec > >(f)

Press enter one extra time and it's ready to try. Sometimes the output and the prompt are out of order and there may be other weirdness, but it's kind of an interesting thing to try.

Screen oriented programs won't work because they don't see a tty.

Related Question