mirror of
https://github.com/paradoxxxzero/butterfly.git
synced 2026-05-26 07:08:08 +00:00
Working on better compatibility (now compliant with all the vttest test #1)
This commit is contained in:
8
butterfly/bin/bhtml
Executable file
8
butterfly/bin/bhtml
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env python
|
||||
from butterfly.escapes import html
|
||||
import fileinput
|
||||
import sys
|
||||
|
||||
with html():
|
||||
for line in fileinput.input():
|
||||
sys.stdout.write(line)
|
||||
@@ -1053,6 +1053,19 @@
|
||||
if (ch === "$" || ch === "\"" || ch === " " || ch === "'") {
|
||||
break;
|
||||
}
|
||||
if (ch <= " " || ch >= "~") {
|
||||
if (ch === '\b') {
|
||||
this.currentParam = (this.currentParam / 10) & 1;
|
||||
}
|
||||
if (ch === '\r') {
|
||||
this.x = 0;
|
||||
}
|
||||
if (["\n", "\x0b", "\x0c"].indexOf(ch) >= 0) {
|
||||
this.screen[this.y + this.shift].dirty = true;
|
||||
this.nextLine();
|
||||
}
|
||||
break;
|
||||
}
|
||||
this.params.push(this.currentParam);
|
||||
this.currentParam = 0;
|
||||
if (ch === ";") {
|
||||
@@ -1174,7 +1187,7 @@
|
||||
}
|
||||
break;
|
||||
default:
|
||||
console.error("Unknown CSI code: %s.", ch);
|
||||
console.error("Unknown CSI code: %s (%d).", ch, ch.charCodeAt(0));
|
||||
}
|
||||
this.prefix = "";
|
||||
break;
|
||||
|
||||
5
butterfly/static/main.min.js
vendored
5
butterfly/static/main.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -877,6 +877,18 @@ class Terminal
|
||||
# '$', '"', ' ', '\''
|
||||
if ch is "$" or ch is "\"" or ch is " " or ch is "'"
|
||||
break
|
||||
|
||||
# Ignore garbage characters
|
||||
if ch <= " " or ch >= "~"
|
||||
if ch is '\b'
|
||||
@currentParam = (@currentParam / 10) & 1
|
||||
if ch is '\r'
|
||||
@x = 0
|
||||
if ["\n", "\x0b", "\x0c"].indexOf(ch) >= 0
|
||||
@screen[@y + @shift].dirty = true
|
||||
@nextLine()
|
||||
break
|
||||
|
||||
@params.push @currentParam
|
||||
@currentParam = 0
|
||||
|
||||
@@ -1064,7 +1076,7 @@ class Terminal
|
||||
@softReset @params
|
||||
|
||||
else
|
||||
console.error "Unknown CSI code: %s.", ch
|
||||
console.error "Unknown CSI code: %s (%d).", ch, ch.charCodeAt(0)
|
||||
@prefix = ""
|
||||
|
||||
when State.dcs
|
||||
|
||||
Reference in New Issue
Block a user