From 41b3233693c34cd81c872a1e7279721b5f640d60 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 6 Sep 2023 19:40:09 -0700 Subject: fix: :bug: fixes for a few context_providers --- extension/src/continueIdeClient.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'extension') diff --git a/extension/src/continueIdeClient.ts b/extension/src/continueIdeClient.ts index 48000b76..3b46d90a 100644 --- a/extension/src/continueIdeClient.ts +++ b/extension/src/continueIdeClient.ts @@ -294,7 +294,7 @@ class IdeProtocolClient { break; case "getTerminalContents": messenger.send("getTerminalContents", { - contents: await this.getTerminalContents(), + contents: await this.getTerminalContents(data.commands), }); break; case "listDirectoryContents": @@ -631,9 +631,19 @@ class IdeProtocolClient { return contents; } - async getTerminalContents(): Promise { + async getTerminalContents(commands: number = -1): Promise { const tempCopyBuffer = await vscode.env.clipboard.readText(); - await vscode.commands.executeCommand("workbench.action.terminal.selectAll"); + if (commands < 0) { + await vscode.commands.executeCommand( + "workbench.action.terminal.selectAll" + ); + } else { + for (let i = 0; i < commands; i++) { + await vscode.commands.executeCommand( + "workbench.action.terminal.selectToPreviousCommand" + ); + } + } await vscode.commands.executeCommand( "workbench.action.terminal.copySelection" ); -- cgit v1.2.3-70-g09d2