Skip to content

Instantly share code, notes, and snippets.

@patmandenver
Last active March 25, 2016 21:05
Show Gist options
  • Select an option

  • Save patmandenver/6bcf570644266b750226 to your computer and use it in GitHub Desktop.

Select an option

Save patmandenver/6bcf570644266b750226 to your computer and use it in GitHub Desktop.
sbt global shell prompt
shellPrompt := { state =>
def textColor(color: Int) = { s"\033[38;5;${color}m" }
def backgroundColor(color:Int) = { s"\033[48;5;${color}m" }
def reset = { s"\033[0m" }
def formatText(str: String)(txtColor: Int, backColor: Int) = {
s"${textColor(txtColor)}${backgroundColor(backColor)}${str}${reset}"
}
val red = 1
val green = 2
val yellow = 11
val white = 15
val black = 16
val orange = 166
formatText(s"[${name.value}]")(white, orange) +
"\n " +
formatText("\u276f\u276f\u276f ")(orange, black)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment