@dmsdc-ai/aigentry-telepty 0.1.32 → 0.1.33

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/daemon.js +15 -5
  2. package/package.json +1 -1
package/daemon.js CHANGED
@@ -454,11 +454,21 @@ function sendViaKitty(sessionId, text) {
454
454
  }
455
455
 
456
456
  try {
457
- const escaped = text.replace(/\\/g, '\\\\').replace(/'/g, "'\\''");
458
- execSync(`kitty @ --to unix:${socket} send-text --match id:${windowId} '${escaped}'`, {
459
- timeout: 3000, stdio: ['pipe', 'pipe', 'pipe']
460
- });
461
- console.log(`[KITTY] Sent ${text.length} chars to ${sessionId} (window ${windowId})`);
457
+ // Split text and CR — send-text for content, send-key for Enter
458
+ const hasCr = text.endsWith('\r') || text.endsWith('\n');
459
+ const textOnly = hasCr ? text.slice(0, -1) : text;
460
+ if (textOnly.length > 0) {
461
+ const escaped = textOnly.replace(/\\/g, '\\\\').replace(/'/g, "'\\''");
462
+ execSync(`kitty @ --to unix:${socket} send-text --match id:${windowId} '${escaped}'`, {
463
+ timeout: 3000, stdio: ['pipe', 'pipe', 'pipe']
464
+ });
465
+ }
466
+ if (hasCr) {
467
+ execSync(`kitty @ --to unix:${socket} send-key --match id:${windowId} Return`, {
468
+ timeout: 3000, stdio: ['pipe', 'pipe', 'pipe']
469
+ });
470
+ }
471
+ console.log(`[KITTY] Sent ${textOnly.length} chars${hasCr ? ' + Return' : ''} to ${sessionId} (window ${windowId})`);
462
472
  return true;
463
473
  } catch (err) {
464
474
  console.error(`[KITTY] Failed for ${sessionId}:`, err.message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dmsdc-ai/aigentry-telepty",
3
- "version": "0.1.32",
3
+ "version": "0.1.33",
4
4
  "main": "daemon.js",
5
5
  "bin": {
6
6
  "aigentry-telepty": "install.js",