mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-25 16:55:59 +03:00
[PR #5920] fix(desktop): add native Edit menu to enable clipboard shortcuts on Linux #5417
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#5417
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hoppscotch/hoppscotch/pull/5920
Author: @umutkeltek
Created: 2/28/2026
Status: 🔄 Open
Base:
main← Head:fix/script-editor-paste📝 Commits (2)
8ddabfcfix(desktop): add native Edit menu to enable clipboard shortcuts on Linuxc952e8bfix: gate Edit menu to Linux only, update comment to be platform-neutral📊 Changes
1 file changed (+24 additions, -0 deletions)
View changed files
📝
packages/hoppscotch-desktop/src-tauri/src/lib.rs(+24 -0)📄 Description
Description
Fixes #5871
Paste (Ctrl+V) from the system clipboard does not work in the script editor (and other editors) on the Linux desktop app. The issue is that webkit2gtk, which Tauri v2 uses as the WebView backend on Linux, requires native Edit menu items with
PredefinedMenuItemaccelerators for clipboard keyboard shortcuts to function properly in the WebView.Root Cause
On Linux, webkit2gtk does not automatically connect standard clipboard keyboard shortcuts (Ctrl+V, Ctrl+C, Ctrl+X) to the system clipboard in the WebView. Without native menu items that register these accelerators, paste from external applications fails while internal clipboard (copy/paste within the app) continues to work — exactly matching the behavior reported in #5871.
Fix
Added a native Edit menu with
PredefinedMenuItemitems (Undo, Redo, Cut, Copy, Paste, Select All) to the Tauri app setup. These predefined menu items register the standard keyboard accelerators with the underlying platform, enabling proper clipboard integration on Linux.This is the standard approach recommended by the Tauri ecosystem for clipboard support on Linux (tauri-apps/tauri#2397).
Changes
packages/hoppscotch-desktop/src-tauri/src/lib.rs: Added native Edit menu withPredefinedMenuItemitems in the app setupTesting
bundle.zip/manifest.jsonbuild artifact errors remain)Summary by cubic
Add a native Edit menu on Linux to register clipboard shortcuts in the WebView. This enables paste, copy, cut, and select-all in the script editor and other editors.
PredefinedMenuIteminpackages/hoppscotch-desktop/src-tauri/src/lib.rssowebkit2gtkconnects the WebView to the system clipboard.cfg!(target_os = "linux"); macOS/Windows menus are unchanged, and there are no JavaScript changes.Written for commit c952e8b44542e9ba8ebbb285352e8f8c6b4762af. Summary will update on new commits.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.