diff options
Diffstat (limited to 'extension')
-rw-r--r-- | extension/react-app/src/index.css | 1 | ||||
-rw-r--r-- | extension/react-app/src/tabs/gui.tsx | 34 | ||||
-rw-r--r-- | extension/src/activation/activate.ts | 6 | ||||
-rw-r--r-- | extension/src/continueIdeClient.ts | 2 | ||||
-rw-r--r-- | extension/src/terminal/terminalEmulator.ts | 7 |
5 files changed, 30 insertions, 20 deletions
diff --git a/extension/react-app/src/index.css b/extension/react-app/src/index.css index 32a92d0e..db8afab9 100644 --- a/extension/react-app/src/index.css +++ b/extension/react-app/src/index.css @@ -22,6 +22,7 @@ html, body, #root { height: 100%; + background-color: var(--vsc-background); } body { diff --git a/extension/react-app/src/tabs/gui.tsx b/extension/react-app/src/tabs/gui.tsx index 279d052b..994cb896 100644 --- a/extension/react-app/src/tabs/gui.tsx +++ b/extension/react-app/src/tabs/gui.tsx @@ -194,7 +194,7 @@ function GUI(props: GUIProps) { if (topGuiDivRef.current) { const timeout = setTimeout(() => { window.scrollTo({ - top: window.outerHeight, + top: topGuiDivRef.current!.offsetHeight, behavior: "smooth", }); }, 200); @@ -206,7 +206,9 @@ function GUI(props: GUIProps) { console.log("CLIENT ON STATE UPDATE: ", client, client?.onStateUpdate); client?.onStateUpdate((state) => { // Scroll only if user is at very bottom of the window. - const shouldScrollToBottom = window.outerHeight - window.scrollY < 200; + const shouldScrollToBottom = + topGuiDivRef.current && + topGuiDivRef.current?.offsetHeight - window.scrollY < 100; setWaitingForSteps(state.active); setHistory(state.history); setUserInputQueue(state.user_input_queue); @@ -347,12 +349,12 @@ function GUI(props: GUIProps) { </div> <ComboBox - disabled={ - history?.timeline.length - ? history.timeline[history.current_index].step.name === - "Waiting for user confirmation" - : false - } + // disabled={ + // history?.timeline.length + // ? history.timeline[history.current_index].step.name === + // "Waiting for user confirmation" + // : false + // } ref={mainTextInputRef} onEnter={(e) => { onMainTextInput(); @@ -365,6 +367,14 @@ function GUI(props: GUIProps) { <ContinueButton onClick={onMainTextInput} /> </TopGUIDiv> <Footer> + <HeaderButtonWithText + onClick={() => { + client?.sendClear(); + }} + text="Clear History" + > + <Trash size="1.6em" /> + </HeaderButtonWithText> <a href="https://continue.dev/docs" className="no-underline"> <HeaderButtonWithText text="Continue Docs"> <BookOpen size="1.6em" /> @@ -379,14 +389,6 @@ function GUI(props: GUIProps) { > <ChatBubbleOvalLeftEllipsis size="1.6em" /> </HeaderButtonWithText> - <HeaderButtonWithText - onClick={() => { - client?.sendClear(); - }} - text="Clear History" - > - <Trash size="1.6em" /> - </HeaderButtonWithText> </Footer> </> ); diff --git a/extension/src/activation/activate.ts b/extension/src/activation/activate.ts index 77010241..32726c86 100644 --- a/extension/src/activation/activate.ts +++ b/extension/src/activation/activate.ts @@ -59,6 +59,9 @@ export function activateExtension( name: "Continue", }); terminal.dispose(); + if (!ideProtocolClient.continueTerminal) { + ideProtocolClient.continueTerminal = capturedTerminal; + } }); // If any terminals are open to start, replace them @@ -77,6 +80,9 @@ export function activateExtension( } ); terminal.dispose(); + if (!ideProtocolClient.continueTerminal) { + ideProtocolClient.continueTerminal = capturedTerminal; + } }); extensionContext = context; diff --git a/extension/src/continueIdeClient.ts b/extension/src/continueIdeClient.ts index a889d3dc..9a93a4ef 100644 --- a/extension/src/continueIdeClient.ts +++ b/extension/src/continueIdeClient.ts @@ -323,7 +323,7 @@ class IdeProtocolClient { return rangeInFiles; } - private continueTerminal: CapturedTerminal | undefined; + public continueTerminal: CapturedTerminal | undefined; async runCommand(command: string) { if (!this.continueTerminal || this.continueTerminal.isClosed()) { diff --git a/extension/src/terminal/terminalEmulator.ts b/extension/src/terminal/terminalEmulator.ts index 9d90b331..ff2060f8 100644 --- a/extension/src/terminal/terminalEmulator.ts +++ b/extension/src/terminal/terminalEmulator.ts @@ -76,7 +76,8 @@ export class CapturedTerminal { (lines.length > 0 && (last_line.includes("bash-") || last_line.includes(") $ ")) && last_line.includes("$")) || - (last_line.includes("]> ") && last_line.includes(") [")) + (last_line.includes("]> ") && last_line.includes(") [")) || + (last_line.includes(" (") && last_line.includes(")>")) ); } @@ -98,7 +99,7 @@ export class CapturedTerminal { if (!this.hasRunCommand) { this.hasRunCommand = true; // Let the first bash- prompt appear and let python env be opened - await this.waitForCommandToFinish(); + // await this.waitForCommandToFinish(); } if (this.commandQueue.length === 0) { @@ -154,7 +155,7 @@ export class CapturedTerminal { // Create the pseudo terminal this.ptyProcess = pty.spawn(this.shellCmd, [], { name: "xterm-256color", - cols: 160, // TODO: Get size of vscode terminal, and change with resize + cols: 250, // No way to get the size of VS Code terminal, or listen to resize, so make it just bigger than most conceivable VS Code widths rows: 26, cwd: getRootDir(), env, |