I would like to know if is possible to add a command to clear the REPL console?
Do you mean :reset? Or like the bash command clear?
Exactly like bash clear command.
C-l
Apparently this must be at least 20 characters long to post.
On the Mac Terminal app and iTerm ⌘K will clear the screen and scrollback.
Yeah, I would think a spam filter would care more about a maximum number of
characters than a minimum…
The nice thing about Discourse is that we can customize it ![]()
So, perhaps we can get rid of this weird restriction. ![]()
17 extra characters spent would probably make this message “C-I” more clear.
I for one have to bow my head in shame, and admit I don’t understand what is meant with “C-I” in this post, and could have used the extra context required by the minimum character count.
That is a key combination: Ctrl+l
Another cool trick with sbt:
in ~/.sbt/0.13/build.sbt
commands += Command.command("cls") { state =>
print("\033c") // clear char in xterm
state
}
then I use it like this: ~;cls;test
:help could include terminal help, including .rc files and any jline info (if jline is used).
That l sure looks like an I. I wonder if the forum can specify the font. That was an eye, not an ell.
Cool! Someone should open a sbt ticket to keep track of this feature. Implementing it wouldn’t be hard, either!
I believe Ctrl + L should be able to clear the REPL console.
works for me (Scala 2.13.2, MacOS 15.5.5 Terminal)
2021 update:
~/.sbt/1.0/build.sbt
commands += Command.command("cls") { state =>
print("\u001bc") // clear char in xterm
state
}