termites 1.0.39 → 1.0.41

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server.js +10 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "termites",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "description": "Local multi-terminal manager with web interface",
5
5
  "main": "server.js",
6
6
  "scripts": {
package/server.js CHANGED
@@ -302,14 +302,15 @@ class TermitesServer {
302
302
  case 'select':
303
303
  const terminal = this.terminals.get(data.clientId);
304
304
  if (terminal) {
305
- // Send buffered output to browser
306
- terminal.outputBuffer.forEach(output => {
305
+ // Send buffered output to browser as a single batch
306
+ const historyData = terminal.outputBuffer.join('');
307
+ if (historyData) {
307
308
  browserWs.send(JSON.stringify({
308
309
  type: 'output',
309
310
  clientId: data.clientId,
310
- data: output
311
+ data: historyData
311
312
  }));
312
- });
313
+ }
313
314
  }
314
315
  break;
315
316
 
@@ -1750,6 +1751,11 @@ class TermitesServer {
1750
1751
  term.clear();
1751
1752
  clearHistory(); // Clear history when switching clients
1752
1753
  ws.send(JSON.stringify({ type: 'select', clientId }));
1754
+ // Send resize to adjust PTY to current screen size
1755
+ ws.send(JSON.stringify({
1756
+ type: 'resize', clientId: clientId,
1757
+ cols: term.cols, rows: term.rows
1758
+ }));
1753
1759
  updateClientList();
1754
1760
  document.getElementById('drawer').classList.remove('open');
1755
1761
  document.getElementById('overlay').classList.remove('open');