fix(bash): escape console title sequences

resolves #2702
This commit is contained in:
Jan De Dobbeleer 2022-08-27 21:45:18 +02:00 committed by Jan De Dobbeleer
parent 4572a6a8b9
commit eabe6b3a7a

View file

@ -266,6 +266,10 @@ func (a *Ansi) ClearAfter() string {
}
func (a *Ansi) Title(title string) string {
// we have to do this to prevent bash from misidentifying escape sequences
if a.shell == shell.BASH {
title = strings.ReplaceAll(title, `\`, `\\`)
}
return fmt.Sprintf(a.title, title)
}