Skip to content

Commit

Permalink
Fixed some Firefox issues
Browse files Browse the repository at this point in the history
  • Loading branch information
andersevenrud committed Aug 10, 2018
1 parent 2aab17f commit 54e759c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/terminal.js
Expand Up @@ -140,7 +140,7 @@ const keyboard = (parse) => {
const str = input.join('').trim();
parse(str);
input = [];
} else {
} else if (key(ev) !== 'backspace') {
input.push(String.fromCharCode(ev.which || ev.keyCode));
}
},
Expand Down Expand Up @@ -173,7 +173,6 @@ export const terminal = (opts) => {

const output = (output, center) => {
let lines = output.split(/\n/);
console.warn(lines)
if (center) {
lines = lines.map(line => line.length > 0
? line.padStart(line.length + ((cwidth / 2) - (line.length / 2)), ' ')
Expand All @@ -190,7 +189,7 @@ export const terminal = (opts) => {
const onparsed = (cmd, ...args) => execute(cmd, ...args)(output);
const render = renderer(tickrate, onrender);
const parse = parser(onparsed);
const focus = () => $element.focus();
const focus = () => setTimeout(() => $element.focus(), 1);
const kbd = keyboard(parse);
const clear = () => ($element.value = '');
const input = ev => busy
Expand Down

0 comments on commit 54e759c

Please sign in to comment.