File tree Expand file tree Collapse file tree 4 files changed +30
-8
lines changed
controllers/chat/messenger Expand file tree Collapse file tree 4 files changed +30
-8
lines changed Original file line number Diff line number Diff line change 525525 "@aws-sdk/s3-request-presigner" : " <3.731.0" ,
526526 "@aws-sdk/smithy-client" : " <3.731.0" ,
527527 "@aws-sdk/util-arn-parser" : " <3.731.0" ,
528- "@aws/mynah-ui" : " ^4.31.0-beta.3 " ,
528+ "@aws/mynah-ui" : " ^4.31.0-beta.5 " ,
529529 "@gerhobbelt/gitignore-parser" : " ^0.2.0-9" ,
530530 "@iarna/toml" : " ^2.2.5" ,
531531 "@smithy/fetch-http-handler" : " ^5.0.1" ,
Original file line number Diff line number Diff line change @@ -816,7 +816,7 @@ export class Messenger {
816816 {
817817 id : 'reject-code-diff' ,
818818 status : 'clear' ,
819- icon : 'revert ' as MynahIconsType ,
819+ icon : 'undo ' as MynahIconsType ,
820820 text : 'Undo' ,
821821 } ,
822822 ]
@@ -860,7 +860,7 @@ export class Messenger {
860860 new ChatMessage (
861861 {
862862 message : message ,
863- messageType : 'answer-part ' ,
863+ messageType : 'answer' ,
864864 followUps : undefined ,
865865 followUpsHeader : undefined ,
866866 relatedSuggestions : undefined ,
Original file line number Diff line number Diff line change @@ -431,8 +431,30 @@ export class ExecuteBash {
431431 return output
432432 }
433433
434+ private getDisplayCommand ( ) : string {
435+ const workspaceFolder = vscode . workspace . workspaceFolders ?. [ 0 ]
436+ if ( ! workspaceFolder || ! this . workingDirectory ) {
437+ return this . command
438+ }
439+ const workspacePath = path . normalize ( workspaceFolder . uri . fsPath )
440+ const cwd = path . normalize ( this . workingDirectory )
441+
442+ const cleanedCommand = this . command . replace ( / ^ c d \s + [ ^ \n ] + ?& & \s * / , '' ) . trim ( )
443+
444+ if ( ! cwd . startsWith ( workspacePath ) ) {
445+ return this . command
446+ }
447+
448+ const relativePath = path . relative ( workspacePath , cwd )
449+ if ( ! relativePath || relativePath === '.' ) {
450+ return cleanedCommand
451+ }
452+
453+ return `cd "/${ relativePath . replace ( / \\ / g, '/' ) } " && ${ cleanedCommand } `
454+ }
455+
434456 public queueDescription ( updates : Writable ) : void {
435- updates . write ( '```shell\n' + this . command + '\n```' )
457+ updates . write ( '```shell\n' + this . getDisplayCommand ( ) + '\n```' )
436458 updates . end ( )
437459 }
438460
You can’t perform that action at this time.
0 commit comments