Repository navigation
Conversation
…slash commands pi's clipboard paste inserts an absolute temp path on Linux and macOS, and the compose-preview slash-command guard skipped every editor text starting with "/". That made the preview unreachable for the real paste flow on POSIX systems. Only treat the text as a slash command when it contains no image path token. Adds T71 (absolute path still previews) and T72 (a real slash command stays skipped). Fixes getpipher#28.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The compose-time preview never appears for an image path that starts with
/, which is exactly what pi inserts when you paste a screenshot on Linux/macOS (Ctrl+V→/tmp/pi-clipboard-<uuid>.png).updateComposePreview()skips any editor text starting with/to leave slash commands to their own UI. Every POSIX absolute path also starts with/, so the real paste case never reaches the preview. The submit-time attachment is unaffected because theinputhook has no such guard, which is why images still reach the model and only the preview is missing.Failure is silent: the terminal-input listener calls
updateComposePreview(ctx).catch(() => {}).Fix
Only treat the text as a slash command when it contains no image path token:
Tests
AssertionError: absolute path must render the compose preview) and GREEN after the change./vision) without an image path is still skipped, so the guard keeps its original purpose.tsx --test, alltests/*.test.ts+test/delegator.test.mts).tsc --noEmit: clean.Reproduced in pi 1.3.0 on Linux/Wayland with Ghostty (Kitty graphics). The same patch applied to the installed 0.5.3 makes the absolute path render
pi-clipboard-….png | 679x616 | image/png | 163.9KB | kittyabove the editor.Fixes #28