@@ -16,14 +16,6 @@ import { DefaultAmazonQAppInitContext } from 'aws-core-vscode/amazonq'
1616 */
1717export function registerCommands ( provider : AmazonQChatViewProvider ) {
1818 globals . context . subscriptions . push (
19- Commands . register ( 'aws.amazonq.stopToolExecution' , async ( ) => {
20- void focusAmazonQPanel ( ) . then ( ( ) => {
21- void provider . webview ?. postMessage ( {
22- command : 'stopChatResponse' ,
23- params : { } , // how to get the current tabId?
24- } )
25- } )
26- } ) ,
2719 registerGenericCommand ( 'aws.amazonq.explainCode' , 'Explain' , provider ) ,
2820 registerGenericCommand ( 'aws.amazonq.refactorCode' , 'Refactor' , provider ) ,
2921 registerGenericCommand ( 'aws.amazonq.fixCode' , 'Fix' , provider ) ,
@@ -92,7 +84,10 @@ export function registerCommands(provider: AmazonQChatViewProvider) {
9284 params : { } ,
9385 } )
9486 } )
95- } )
87+ } ) ,
88+ registerShellCommandShortCut ( 'aws.amazonq.runCmdExecution' , 'run-shell-command' , provider ) ,
89+ registerShellCommandShortCut ( 'aws.amazonq.rejectCmdExecution' , 'reject-shell-command' , provider ) ,
90+ registerShellCommandShortCut ( 'aws.amazonq.stopCmdExecution' , 'stop-shell-command' , provider )
9691 )
9792}
9893
@@ -137,3 +132,14 @@ async function focusAmazonQPanel() {
137132 await Commands . tryExecute ( 'aws.amazonq.AmazonQChatView.focus' )
138133 await Commands . tryExecute ( 'aws.amazonq.AmazonCommonAuth.focus' )
139134}
135+
136+ function registerShellCommandShortCut ( commandName : string , buttonId : string , provider : AmazonQChatViewProvider ) {
137+ return Commands . register ( commandName , async ( ) => {
138+ void focusAmazonQPanel ( ) . then ( ( ) => {
139+ void provider . webview ?. postMessage ( {
140+ command : 'executeShellCommandShortCut' ,
141+ params : { buttonId } ,
142+ } )
143+ } )
144+ } )
145+ }
0 commit comments