@pixelbyte-software/pixcode 1.53.26 → 1.53.28

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.
package/dist/index.html CHANGED
@@ -35,7 +35,7 @@
35
35
 
36
36
  <!-- Prevent zoom on iOS -->
37
37
  <meta name="format-detection" content="telephone=no" />
38
- <script type="module" crossorigin src="/assets/index-blc6pTTl.js"></script>
38
+ <script type="module" crossorigin src="/assets/index-BBDYzJ7B.js"></script>
39
39
  <link rel="modulepreload" crossorigin href="/assets/vendor-react-DB6V5Fl1.js">
40
40
  <link rel="modulepreload" crossorigin href="/assets/vendor-codemirror-CIYNS698.js">
41
41
  <link rel="modulepreload" crossorigin href="/assets/vendor-xterm-C7tpxJl7.js">
@@ -1309,6 +1309,26 @@ function writeTerminalInputChunks(ptyProcess, data) {
1309
1309
  }
1310
1310
  return true;
1311
1311
  }
1312
+ function resizeTerminalPty(ptyProcess, cols, rows, context = 'resize') {
1313
+ if (!ptyProcess || typeof ptyProcess.resize !== 'function')
1314
+ return false;
1315
+ const nextCols = Number.parseInt(cols, 10);
1316
+ const nextRows = Number.parseInt(rows, 10);
1317
+ if (!Number.isFinite(nextCols) || !Number.isFinite(nextRows) || nextCols < 2 || nextRows < 1) {
1318
+ return false;
1319
+ }
1320
+ try {
1321
+ ptyProcess.resize(nextCols, nextRows);
1322
+ return true;
1323
+ }
1324
+ catch (error) {
1325
+ const message = error instanceof Error ? error.message : String(error);
1326
+ if (!/already exited/i.test(message)) {
1327
+ console.warn(`Terminal ${context} failed:`, message);
1328
+ }
1329
+ return false;
1330
+ }
1331
+ }
1312
1332
  function readPtyTarget(value) {
1313
1333
  return typeof value === 'string' && value.trim() ? value.trim() : null;
1314
1334
  }
@@ -3748,6 +3768,7 @@ function handleShellConnection(ws, request) {
3748
3768
  else {
3749
3769
  console.log('♻️ Reconnecting to existing PTY session:', ptySessionKey);
3750
3770
  shellProcess = existingSession.pty;
3771
+ resizeTerminalPty(shellProcess, data.cols, data.rows, 'reconnect resize');
3751
3772
  clearTimeout(existingSession.timeoutId);
3752
3773
  ws.send(JSON.stringify({
3753
3774
  type: 'output',
@@ -4084,15 +4105,7 @@ function handleShellConnection(ws, request) {
4084
4105
  const session = ptySessionKey ? ptySessionsMap.get(ptySessionKey) : null;
4085
4106
  const activePty = session?.pty || shellProcess;
4086
4107
  if (activePty && typeof activePty.resize === 'function' && session?.lifecycleState !== 'completed' && session?.lifecycleState !== 'failed') {
4087
- try {
4088
- activePty.resize(data.cols, data.rows);
4089
- }
4090
- catch (error) {
4091
- const message = error instanceof Error ? error.message : String(error);
4092
- if (!/already exited/i.test(message)) {
4093
- console.warn('Terminal resize failed:', message);
4094
- }
4095
- }
4108
+ resizeTerminalPty(activePty, data.cols, data.rows);
4096
4109
  }
4097
4110
  }
4098
4111
  }