mirror of
https://github.com/louislam/dockge.git
synced 2024-10-30 01:10:39 +00:00
Fix removeInput
This commit is contained in:
parent
48ccc27b9f
commit
d51cc39711
1 changed files with 4 additions and 2 deletions
|
@ -154,10 +154,12 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
removeInput() {
|
removeInput() {
|
||||||
const backspaceCount = 2 * this.terminalInputBuffer.length - this.cursorPosition;
|
const textAfterCursorLength = this.terminalInputBuffer.length - this.cursorPosition;
|
||||||
|
const spaces = " ".repeat(textAfterCursorLength);
|
||||||
|
const backspaceCount = this.terminalInputBuffer.length;
|
||||||
const backspaces = "\b \b".repeat(backspaceCount);
|
const backspaces = "\b \b".repeat(backspaceCount);
|
||||||
this.cursorPosition = 0;
|
this.cursorPosition = 0;
|
||||||
this.terminal.write(backspaces);
|
this.terminal.write(spaces + backspaces);
|
||||||
this.terminalInputBuffer = "";
|
this.terminalInputBuffer = "";
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue