Fix terminal rendering and add improvements

- Enable bracketed paste mode for handling large pastes
- Fix editor duplicate line rendering bug at terminal width
- Add padding support to Markdown component (paddingX/Y)
- Add Spacer component for vertical spacing
- Update chat-simple with spacers between messages
This commit is contained in:
Mario Zechner 2025-11-11 00:13:46 +01:00
parent 97c730c874
commit 5f19dd62c7
5 changed files with 148 additions and 61 deletions

View file

@ -48,12 +48,18 @@ export class ProcessTerminal implements Terminal {
process.stdin.setEncoding("utf8");
process.stdin.resume();
// Enable bracketed paste mode - terminal will wrap pastes in \x1b[200~ ... \x1b[201~
process.stdout.write("\x1b[?2004h");
// Set up event handlers
process.stdin.on("data", this.inputHandler);
process.stdout.on("resize", this.resizeHandler);
}
stop(): void {
// Disable bracketed paste mode
process.stdout.write("\x1b[?2004l");
// Remove event handlers
if (this.inputHandler) {
process.stdin.removeListener("data", this.inputHandler);