Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sbt clear screen command

Tags:

I am learning sbt build tool. I use interpreted sbt. I run lot of commands and get lot of output which clutters up the screen.

The question is any command for clear screen for sbt interpretive console , like cls in DOS shell or clear in bash

My googling skill did not helped

update : i am using console2 with windows power shell

like image 955
ajduke Avatar asked May 24 '13 12:05

ajduke


People also ask

How do I clear the screen in Scala prompt?

Implementing it wouldn't be hard, either! I believe Ctrl + L should be able to clear the REPL console.

What is sbt command?

sbt shell has a command prompt (with tab completion and history!). For example, you could type compile at the sbt shell: > compile. To compile again, press up arrow and then enter. To run your program, type run . To leave sbt shell, type exit or use Ctrl+D (Unix) or Ctrl+Z (Windows).


3 Answers

In bash you should be able to use Ctrl+L, on OSX you can also use Cmd+K.

like image 56
drexin Avatar answered Apr 23 '23 15:04

drexin


This specifically helps when you're doing something in continuous mode, ala `compile:

maxErrors := 5
triggeredMessage := Watched.clearWhenTriggered

This works as of 0.13.7. The second line clears the screen before each command runs. The first line limits the number of errors. With this config, you only ever have one screen full of errors to work through. Obviously could adjust maxErrors depending on your sbt window.

like image 38
Matt Hughes Avatar answered Apr 23 '23 15:04

Matt Hughes


Sbt will load ~/.sbt/1.0/build.sbt as global settings.

commands += Command.command("cls") { state =>
  print("\033c")
  state
}

Then you can run any commands with cls. For example:

  • ~;cls;compile
  • ~;cls;testOnly
like image 29
Guillaume Massé Avatar answered Apr 23 '23 17:04

Guillaume Massé