Compare commits

..

No commits in common. "main" and "v0.5.3" have entirely different histories.
main ... v0.5.3

View File

@ -48,8 +48,6 @@ func (f Flags) Validate() error {
return nil
}
var reColourCodes = regexp.MustCompile(`\^[0-9]`)
func main() {
var exitCode int
@ -254,6 +252,13 @@ func runCommand(ctx *context, cmd string) error {
if ctx.sm.Running() {
ctx.sm.Stop()
}
fmt.Print(reColourCodes.ReplaceAllString(resp, ""))
fmt.Print(removeColourCodes(resp))
return nil
}
var colourCodeRegex = regexp.MustCompile(`\^[0-9]`)
// removeColourCodes removes '\^[0-9]' colour codes from the input string.
func removeColourCodes(s string) string {
return colourCodeRegex.ReplaceAllString(s, "")
}