Skip to content

fix(macOS): paste Finder file paths - #89

Merged
kemokempo merged 4 commits into
otty-shell:mainfrom
kaluli123123:agent/macos-finder-file-paste
Aug 27, 2026
Merged

fix(macOS): paste Finder file paths#89
kemokempo merged 4 commits into
otty-shell:mainfrom
kaluli123123:agent/macos-finder-file-paste

Conversation

@kaluli123123

@kaluli123123 kaluli123123 commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Read macOS Finder file URLs from the native general pasteboard before the terminal paste event is created.
  • Decode file URLs to POSIX paths while preserving the existing text clipboard fallback.
  • Keep the native adapter and Objective-C dependencies macOS-only.
  • Migrate the implementation to the current crates/ui/terminal layout.

Root cause

The iced text clipboard path requests only an NSString representation. Finder publishes the selected file as public.file-url, so the existing paste handler cannot obtain the decoded POSIX path.

Verification on macOS

  • Focused input regression test: passed.
  • Clipboard adapter tests: 3 passed.
  • cargo +nightly fmt -- --check: passed.
  • cargo +1.96 lint: passed.
  • cargo clippy --workspace --all-targets --all-features -- -D warnings: passed.
  • cargo test --workspace --all-features: 530 passed, 2 ignored.
  • cargo deny check: exited 0 with the existing yanked core2 0.4.0 and spin 0.9.8 warnings.
  • cargo llvm-cov --workspace --all-features --fail-under-lines 80: exited 1 because workspace line coverage is 67.82%; changed clipboard.rs and input.rs line coverage is 98.18% and 81.83%.
  • Native Finder smoke test passed with spaces and a Japanese wide-character filename; OTTY pasted the decoded absolute path without a file:// prefix.

PR #87 is merged. This branch is rebased onto the resulting main and now contains only the Finder paste changes. Local Linux and Windows target builds were not run on this macOS host.

kaluli123123 pushed a commit to kaluli123123/otty that referenced this pull request Aug 23, 2026
@kaluli123123
kaluli123123 marked this pull request as ready for review August 23, 2026 10:07
@kaluli123123
kaluli123123 force-pushed the agent/macos-finder-file-paste branch 2 times, most recently from c42d096 to e7e8c4b Compare August 25, 2026 02:12
Comment thread app/src/events/mod.rs
@kaluli123123
kaluli123123 force-pushed the agent/macos-finder-file-paste branch from e7e8c4b to 8ba5bf8 Compare August 26, 2026 02:03
Comment thread crates/ui/terminal/src/clipboard.rs Outdated
@kemokempo
kemokempo merged commit 5c1ecb2 into otty-shell:main Aug 27, 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.

3 participants