# Separate output screen; clearing (cleaning) output screen

1. Is there a way to split the screen so that the code is visible on top, and the output generated from its execution appears at the bottom?
2. Is there any way to clear the screen from previous runs, so that the result of execution is presented in a clean screen, something like the cls command in BASIC?
• I don't think the functionality exists in the standard notebook interface, although it could probably be created in a custom notebook with the help of dynamic interactivity. I could imagine this might be useful for some things, but notebooks are not organized like that by default.
– Jens
Apr 7 '15 at 2:41
• In the book "An Introduction to Programming with Mathematica" by Wellin, Gaylord & Kamin all of chapter 10 is on programming the "front end" of Mathematica. Using functions like NotebookCreate and NotebookWrite you might be able to do some or much of what you want.
– Bill
Apr 7 '15 at 3:15

Cls := (SelectionMove[InputNotebook[], All, Notebook];
$Post = (If[Head@$outputNB == Symbol, $outputNB = CreateNotebook[]]; If[# === Null, 1;, Paste[$outputNB, #]]) &;

Cls is the screen-cleaning command, it deletes all the cells in current notebook. Then the \$Post variable is modified to redirect all the outputs.
• Nice solution. I would use cls[] for the clear command as that is safer and more conventional. May 6 '15 at 6:30