Clear REPL console

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.

4 Likes

On the Mac Terminal app and iTerm ⌘K will clear the screen and scrollback.

1 Like

Yeah, I would think a spam filter would care more about a maximum number of
characters than a minimum…

1 Like

The nice thing about Discourse is that we can customize it :slight_smile:
So, perhaps we can get rid of this weird restriction. :rolling_eyes:

1 Like

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.

2 Likes

That is a key combination: Ctrl+l

1 Like

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

1 Like

: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
}
5 Likes