fix: remap framework copy for editors - #1534
Conversation
|
You do not have enough credits to review this pull request. Please purchase more credits to continue. |
Mesa DescriptionTL;DRFixes copy/paste in Cursor and VS Code by remapping Framework+C/V to Ctrl+Shift+C/V, matching terminal behavior and avoiding Ctrl+C conflicts. Centralizes Slack Framework→Ctrl mapping in a shared What changed?
Description generated by Mesa. Update settings |
There was a problem hiding this comment.
Code Review
This pull request generalizes the Ghostty remap configuration into terminalClipboardRemap and applies it to code editors like VS Code and Cursor. The review identifies that remapping the bare Ctrl+C key breaks the SIGINT signal in terminals and suggests removing it. Furthermore, applying terminal-style clipboard shortcuts to GUI editors is flagged as potentially incorrect and redundant given the existing global remaps. It is also recommended to include Wayland-specific application IDs for better compatibility.
| terminalClipboardRemap = globalRemap // { | ||
| "C-c" = "C-Shift-c"; | ||
| "${hyperPrefix}c" = "C-Shift-c"; | ||
| "${hyperPrefix}v" = "C-Shift-v"; | ||
| }; |
There was a problem hiding this comment.
The terminalClipboardRemap definition includes a remap for the bare C-c key (line 88). This causes the physical Ctrl+C key to send Ctrl+Shift+C.
In terminal applications, this effectively breaks the ability to send the SIGINT (interrupt) signal, which is usually bound to Ctrl+C. If your goal is to have Cmd+C (Framework+C) perform a copy while keeping Ctrl+C as the interrupt signal, you should remove the C-c entry. This is particularly relevant given the comment on line 119 which acknowledges the Ctrl+C = SIGINT convention.
terminalClipboardRemap = globalRemap // {
"${hyperPrefix}c" = "C-Shift-c";
"${hyperPrefix}v" = "C-Shift-v";
};
| { | ||
| # Cursor/VS Code: terminal-style clipboard shortcut, not bare Ctrl+C. | ||
| name = "Framework Command (Code Editors)"; | ||
| application.only = codeEditorAppIds; | ||
| remap = terminalClipboardRemap; | ||
| } |
There was a problem hiding this comment.
Applying terminalClipboardRemap to GUI editors like VS Code and Cursor is likely incorrect. These applications use Ctrl+C/V for clipboard operations by default on Linux, whereas Ctrl+Shift+C/V often trigger different actions (e.g., opening a new terminal in VS Code).
Since globalRemap (applied on line 141) already maps Hyper+C/V to Ctrl+C/V, editors will automatically receive macOS-style copy/paste behavior without this specific block. Using the terminal-specific remap here will likely break standard editor shortcuts and the physical Ctrl+C behavior.
| codeEditorAppIds = [ | ||
| "cursor" | ||
| "Cursor" | ||
| "code" | ||
| "Code" | ||
| ]; |
There was a problem hiding this comment.
On Wayland, Electron-based applications like VS Code and Cursor often use specific app_id strings such as code-url-handler or cursor-url-handler rather than just code or cursor. Adding these variants ensures the remaps are applied correctly when running natively on Wayland. You can verify the exact identifiers using hyprctl clients while the apps are running.
codeEditorAppIds = [
"cursor"
"Cursor"
"cursor-url-handler"
"code"
"Code"
"code-url-handler"
];
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 35 minutes and 25 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughGeneralizes a Ghostty-specific clipboard remap into a shared Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
1 issue found across 1 file
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="home-manager/modules/xremap/default.nix">
<violation number="1" location="home-manager/modules/xremap/default.nix:122">
P1: Applying `terminalClipboardRemap` to VS Code/Cursor will break clipboard operations. On Linux, VS Code binds `Ctrl+Shift+C` to "Open new external terminal", not copy. Since `terminalClipboardRemap` remaps both bare `C-c` and `Hyper+c` to `C-Shift-c`, neither physical Ctrl+C nor Framework+C will copy text — they'll open external terminals instead. Use `globalRemap` here (which already maps `Hyper+C/V` → `Ctrl+C/V`), or create an editor-specific remap that doesn't override bare `C-c`.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@home-manager/modules/xremap/default.nix`:
- Around line 92-97: The codeEditorAppIds list includes VS Code/Cursor
("cursor","Cursor","code","Code") which causes terminalClipboardRemap to apply
to the whole VS Code window and breaks editor copy behavior; remove those
entries from codeEditorAppIds (and corresponding occurrences where
terminalClipboardRemap is applied, e.g., the block referenced by
terminalClipboardRemap usage) so the remap no longer targets VS Code/Cursor
windows, or alternatively stop applying terminalClipboardRemap app-wide and
instead rely on VS Code keybindings with terminal focus conditions to handle
terminal copy/paste.
- Around line 87-91: Remove the bare "C-c" => "C-Shift-c" entry from
terminalClipboardRemap so physical Ctrl+C still sends SIGINT; keep only the
"${hyperPrefix}c" and "${hyperPrefix}v" mappings that remap Framework+C/V. Also
stop applying terminalClipboardRemap to editor app filters (Cursor/VSCode) —
remove it from whichever app-level mapping or apps list currently references
terminalClipboardRemap so editors keep their native Ctrl+C/Ctrl+V while
terminals receive the remap for hyperPrefix; ensure globalRemap still contains
the two hyperPrefix entries.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d46ca7ac-f93c-41d3-aeee-1df7b1303d31
📒 Files selected for processing (1)
home-manager/modules/xremap/default.nix
| codeEditorAppIds = [ | ||
| "cursor" | ||
| "Cursor" | ||
| "code" | ||
| "Code" | ||
| ]; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
find . -name "default.nix" -path "*/xremap/*" | head -20Repository: shunkakinoki/dotfiles
Length of output: 106
🏁 Script executed:
git ls-files | grep -i xremap | head -20Repository: shunkakinoki/dotfiles
Length of output: 104
🏁 Script executed:
find . -name "*.nix" -path "*xremap*" | head -20Repository: shunkakinoki/dotfiles
Length of output: 106
🏁 Script executed:
cat -n home-manager/modules/xremap/default.nix | head -140Repository: shunkakinoki/dotfiles
Length of output: 4914
🌐 Web query:
VS Code default keybindings Ctrl+Shift+C terminal
💡 Result:
In Visual Studio Code, the default keybinding Ctrl+Shift+C (⇧⌘C on macOS) when the integrated terminal is focused is "Terminal: Copy Selection" (command ID: workbench.action.terminal.copySelection). This copies the currently selected text in the terminal to the system clipboard. It is included in terminal.integrated.commandsToSkipShell by default, so it is handled by VS Code rather than passed to the shell. Note that globally (outside the terminal), Ctrl+Shift+C is bound to "Open New External Terminal" (workbench.action.terminal.openNativeConsole). This behavior follows platform standards for terminals: on Linux, Ctrl+Shift+C is standard for copy in terminals (to avoid conflicting with Ctrl+C for interrupt), while Windows uses Ctrl+C.
Citations:
- 1: https://code.visualstudio.com/docs/reference/default-keybindings
- 2: https://stackoverflow.com/questions/47247466/how-can-i-copy-text-from-vs-codes-integrated-terminal
- 3: https://stackoverflow.com/questions/47247466/how-can-i-copy-text-from-vs-codes-integrated-terminal/47253385
- 4: http://code.visualstudio.com/docs/terminal/basics
- 5: https://code.visualstudio.com/docs/editor/integrated-terminal
- 6: https://code.visualstudio.com/docs/terminal/advanced
- 7: https://github.com/microsoft/vscode-docs/blob/36ba054f/docs/reference/default-keybindings.md
- 8: https://github.com/codebling/vs-code-default-keybindings
🌐 Web query:
xremap application filtering scope integrated terminal
💡 Result:
xremap supports application filtering using the application field in modmap and keymap configurations. This allows key remappings to apply only to specific applications (using only) or exclude them (using not). Application names are matched exactly or via regex (e.g., /regex/). For integrated terminals: - xremap detects the host application's class/name, not the shell inside. - VSCode integrated terminal uses VSCode's class: "code.Code" (X11) or similar on Wayland (e.g., "code" or "Code"). - Standalone terminals: "Gnome-terminal" (X11), "gnome-terminal-server" (GNOME Wayland), "Kitty", "Alacritty", "foot" (app_id on wlroots). To find exact names: - X11: wmctrl -x -l (use 3rd column, full or last part). - GNOME Wayland: busctl --user call org.gnome.Shell /com/k0kubun/Xremap com.k0kubun.Xremap WMClasses (requires xremap-gnome extension). - KDE Wayland: Trigger a filter; logs "class". - Sway: swaymsg -t get_tree (app_id). - Fallback: Config with application: {not: []} or window: {not: []}; press key to log active app/window. Example config for terminals: shared: terminals: &terminals - Gnome-terminal - Kitty - code.Code # VSCode incl. integrated terminal keymap: - application: only: *terminals remap: # terminal-specific remaps xremap integrates with X11/Wayland via feature flags (e.g., --features x11, --features gnome). Filters evaluate via WMClient querying current_application.
Citations:
- 1: https://deepwiki.com/xremap/xremap/3.4-contextual-filters
- 2: https://deepwiki.com/xremap/xremap/5-desktop-environment-integration
- 3: https://github.com/xremap/xremap
- 4: https://github.com/k0kubun/xremap
- 5: https://github.com/xremap/xremap/blob/master/README.md
- 6: https://github.com/xremap/xremap/blob/master/example/config.yml
- 7: keyd-application-mapper support for Gnome 42 rvaiya/keyd#223
Remove VS Code/Cursor from terminal clipboard remapping—it breaks editor copy behavior.
When the Code Editors remapping applies terminalClipboardRemap app-wide, Framework+C emits Ctrl+Shift+C even in the editor pane, which opens a new external terminal instead of copying. VS Code's editor copy is Ctrl+C, not Ctrl+Shift+C. While Ctrl+Shift+C correctly triggers terminal copy when the integrated terminal is focused, xremap operates at the window level and cannot distinguish between the integrated terminal and editor panes within the same VS Code window.
Either remove lines 92–97 and 124–128, or configure terminal-specific copy/paste through VS Code's keybindings with terminal focus conditions instead.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@home-manager/modules/xremap/default.nix` around lines 92 - 97, The
codeEditorAppIds list includes VS Code/Cursor ("cursor","Cursor","code","Code")
which causes terminalClipboardRemap to apply to the whole VS Code window and
breaks editor copy behavior; remove those entries from codeEditorAppIds (and
corresponding occurrences where terminalClipboardRemap is applied, e.g., the
block referenced by terminalClipboardRemap usage) so the remap no longer targets
VS Code/Cursor windows, or alternatively stop applying terminalClipboardRemap
app-wide and instead rely on VS Code keybindings with terminal focus conditions
to handle terminal copy/paste.
Move the Slack app mapper config into the shared keyd module so the host does not inline repo config paths. Keep the keyd application mapper service in the shared module and preserve the sg keyd launch path that fixes Slack Framework+C in stale user sessions. Co-authored-by: Codex <noreply@openai.com>
Move the keyd application mapper user unit into the Home Manager services tree so service wiring follows the repo's shared service layout. Keep config/keyd focused on keyd config and enable the mapper through an explicit Home Manager service option so the service can consume app.conf without recursive evaluation. Co-authored-by: Codex <noreply@openai.com>
Write app.conf from the shared keyd module again and keep the Home Manager service focused on the user unit. Have the service read the standard xdg config path instead of carrying a configFile option, while keeping the restart hash tied to the resolved app.conf source. Co-authored-by: Codex <noreply@openai.com>
* fix: remap framework copy for editors * chore: update * chore: update * chore: update * chore: update * chore: update * fix(keyd): centralize app mapper config Move the Slack app mapper config into the shared keyd module so the host does not inline repo config paths. Keep the keyd application mapper service in the shared module and preserve the sg keyd launch path that fixes Slack Framework+C in stale user sessions. Co-authored-by: Codex <noreply@openai.com> * ref(home-manager): move keyd app mapper service Move the keyd application mapper user unit into the Home Manager services tree so service wiring follows the repo's shared service layout. Keep config/keyd focused on keyd config and enable the mapper through an explicit Home Manager service option so the service can consume app.conf without recursive evaluation. Co-authored-by: Codex <noreply@openai.com> * ref(keyd): simplify app mapper wiring Write app.conf from the shared keyd module again and keep the Home Manager service focused on the user unit. Have the service read the standard xdg config path instead of carrying a configFile option, while keeping the restart hash tied to the resolved app.conf source. Co-authored-by: Codex <noreply@openai.com> --------- Co-authored-by: Codex <noreply@openai.com>
* chore(deps): lock file maintenance Signed-off-by: * chore(deps): update dependency mempalace to >=3.2.0 (#1525) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): lock file maintenance (#1526) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix/tmux resurrect nixos (#1529) * fix: tmux resurrect/continuum restore on NixOS - Move plugin options to per-plugin extraConfig in default.nix so they are set before each plugin's run-shell - Move status-right to continuum extraConfig so continuum can prepend its auto-save trigger (#(.../continuum_save.sh)) - Fix _two_function to create tmux server before resolving resurrect restore script path (was always empty after reboot) - Switch grep -E to grep -P for tab matching in post-save hook * fix: load resurrect before continuum in plugin order * chore(deps): update dotagents digest to dc0fdc0 (#1527) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): lock file maintenance (#1528) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): lock file maintenance (#1530) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update dependency mistral-vibe to >=2.7.5 (#1531) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate worktrunk to 0.37.0 (#1532) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): lock file maintenance (#1533) Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix: remap framework copy for editors (#1534) * fix: remap framework copy for editors * chore: update * chore: update * chore: update * chore: update * chore: update * fix(keyd): centralize app mapper config Move the Slack app mapper config into the shared keyd module so the host does not inline repo config paths. Keep the keyd application mapper service in the shared module and preserve the sg keyd launch path that fixes Slack Framework+C in stale user sessions. Co-authored-by: Codex <noreply@openai.com> * ref(home-manager): move keyd app mapper service Move the keyd application mapper user unit into the Home Manager services tree so service wiring follows the repo's shared service layout. Keep config/keyd focused on keyd config and enable the mapper through an explicit Home Manager service option so the service can consume app.conf without recursive evaluation. Co-authored-by: Codex <noreply@openai.com> * ref(keyd): simplify app mapper wiring Write app.conf from the shared keyd module again and keep the Home Manager service focused on the user unit. Have the service read the standard xdg config path instead of carrying a configFile option, while keeping the restart hash tied to the resolved app.conf source. Co-authored-by: Codex <noreply@openai.com> --------- Co-authored-by: Codex <noreply@openai.com> * fix: use extraLuaConfig instead of home.file for nvim init.lua * fix: replace removed nodePackages with top-level packages * fix: remove vllm from nix packages (managed via pyproject.toml) --------- Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Renovate Bot <renovate@whitesourcesoftware.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Codex <noreply@openai.com>
Summary by cubic
Fixes copy/paste in Cursor and VS Code by remapping Framework+C/V to Ctrl+Shift+C/V, matching terminal behavior and avoiding Ctrl+C conflicts. Centralizes Slack Framework→Ctrl mapping in a shared
keydmodule with a Home Manager service, and removes thec = C-chack; other Framework→Ctrl shortcuts stay the same.terminalClipboardRemaptoCursor/VS CodeviacodeEditorAppIds.keyd-application-mapperusing XDGapp.conf; the sharedconfig/keyd/default.nixnow writesapp.confand enables the user unit, launched viasg keydfor reliable socket access.Written for commit 45b053c. Summary will update on new commits.