waveterm icon indicating copy to clipboard operation
waveterm copied to clipboard

[Bug]: Right-click URL opens wrong URL from clipboard instead of clicked URL

Open atu4403 opened this issue 3 months ago • 1 comments

Current Behavior

When right-clicking on a URL in the terminal:

  1. The clicked URL gets copied to clipboard (same as other text)
  2. Context menu shows "Open Clipboard URL {URL}"
  3. The URL shown in the menu is from the previous clipboard content, not the clicked URL
  4. Clicking the option opens the wrong URL

This creates confusion because users expect to open the URL they clicked on.

Expected Behavior

When right-clicking on a URL in the terminal, should show option to open that specific URL.

Expected: Menu shows "Open https://github.com" when right-clicking on https://github.com

Steps To Reproduce

  1. Copy non-URL text to clipboard (e.g., "example")
  2. Display URL1 in terminal: echo "https://example.com"
  3. Right-click URL1 → No "Open Clipboard URL" option appears (user confused)
  4. Display URL2 in terminal: echo "https://github.com"
  5. Right-click URL2 → Shows "Open Clipboard URL https://example.com" (wrong URL)

Wave Version

v0.11.6 (202509221832)

Platform

macOS

OS Version/Distribution

macOS Sequoia

Architecture

arm64

Anything else?

This affects workflows where users expect to quickly open URLs from terminal output (logs, API responses, etc.).

Questionnaire

  • [ ] I'm interested in fixing this myself but don't know where to start
  • [ ] I would like to fix and I have a solution
  • [ ] I don't have time to fix this right now, but maybe later

atu4403 avatar Sep 23 '25 04:09 atu4403

Ah, maybe we're caching the URL somehow when the menu is created? That's weird... will try to reproduce it and fix. Thanks for posting.

sawka avatar Oct 16 '25 06:10 sawka

just reviewing bugs and came across this again. was able to repro it. the "problem" is that we do copy-on-select in the terminal w/ a debounce. so the second time you right click an URL you get the "Open Clipboard URL", but it is always the last one you selected.

sawka avatar Nov 25 '25 18:11 sawka

Thanks for the detailed explanation! I understand the timing issue now. Looking forward to the fix whenever you have time. Great work on Wave Terminal! 👍

atu4403 avatar Nov 26 '25 01:11 atu4403