Skip to content

Commit 453342d

Browse files
committed
terminal conflict, infinite scrolling
1 parent 9ccace6 commit 453342d

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/panels/RequestPanel.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import * as vscode from "vscode"
2-
import * as path from "path"
32
import ChokiExtension from "../utilities/watchFile"
43
import { getLama2Command, getShowLama2Term } from "../utilities/utils"
54
import { splitLama2Output } from "../commands/ExecuteCurrentFile/parseOut"
65
import { getUri } from "../utilities/getUri"
76
import { getNonce } from "../utilities/getNonce"
8-
import { exec } from "child_process"
9-
import * as fs from "fs"
107

118
export class Lama2Panel {
129
public static currentPanel: Lama2Panel | undefined
@@ -42,6 +39,8 @@ export class Lama2Panel {
4239
Lama2Panel.currentPanel._panel.reveal(vscode.ViewColumn.Two, true)
4340
} else {
4441
console.log("opening new panel")
42+
vscode.commands.executeCommand('workbench.action.closePanel');
43+
4544
// If a webview panel does not already exist create and show a new one
4645
const panel = vscode.window.createWebviewPanel(
4746
// Panel view type
@@ -90,12 +89,19 @@ export class Lama2Panel {
9089
const { cmd, rflag, rfile, rlog } = lama2Command
9190
this.rfile = rfile
9291
this.rlog = rlog
92+
this.terminal = getShowLama2Term("AutoLama2")
9393
this.setLama2Watch(rflag)
9494

9595
// Execute command and capture output
96-
this.terminal = getShowLama2Term("AutoLama2")
96+
97+
9798
this.terminal.sendText(cmd, true)
99+
this.terminal.show(true)
100+
vscode.commands.executeCommand('workbench.action.closePanel');
101+
102+
98103
console.log("terminal", this.terminal.name)
104+
console.log("terminal-process", this.terminal.processId)
99105
}
100106
catch (error) {
101107
console.error("Error executing Lama2 command:", error)
@@ -105,6 +111,8 @@ export class Lama2Panel {
105111

106112
private setLama2Watch(rflag: string) {
107113
let c = new ChokiExtension()
114+
console.log("setLama2Watch", rflag)
115+
console.log(this.terminal?.name)
108116
c.pathAddTrigger(rflag, this.onLama2Finish, this)
109117
}
110118

@@ -124,6 +132,7 @@ export class Lama2Panel {
124132
}
125133

126134
private async onLama2Finish(output: string) {
135+
console.log("onLama2Finish", output)
127136
try {
128137
output = this.rfile
129138
if (typeof output === "string" && output.trim().startsWith("<")) {

webview/src/pages/Response.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const Response: React.FC = () => {
6464
useEffect(() => {
6565
const messageListener = (event: MessageEvent) => {
6666
const message = event.data
67+
console.log("message", message)
6768
if (message.command === "update") {
6869
// console.log("message", message);
6970

0 commit comments

Comments
 (0)