Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vscode terminal helper #1395

Merged
merged 13 commits into from
Jun 3, 2024
Merged
12 changes: 12 additions & 0 deletions apps/vscode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,15 @@ It is recommended to install the [VSCode talon extension pack](https://marketpla
## Cursorless

If you'd like to use Cursorless, follow the instructions in the [cursorless-talon repo](https://github.com/pokey/cursorless-talon).

## Terminal

In order to use terminal commands when the VSCode terminal is focused, you must add the following line to your [VSCode `settings.json`](https://code.visualstudio.com/docs/getstarted/settings#_settingsjson):

```
"window.title": "${activeEditorShort}${separator}${rootName}${separator}${profileName}${separator}focus:[${focusedView}]",
```
jaresty marked this conversation as resolved.
Show resolved Hide resolved

This setting will cause VSCode to include a special string in the window title whenever the terminal is focused. Talon will look for this string in the window title and activate the terminal commands in response.

Note that if you have customizations in your window title that you'd like to keep, the important part is just to ensure that `focus:[${focusedView}]` appears somewhere within your custom window title.
7 changes: 7 additions & 0 deletions apps/vscode/vscode_terminal.talon
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
app: vscode
# Looks for special string in window title.
# NOTE: This requires you to add a special setting to your VSCode settings.json
# See [our vscode docs](./README.md#terminal)
win.title: /focus:\[Terminal\]/
-
tag(): terminal