Skip to content

New line character "\n" is escaped to "^J" in the sbt console's prompt in 0.13.10 #2480

@hohonuuli

Description

@hohonuuli

steps

Add the following to build.sbt:

// set the prompt (for this build) to include the project id.
shellPrompt in ThisBuild := { state =>
  val user = System.getProperty("user.name")
   "\n" + user + "@" + Project.extract(state).currentRef.project + "\nsbt> "
}

In project\build.properties set sbt.version=0.13.10 (or 0.13.11)

In a terminal, run sbt

problem

In sbt 0.13.10 and 0.13.11, the new line character \n in the prompt is being transformed to emacs caret notation ^J. The resulting prompt looks like:

^Jbrian@my-cool-project^Jsbt>

expectation

In all prior versions of sbt the prompt appears like so:


brian@my-cool-project
sbt>

notes

If this is a feature some guidance on how to create a prompt with line feeds in it would be much appreciated. My development platform is Mac OS X 10.11.3, java version "1.8.0_72".

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions