fix deansi for erasing text
This commit is contained in:
parent
580d78e947
commit
3bad25471a
|
@ -32,10 +32,17 @@
|
||||||
result.trim()
|
result.trim()
|
||||||
|
|
||||||
deansi: (log) ->
|
deansi: (log) ->
|
||||||
log = log.replace(/\r\r/g, '\r').replace(/\033\[K\r/g, '\r').replace(/^.*\r(?!$)/g, '').replace(/\[2K/g, '').replace(/\033\(B/g, '')
|
log = log.replace(/\r\r/g, '\r')
|
||||||
|
.replace(/\033\[K\r/g, '\r')
|
||||||
|
.replace(/^.*\r(?!$)/gm, '')
|
||||||
|
.replace(/\[2K/g, '')
|
||||||
|
.replace(/\033\(B/g, "")
|
||||||
|
|
||||||
ansi = ansiparse(log)
|
ansi = ansiparse(log)
|
||||||
|
|
||||||
text = ''
|
text = ''
|
||||||
ansi.forEach (part) ->
|
ansi.forEach (part) ->
|
||||||
|
console.log(part)
|
||||||
classes = []
|
classes = []
|
||||||
part.foreground and classes.push(part.foreground)
|
part.foreground and classes.push(part.foreground)
|
||||||
part.background and classes.push('bg-' + part.background)
|
part.background and classes.push('bg-' + part.background)
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user