jaitus 0.3.5 → 0.3.6

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/README.md CHANGED
@@ -119,7 +119,9 @@ scrolls to the line you pick.
119
119
 
120
120
  **Pasting.** Right-click or `Ctrl+V` pastes the clipboard; a long paste becomes a
121
121
  `[#1 pasted 120 lines]` chip (the full text is sent). **Images:** drag an image file
122
- onto the terminal, paste a copied screenshot with `Alt+V`, type `/image path.png`, or
122
+ onto the terminal, paste a copied screenshot (`Alt+V` on Windows — Windows Terminal and
123
+ VS Code keep `Ctrl+V` for themselves; `Ctrl+V` on macOS and Linux, where `Cmd+V` /
124
+ `Ctrl+Shift+V` belong to the terminal), type `/image path.png`, or
123
125
  mention `@screenshot.png` — each becomes an `[Image #N]` chip listed under the
124
126
  composer. Backspace over a chip removes it; only images whose chip is still in the
125
127
  message are sent. Screenshots over 3.5 MB are shrunk automatically.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jaitus",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "Jaitus — a coding agent in your terminal.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/tui-ink.js CHANGED
@@ -373,6 +373,15 @@ function layoutTranscript(state, width, height, top) {
373
373
  return { visible, pad, screenTop };
374
374
  }
375
375
 
376
+ /**
377
+ * The key that pastes an image here. Windows Terminal and VS Code keep Ctrl+V for their
378
+ * own text paste, so on Windows it is Alt+V; on macOS Cmd+V is the terminal's and Ctrl+V
379
+ * reaches the app (Option+V types "√" unless Option is set to act as Meta).
380
+ */
381
+ export function imagePasteHint(platform = process.platform) {
382
+ return platform === 'win32' ? 'alt+v paste image' : 'ctrl+v paste image';
383
+ }
384
+
376
385
  /**
377
386
  * How to select text, in words that are true for THIS terminal.
378
387
  *
@@ -704,7 +713,10 @@ function StatusBar({ state, width }) {
704
713
  : [
705
714
  ['ctrl+p palette', p.faint],
706
715
  ['shift+tab mode', p.faint],
707
- ['ctrl+l clear', p.faint],
716
+ // How to paste a screenshot was written only in the README, and the key people
717
+ // try first (Ctrl+V in Windows Terminal, Cmd+V on a Mac) belongs to the terminal,
718
+ // which has no text to paste and sends the app nothing.
719
+ [imagePasteHint(), p.faint],
708
720
  ['esc esc rewind', p.faint],
709
721
  // Mouse reporting takes the terminal's own text selection away, so the way to
710
722
  // get it back has to be on screen — otherwise the first thing a new user
@@ -1280,7 +1292,9 @@ export function createTui({ slashCommands = [], fileProvider = null, meta = {},
1280
1292
  */
1281
1293
  function handlePaste(text) {
1282
1294
  const value = String(text ?? '').replace(/\r\n?/g, '\n');
1283
- if (!value) return;
1295
+ // An empty paste is what a terminal sends for its paste key when the clipboard holds
1296
+ // only an image — it has no text to give. The image is right there: fetch it.
1297
+ if (!value) { void pasteFromClipboard({ imageOnly: true }); return; }
1284
1298
  // Dragging image files onto the terminal pastes their paths: attach them instead.
1285
1299
  const images = imagePathsIn(value);
1286
1300
  if (images) { void attachImageFiles(images); return; }
@@ -1323,7 +1337,7 @@ export function createTui({ slashCommands = [], fileProvider = null, meta = {},
1323
1337
  await attachImageFiles([file], { name: 'clipboard image' });
1324
1338
  return;
1325
1339
  }
1326
- flash(imageOnly ? 'No image on the clipboard' : 'The clipboard is empty', 'info', 1600);
1340
+ flash(imageOnly ? 'No image on the clipboard — copy a screenshot first' : `The clipboard is empty · ${imagePasteHint()}`, 'info', 1800);
1327
1341
  } catch {
1328
1342
  flash('Could not read the clipboard', 'warn', 2000);
1329
1343
  } finally {