fix(parse): strip OSC escape sequences in StripAnsi for backwards compat
This commit is contained in:
+5
-1
@@ -11,7 +11,11 @@ import (
|
||||
"git.sr.ht/~rjarry/aerc/lib/log"
|
||||
)
|
||||
|
||||
var AnsiReg = regexp.MustCompile("\x1B\\[[0-?]*[ -/]*[@-~]")
|
||||
var AnsiReg = regexp.MustCompile(
|
||||
`\x1B\[[0-?]*[ -/]*[@-~]` + // CSI sequences: ESC [ ... final_byte
|
||||
`|` +
|
||||
`\x1B\][^\x07\x1B]*(?:\x07|\x1B\\)`, // OSC sequences: ESC ] ... (BEL | ESC \)
|
||||
)
|
||||
|
||||
// StripAnsi strips ansi escape codes from the reader
|
||||
func StripAnsi(r io.Reader) io.Reader {
|
||||
|
||||
Reference in New Issue
Block a user