webterm: send simple keystrokes simply

%txt should be reserved for chunks of pasted text and other
non-keystroke text inputs. Perhaps at a later point in time we'll handle
paste events explicitly, letting this be more accurate.
This commit is contained in:
fang 2022-05-15 01:13:54 +02:00
parent 2d3e803704
commit dc81adb735
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972

View File

@ -50,7 +50,7 @@ const readInput = (term: Terminal, e: string): Belt[] => {
//
if (c >= 32 && c !== 127) {
strap += e[0];
e = e.slice(1);
e = e.slice(1); //TODO revisit wrt (list @c) & unicode characters
continue;
} else if ('' !== strap) {
belts.push({ txt: strap.split('') });
@ -115,7 +115,11 @@ const readInput = (term: Terminal, e: string): Belt[] => {
e = e.slice(1);
}
if ('' !== strap) {
belts.push({ txt: strap.split('') });
if (1 === strap.length) {
belts.push(strap);
} else {
belts.push({ txt: strap.split('') });
}
strap = '';
}
return belts;