@pixelbyte-software/pixcode 1.50.6 → 1.50.7

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-DVEXTVKy.js"></script>
38
+ <script type="module" crossorigin src="/assets/index-CR4j4iu_.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">
@@ -359,6 +359,26 @@ function appendPtySessionBuffer(session, data) {
359
359
  session.buffer.push(data);
360
360
  }
361
361
  }
362
+ function normalizeTerminalStartupInput(input) {
363
+ return `${String(input || '').replace(/(?:\r\n|\r|\n)+$/u, '')}\r`;
364
+ }
365
+ function writeTerminalStartupInput(session, startupInput, reason, delayMs = 500) {
366
+ if (!session?.pty || !startupInput)
367
+ return;
368
+ const submittedInput = normalizeTerminalStartupInput(startupInput);
369
+ setTimeout(() => {
370
+ try {
371
+ if (session.pty && session.lifecycleState === 'running') {
372
+ session.pty.write(submittedInput);
373
+ session.updatedAt = Date.now();
374
+ console.log(`⌨️ Submitted startup input to visible PTY (${reason})`);
375
+ }
376
+ }
377
+ catch (error) {
378
+ console.warn('Failed to submit startup input to visible PTY:', error?.message || error);
379
+ }
380
+ }, delayMs);
381
+ }
362
382
  function normalizeShellPermissionMode(value) {
363
383
  return typeof value === 'string' ? value.trim() : '';
364
384
  }
@@ -2183,6 +2203,9 @@ function handleShellConnection(ws, request) {
2183
2203
  const startupInput = typeof data.startupInput === 'string' && data.startupInput.trim()
2184
2204
  ? data.startupInput.trim()
2185
2205
  : null;
2206
+ const startupInputDelivery = data.startupInputDelivery === 'terminal' ? 'terminal' : 'command';
2207
+ const commandStartupInput = startupInputDelivery === 'command' ? startupInput : null;
2208
+ const terminalStartupInput = startupInputDelivery === 'terminal' ? startupInput : null;
2186
2209
  const hermesLaunchId = Number.isFinite(Number(data.hermesLaunchId)) && Number(data.hermesLaunchId) > 0
2187
2210
  ? Number(data.hermesLaunchId)
2188
2211
  : null;
@@ -2263,6 +2286,9 @@ function handleShellConnection(ws, request) {
2263
2286
  });
2264
2287
  }
2265
2288
  existingSession.ws = ws;
2289
+ if (terminalStartupInput && !isPlainShell) {
2290
+ writeTerminalStartupInput(existingSession, terminalStartupInput, 'reused provider session', 350);
2291
+ }
2266
2292
  return;
2267
2293
  }
2268
2294
  }
@@ -2340,8 +2366,8 @@ function handleShellConnection(ws, request) {
2340
2366
  shellCommand = `${command} resume "${sessionId}" || ${command}`;
2341
2367
  }
2342
2368
  }
2343
- else if (startupInput) {
2344
- shellCommand = `${command} ${quoteShellArgForPlatform(startupInput)}`;
2369
+ else if (commandStartupInput) {
2370
+ shellCommand = `${command} ${quoteShellArgForPlatform(commandStartupInput)}`;
2345
2371
  }
2346
2372
  else {
2347
2373
  shellCommand = command;
@@ -2477,6 +2503,10 @@ function handleShellConnection(ws, request) {
2477
2503
  keepAliveUntilExit: false,
2478
2504
  updatedAt: Date.now(),
2479
2505
  });
2506
+ const createdSession = ptySessionsMap.get(ptySessionKey);
2507
+ if (terminalStartupInput && !isPlainShell) {
2508
+ writeTerminalStartupInput(createdSession, terminalStartupInput, 'new provider session', 4500);
2509
+ }
2480
2510
  // Handle data output
2481
2511
  shellProcess.onData((data) => {
2482
2512
  const session = ptySessionsMap.get(ptySessionKey);