Skip to content

Commit cb1d425

Browse files
authored
Merge pull request #919 from Junology/printclean
Add new preference option 'console.head_padding'
2 parents d9274eb + a25a0fb commit cb1d425

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

app/src/processing/app/ui/Editor.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -2293,8 +2293,10 @@ public void prepareRun() {
22932293
internalCloseRunner();
22942294
statusEmpty();
22952295

2296-
// do this to advance/clear the terminal window / dos prompt / etc
2297-
for (int i = 0; i < 10; i++) System.out.println();
2296+
// Do this to advance/clear the terminal window / dos prompt / etc.
2297+
// This may be useful especially when 'console.auto_clear' is false.
2298+
int headPadding = Preferences.getInteger("console.head_padding");
2299+
for (int i = 0; i < headPadding; i++) console.message("\n", false);
22982300

22992301
// clear the console on each run, unless the user doesn't want to
23002302
if (Preferences.getBoolean("console.auto_clear")) {

build/shared/lib/defaults.txt

+9-1
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,16 @@ console.font.size = 12
165165
# number of lines to show by default
166166
console.lines = 4
167167

168-
# set to false to disable automatically clearing the console
168+
# Number of blank lines to advance/clear console.
169+
# Note that those lines are also printed in the terminal when
170+
# Processing is executed there.
171+
# Setting to 0 stops this behavior.
172+
console.head_padding = 10
173+
174+
# Set to false to disable automatically clearing the console
169175
# each time 'run' is hit
176+
# If one sets it to false, one may also want to set 'console.head_padding'
177+
# to a positive number to separate outputs from different runs.
170178
console.auto_clear = true
171179

172180
# number of days of history to keep around before cleaning

0 commit comments

Comments
 (0)