Skip to content

Commit

Permalink
fixed terminal: pasted text
Browse files Browse the repository at this point in the history
  • Loading branch information
ribizli committed Jan 5, 2021
1 parent d3ee206 commit a1e7652
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ export async function* terminal(prompt = "> ") {
) {
pos += key.left ? -1 : 1;
} else if (chunk[0] > 27 && chunk[0] !== 127) {
const char = decoder.decode(chunk);
command = command.substr(0, pos) + char + command.substr(pos);
pos++;
const input = decoder.decode(chunk);
command = command.substr(0, pos) + input + command.substr(pos);
pos += input.length;
} else {
continue;
}
Expand Down

0 comments on commit a1e7652

Please sign in to comment.