Adds title change escapes to cui

This commit is contained in:
sloumdrone 2019-12-15 11:00:39 -08:00
parent 8fa7c7a635
commit aeee577e24
1 changed files with 3 additions and 0 deletions

View File

@ -49,14 +49,17 @@ func Exit(exitCode int, msg string) {
if msg != "" {
fmt.Print(msg, "\n")
}
fmt.Print("\033[23;0t")
os.Exit(exitCode)
}
// InitTerm sets the terminal modes appropriate for Bombadillo
func InitTerm() {
SetCharMode()
fmt.Print("\033[22;0t")
Tput("rmam") // turn off line wrapping
Tput("smcup") // use alternate screen
fmt.Print("\033]0;Bombadillo\007")
}
// CleanupTerm reverts changs to terminal mode made by InitTerm