I would to have Ctrl + C mapped to Cmd + C only for terminal context. How do I do that?
Hi @mehtajinesh , you can achieve this by defining a Trigger specifically for the terminal application. Check out the BTT docs to see how to do this: Global and App Specific Triggers · GitBook
I want to acheive it for all terminals like shell and inside VSCode as well. Is it possible to do it in one trigger rule using setting some common condition or I need to map it based on every application?
Here are the steps to achieve this:
-
Include the name of the focused view in your IDE so that when the integrated terminal has focus, the window title will include the text
Terminal
. To achieve this in VSCode, add the following to your Settings file located at~/Library/Application\ Support/Code/User/settings.json
:"window.title": "${activeEditorShort}${separator}${focusedView}${separator}${rootName}", "window.titleBarStyle": "custom",
The same setup can be applied to other IDEs. For example, for Cursor, add the above JSON to this file
~/Library/Application\ Support/Cursor/User/settings.json
. -
Create a Conditional Activation Group (CAG) such that it returns True if any of these conditions are true:
-
The active application name is one of the Terminal apps you use (e.g. iTerm2, Terminal, etc.)
-
The active application name is any of the IDEs you use (e.g. Code, Cursor, etc.) and the active Window Name contains
Terminal
(this is possible thanks to step #1).appName == "iTerm2" OR appName == "Terminal" OR (windowName CONTAINS "Terminal" AND (appName == "Code" OR appName == "Cursor"))
- Inside your CAG, add your trigger and action to map Ctrl + C to Cmd + C.
With this setup, Ctrl + C will map to Cmd + C if and only if the CAG is active.
Hope this helps!
EDIT:
Link to BTT docs regarding CAGs: Global and App Specific Triggers · GitBook
link to pull request implementing the
focusedView
feature: add `focusedView` variable to window title by meganrogge · Pull Request #190613 · microsoft/vscode · GitHub