From 46e8b2a46bb687ef35c7cda6dd1da749013d6dbe Mon Sep 17 00:00:00 2001 From: andyhtran Date: Sat, 2 May 2026 20:00:36 -0400 Subject: [PATCH] Append trailing space after typed paste paths So the user can keep typing the next argument without hitting space themselves. Co-Authored-By: Claude Opus 4.7 (1M context) --- Sources/CopyCat/Broadcast.swift | 5 +++-- Sources/CopyCat/ImagePaste.swift | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Sources/CopyCat/Broadcast.swift b/Sources/CopyCat/Broadcast.swift index b710faa..3e22c89 100644 --- a/Sources/CopyCat/Broadcast.swift +++ b/Sources/CopyCat/Broadcast.swift @@ -63,8 +63,9 @@ enum Broadcast { ) } - // Remote home dir is unknown, so always tilde-prefix. - let typed = "~/\(remoteCacheRel)/\(outName)" + // Remote home dir is unknown, so always tilde-prefix. Trailing space + // matches the local-paste path so the user can keep typing. + let typed = "~/\(remoteCacheRel)/\(outName) " DispatchQueue.main.async { Typer.type(typed) } diff --git a/Sources/CopyCat/ImagePaste.swift b/Sources/CopyCat/ImagePaste.swift index 54c2fc9..90a7a36 100644 --- a/Sources/CopyCat/ImagePaste.swift +++ b/Sources/CopyCat/ImagePaste.swift @@ -25,7 +25,11 @@ enum ImagePaste { // IDE, …) — unlike `~/`, which only expands inside a shell. The // user-visible cosmetic cost is /Users/you/… instead of ~/…, which // is fine: this terminal already knows who you are. - let typed = outPath.path + // Trailing space so the user can keep typing the next argument without + // hitting space themselves. The typed path has no spaces, so the only + // way this corrupts a command is pasting inside quotes — uncommon for + // this workflow. + let typed = outPath.path + " " DispatchQueue.main.async { Typer.type(typed) }