mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 04:02:21 +00:00
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:
parent
97c730c874
commit
5f19dd62c7
5 changed files with 148 additions and 61 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue