pty-manager 1.2.11 → 1.2.13

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.d.mts CHANGED
@@ -442,6 +442,11 @@ declare class PTYSession extends EventEmitter {
442
442
  writeRaw(data: string): void;
443
443
  /**
444
444
  * Send a task/message to the session
445
+ *
446
+ * Text and Enter are sent as separate writes with a small delay.
447
+ * This is required for TUI-based CLIs (Gemini CLI, ink/React-based tools)
448
+ * which drop the trailing \r if it arrives in the same write buffer
449
+ * during a render cycle.
445
450
  */
446
451
  send(message: string): SessionMessage;
447
452
  /**
package/dist/index.d.ts CHANGED
@@ -442,6 +442,11 @@ declare class PTYSession extends EventEmitter {
442
442
  writeRaw(data: string): void;
443
443
  /**
444
444
  * Send a task/message to the session
445
+ *
446
+ * Text and Enter are sent as separate writes with a small delay.
447
+ * This is required for TUI-based CLIs (Gemini CLI, ink/React-based tools)
448
+ * which drop the trailing \r if it arrives in the same write buffer
449
+ * during a render cycle.
445
450
  */
446
451
  send(message: string): SessionMessage;
447
452
  /**
package/dist/index.js CHANGED
@@ -656,6 +656,11 @@ var PTYSession = class extends import_events.EventEmitter {
656
656
  }
657
657
  /**
658
658
  * Send a task/message to the session
659
+ *
660
+ * Text and Enter are sent as separate writes with a small delay.
661
+ * This is required for TUI-based CLIs (Gemini CLI, ink/React-based tools)
662
+ * which drop the trailing \r if it arrives in the same write buffer
663
+ * during a render cycle.
659
664
  */
660
665
  send(message) {
661
666
  this._status = "busy";
@@ -667,7 +672,10 @@ var PTYSession = class extends import_events.EventEmitter {
667
672
  content: message,
668
673
  timestamp: /* @__PURE__ */ new Date()
669
674
  };
670
- this.write(message);
675
+ const formatted = this.adapter.formatInput(message);
676
+ this.writeRaw(formatted);
677
+ setTimeout(() => this.sendKeys("enter"), 50);
678
+ this.logger.debug({ sessionId: this.id, input: message }, "Sent input to session");
671
679
  return msg;
672
680
  }
673
681
  /**
@@ -1144,7 +1152,9 @@ var BaseCLIAdapter = class {
1144
1152
  * Subclasses should override for CLI-specific detection.
1145
1153
  */
1146
1154
  detectBlockingPrompt(output) {
1147
- const stripped = this.stripAnsi(output);
1155
+ let stripped = this.stripAnsi(output);
1156
+ stripped = stripped.replace(/[│╭╰╮╯─═╌║╔╗╚╝╠╣╦╩╬┌┐└┘├┤┬┴┼●○❯❮▶◀⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏⏺←→↑↓]/g, " ");
1157
+ stripped = stripped.replace(/ {2,}/g, " ");
1148
1158
  const loginDetection = this.detectLogin(output);
1149
1159
  if (loginDetection.required) {
1150
1160
  return {