fix deansi for erasing text

This commit is contained in:
Sven Fuchs 2012-09-28 15:12:55 +02:00
parent 580d78e947
commit 3bad25471a
2 changed files with 9 additions and 2 deletions

View File

@ -32,10 +32,17 @@
result.trim()
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)
text = ''
ansi.forEach (part) ->
console.log(part)
classes = []
part.foreground and classes.push(part.foreground)
part.background and classes.push('bg-' + part.background)

File diff suppressed because one or more lines are too long