-
Notifications
You must be signed in to change notification settings - Fork 746
feat(amazonq): add keybinding shortcut for stop/reject/run shell commands #7655
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
Changes from all commits
2dbb8ce
792ab03
df6722f
1de6621
28b972a
9c825f6
c70d7c6
98c3beb
372906f
9be6dfa
3488ba8
6914e01
5325611
9e81555
9de3649
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -554,6 +554,21 @@ | |
| ] | ||
| }, | ||
| "commands": [ | ||
| { | ||
| "command": "aws.amazonq.stopCmdExecution", | ||
| "title": "Stop Amazon Q Command Execution", | ||
| "category": "%AWS.amazonq.title%" | ||
| }, | ||
| { | ||
| "command": "aws.amazonq.runCmdExecution", | ||
| "title": "Run Amazon Q Command Execution", | ||
| "category": "%AWS.amazonq.title%" | ||
| }, | ||
| { | ||
| "command": "aws.amazonq.rejectCmdExecution", | ||
| "title": "Reject Amazon Q Command Execution", | ||
| "category": "%AWS.amazonq.title%" | ||
| }, | ||
| { | ||
| "command": "_aws.amazonq.notifications.dismiss", | ||
| "title": "%AWS.generic.dismiss%", | ||
|
|
@@ -843,6 +858,24 @@ | |
| } | ||
| ], | ||
| "keybindings": [ | ||
| { | ||
| "command": "aws.amazonq.stopCmdExecution", | ||
| "key": "ctrl+shift+backspace", | ||
| "mac": "cmd+shift+backspace", | ||
| "when": "aws.amazonq.amazonqChatLSP.isRunning" | ||
| }, | ||
| { | ||
| "command": "aws.amazonq.runCmdExecution", | ||
| "key": "ctrl+shift+enter", | ||
| "mac": "cmd+shift+enter", | ||
| "when": "aws.amazonq.amazonqChatLSP.isRunning" | ||
| }, | ||
| { | ||
| "command": "aws.amazonq.rejectCmdExecution", | ||
| "key": "ctrl+shift+r", | ||
| "mac": "cmd+shift+r", | ||
| "when": "aws.amazonq.amazonqChatLSP.isRunning" | ||
| }, | ||
| { | ||
| "command": "_aws.amazonq.focusChat.keybinding", | ||
| "win": "win+alt+i", | ||
|
|
@@ -1325,26 +1358,40 @@ | |
| "fontCharacter": "\\f1de" | ||
| } | ||
| }, | ||
| "aws-schemas-registry": { | ||
| "aws-sagemaker-code-editor": { | ||
dungdong-aws marked this conversation as resolved.
Show resolved
Hide resolved
laileni-aws marked this conversation as resolved.
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why this changed?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it was because of
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks for the catch na |
||
| "description": "AWS Contributed Icon", | ||
| "default": { | ||
| "fontPath": "./resources/fonts/aws-toolkit-icons.woff", | ||
| "fontCharacter": "\\f1df" | ||
| } | ||
| }, | ||
| "aws-schemas-schema": { | ||
| "aws-sagemaker-jupyter-lab": { | ||
| "description": "AWS Contributed Icon", | ||
| "default": { | ||
| "fontPath": "./resources/fonts/aws-toolkit-icons.woff", | ||
| "fontCharacter": "\\f1e0" | ||
| } | ||
| }, | ||
| "aws-stepfunctions-preview": { | ||
| "aws-schemas-registry": { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @yueny2020 got added here after npm install run for dependencies. |
||
| "description": "AWS Contributed Icon", | ||
| "default": { | ||
| "fontPath": "./resources/fonts/aws-toolkit-icons.woff", | ||
| "fontCharacter": "\\f1e1" | ||
| } | ||
| }, | ||
| "aws-schemas-schema": { | ||
| "description": "AWS Contributed Icon", | ||
| "default": { | ||
| "fontPath": "./resources/fonts/aws-toolkit-icons.woff", | ||
| "fontCharacter": "\\f1e2" | ||
| } | ||
| }, | ||
| "aws-stepfunctions-preview": { | ||
| "description": "AWS Contributed Icon", | ||
| "default": { | ||
| "fontPath": "./resources/fonts/aws-toolkit-icons.woff", | ||
| "fontCharacter": "\\f1e3" | ||
| } | ||
| } | ||
| }, | ||
| "walkthroughs": [ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,7 +78,10 @@ export function registerCommands(provider: AmazonQChatViewProvider) { | |
| params: {}, | ||
| }) | ||
| }) | ||
| }) | ||
| }), | ||
| registerShellCommandShortCut('aws.amazonq.runCmdExecution', 'run-shell-command', provider), | ||
| registerShellCommandShortCut('aws.amazonq.rejectCmdExecution', 'reject-shell-command', provider), | ||
| registerShellCommandShortCut('aws.amazonq.stopCmdExecution', 'stop-shell-command', provider) | ||
| ) | ||
| } | ||
|
|
||
|
|
@@ -123,3 +126,14 @@ export async function focusAmazonQPanel() { | |
| await Commands.tryExecute('aws.amazonq.AmazonQChatView.focus') | ||
| await Commands.tryExecute('aws.amazonq.AmazonCommonAuth.focus') | ||
| } | ||
|
|
||
| function registerShellCommandShortCut(commandName: string, buttonId: string, provider: AmazonQChatViewProvider) { | ||
| return Commands.register(commandName, async () => { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: |
||
| void focusAmazonQPanel().then(() => { | ||
| void provider.webview?.postMessage({ | ||
| command: 'aws/chat/executeShellCommandShortCut', | ||
| params: { id: buttonId }, | ||
| }) | ||
| }) | ||
| }) | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the stop shortcut will also used for global stop, right? if yes, then we should change the title. IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but regular prompt without tool execution can be still considered as Q Command right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why no tool execution can be considered Q command stop / run / reject?