feat: streams, 'clear' command

This commit is contained in:
2026-03-26 21:05:35 +01:00
parent 686abeafb4
commit 21a1a34309
7 changed files with 173 additions and 11 deletions

View File

@@ -43,6 +43,7 @@ export class Terminal {
paragraph.className = 'line'
this.terminal.appendChild(paragraph)
this.UpdateLines()
paragraph.scrollIntoView({behavior: 'smooth'})
}
@@ -70,10 +71,8 @@ export class Terminal {
const selector = `#line-${this.cursorPosition.row} .cell-${this.cursorPosition.col}`
// adjust for the cursor
console.log(`going from ${this.terminal.children.length - 1} to ${this.cursorPosition.row}`)
if (!document.querySelector(`#line-${this.cursorPosition.row}`)) {
for (let i = this.terminal.children.length - 1; i < this.cursorPosition.row; i++) {
console.log(i)
this.AppendLine()
}
}