ccmanager 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -73,10 +73,20 @@ const Session = ({ session, sessionManager, onReturnToMenu, }) => {
|
|
|
73
73
|
const handleResize = () => {
|
|
74
74
|
const cols = process.stdout.columns || 80;
|
|
75
75
|
const rows = process.stdout.rows || 24;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
session.terminal
|
|
76
|
+
try {
|
|
77
|
+
session.process.resize(cols, rows);
|
|
78
|
+
// Also resize the virtual terminal
|
|
79
|
+
if (session.terminal) {
|
|
80
|
+
try {
|
|
81
|
+
session.terminal.resize(cols, rows);
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
// Suppress xterm.js parsing errors
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
// Suppress PTY resize errors
|
|
80
90
|
}
|
|
81
91
|
};
|
|
82
92
|
stdout.on('resize', handleResize);
|
|
@@ -109,8 +109,13 @@ export class SessionManager extends EventEmitter {
|
|
|
109
109
|
setupDataHandler(session) {
|
|
110
110
|
// This handler always runs for all data
|
|
111
111
|
session.process.onData((data) => {
|
|
112
|
-
// Write data to virtual terminal
|
|
113
|
-
|
|
112
|
+
// Write data to virtual terminal with error suppression
|
|
113
|
+
try {
|
|
114
|
+
session.terminal.write(data);
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
// Suppress xterm.js parsing errors
|
|
118
|
+
}
|
|
114
119
|
// Store in output history as Buffer
|
|
115
120
|
const buffer = Buffer.from(data, 'utf8');
|
|
116
121
|
session.outputHistory.push(buffer);
|