Skip to content

feat(cookbook): add image-path-gallery recipe - #893

Merged
umputun merged 1 commit into
umputun:masterfrom
wildsurfer:image-path-gallery
Nov 5, 2026
Merged

umputun merged 1 commit into
umputun:masterfrom
wildsurfer:image-path-gallery

Conversation

@wildsurfer

Copy link
Copy Markdown
Contributor

The recipe from discussion #887. One chord shows the image paths on a pane's screen in an overlay gallery with thumbnails. In an attached session it copies the files from the host first with scp.

It stays useful after #891: --image shows one file that a program on the origin names, and this recipe is for several paths that are already on the screen.

I have used it for a short time only, about a day, on sessions attached from another Mac. I did not run it again under the new file name, it is the same script. I did not test it on 0.36.0, this minimum comes from the changelog.

shellcheck is clean. Text on the screen decides which files are copied, the first sentence in Limits says this.

One chord shows the image paths on a pane's screen in an overlay gallery. In an attached session it copies the files from the host first.

Claude-Session: https://claude.ai/code/session_01GqkEnpmSQ9B16JabFfNGjx
@wildsurfer
wildsurfer requested a review from umputun as a code owner November 5, 2026 08:57

@umputun umputun left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, merging. One non-blocking note for a follow-up.

cookbook/image-path-gallery/image-path-gallery.sh:8 - tr -d '[:space:]' joins the whole screen into one string, so an earlier word with a slash swallows the image path whenever only letters, digits, ._-+@ and whitespace stand between them, across lines too. A reply like Updated src/views/settings.go and saved the screenshot to /tmp/shot.png gives one bogus path, and the chord says the file does not exist. Fix: join only line breaks and their indent, keep the spaces inside a line:

image_paths() {
  perl -0777 -ne 's/[ \t\r]*\n[ \t]*//g; print "$1\n" while m{(/[A-Za-z0-9._/\@+-]+?\.(?:png|jpe?g|gif|webp))}gi' | awk '!seen[$0]++'
}

the wrapped and indented paths from #887 still parse with it. The comment above the function and README lines 38 and 52 would need the same change. The case still lost is a line ending in a word with a slash right above the path line, src/a.txt on one line and /tmp/x.png on the next.

@umputun
umputun merged commit 660fa2e into umputun:master Nov 5, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants