Skip to content

Commit

Permalink
Merge pull request #919 from Junology/printclean
Browse files Browse the repository at this point in the history
Add new preference option 'console.head_padding'
  • Loading branch information
Stefterv authored Jan 17, 2025
2 parents d9274eb + a25a0fb commit cb1d425
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 4 additions & 2 deletions app/src/processing/app/ui/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -2293,8 +2293,10 @@ public void prepareRun() {
internalCloseRunner();
statusEmpty();

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

// clear the console on each run, unless the user doesn't want to
if (Preferences.getBoolean("console.auto_clear")) {
Expand Down
10 changes: 9 additions & 1 deletion build/shared/lib/defaults.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,16 @@ console.font.size = 12
# number of lines to show by default
console.lines = 4

# set to false to disable automatically clearing the console
# Number of blank lines to advance/clear console.
# Note that those lines are also printed in the terminal when
# Processing is executed there.
# Setting to 0 stops this behavior.
console.head_padding = 10

# Set to false to disable automatically clearing the console
# each time 'run' is hit
# If one sets it to false, one may also want to set 'console.head_padding'
# to a positive number to separate outputs from different runs.
console.auto_clear = true

# number of days of history to keep around before cleaning
Expand Down

0 comments on commit cb1d425

Please sign in to comment.