summaryrefslogtreecommitdiffstats
path: root/src/ansi.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2020-03-03 20:55:29 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2020-03-03 21:19:23 +0900
commitdd49e41c424ad0cbef6ca0a0f52d918053f329ea (patch)
tree6b6f27e5fee02ebe012910580d1d0988721ea16f /src/ansi.go
parent6db15e86937029b4a4565b2ae73a3c6bae5ef4ba (diff)
Ignore xterm OSC control sequences
- OSC Ps ; Pt BEL - OSC Ps ; Pt ST Fix #1415
Diffstat (limited to 'src/ansi.go')
-rw-r--r--src/ansi.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ansi.go b/src/ansi.go
index b5b3a203..b15bd91c 100644
--- a/src/ansi.go
+++ b/src/ansi.go
@@ -90,10 +90,11 @@ func init() {
- http://ascii-table.com/ansi-escape-sequences.php
- http://ascii-table.com/ansi-escape-sequences-vt-100.php
- http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x405.html
+ - https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
*/
// The following regular expression will include not all but most of the
// frequently used ANSI sequences
- ansiRegex = regexp.MustCompile("(?:\x1b[\\[()][0-9;]*[a-zA-Z@]|\x1b.|[\x0e\x0f]|.\x08)")
+ ansiRegex = regexp.MustCompile("(?:\x1b[\\[()][0-9;]*[a-zA-Z@]|\x1b][0-9];[[:print:]]+(?:\x1b\\\\|\x07)|\x1b.|[\x0e\x0f]|.\x08)")
}
func findAnsiStart(str string) int {