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 +3 -1
- package/package.json +1 -1
- package/src/tui-ink.js +17 -3
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
|
|
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
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
|
-
|
|
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
|
-
|
|
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' :
|
|
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 {
|