Skip to content

Commit 8c9dd9a

Browse files
committed
Rename terminalInfo to terminal
1 parent 35a4142 commit 8c9dd9a

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

src/core/webview/ClineProvider.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,8 +1503,10 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
15031503

15041504
// Add model ID if available
15051505
const currentCline = this.getCurrentCline()
1506+
15061507
if (currentCline?.api) {
15071508
const { id: modelId } = currentCline.api.getModel()
1509+
15081510
if (modelId) {
15091511
properties.modelId = modelId
15101512
}

src/integrations/terminal/TerminalRegistry.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ export class TerminalRegistry {
3535

3636
// Register handler for terminal close events to clean up temporary
3737
// directories.
38-
const closeDisposable = vscode.window.onDidCloseTerminal((terminal) => {
39-
const terminalInfo = this.getTerminalByVSCETerminal(terminal)
38+
const closeDisposable = vscode.window.onDidCloseTerminal((vsceTerminal) => {
39+
const terminal = this.getTerminalByVSCETerminal(vsceTerminal)
4040

41-
if (terminalInfo) {
42-
ShellIntegrationManager.zshCleanupTmpDir(terminalInfo.id)
41+
if (terminal) {
42+
ShellIntegrationManager.zshCleanupTmpDir(terminal.id)
4343
}
4444
})
4545

@@ -50,16 +50,16 @@ export class TerminalRegistry {
5050
async (e: vscode.TerminalShellExecutionStartEvent) => {
5151
// Get a handle to the stream as early as possible:
5252
const stream = e.execution.read()
53-
const terminalInfo = this.getTerminalByVSCETerminal(e.terminal)
53+
const terminal = this.getTerminalByVSCETerminal(e.terminal)
5454

5555
console.info("[onDidStartTerminalShellExecution] Shell execution started:", {
5656
hasExecution: !!e.execution,
5757
command: e.execution?.commandLine?.value,
58-
terminalId: terminalInfo?.id,
58+
terminalId: terminal?.id,
5959
})
6060

61-
if (terminalInfo) {
62-
terminalInfo.setActiveStream(stream)
61+
if (terminal) {
62+
terminal.setActiveStream(stream)
6363
} else {
6464
console.error(
6565
"[onDidStartTerminalShellExecution] Shell execution started, but not from a Roo-registered terminal:",
@@ -75,18 +75,18 @@ export class TerminalRegistry {
7575

7676
const endDisposable = vscode.window.onDidEndTerminalShellExecution?.(
7777
async (e: vscode.TerminalShellExecutionEndEvent) => {
78-
const terminalInfo = this.getTerminalByVSCETerminal(e.terminal)
79-
const process = terminalInfo?.process
78+
const terminal = this.getTerminalByVSCETerminal(e.terminal)
79+
const process = terminal?.process
8080
const exitDetails = TerminalProcess.interpretExitCode(e.exitCode)
8181

8282
console.info("[TerminalRegistry] Shell execution ended:", {
8383
hasExecution: !!e.execution,
8484
command: e.execution?.commandLine?.value,
85-
terminalId: terminalInfo?.id,
85+
terminalId: terminal?.id,
8686
...exitDetails,
8787
})
8888

89-
if (!terminalInfo) {
89+
if (!terminal) {
9090
console.error(
9191
"[onDidEndTerminalShellExecution] Shell execution ended, but not from a Roo-registered terminal:",
9292
e,
@@ -95,10 +95,10 @@ export class TerminalRegistry {
9595
return
9696
}
9797

98-
if (!terminalInfo.running) {
98+
if (!terminal.running) {
9999
console.error(
100100
"[TerminalRegistry] Shell execution end event received, but process is not running for terminal:",
101-
{ terminalId: terminalInfo?.id, command: process?.command, exitCode: e.exitCode },
101+
{ terminalId: terminal?.id, command: process?.command, exitCode: e.exitCode },
102102
)
103103

104104
return
@@ -107,14 +107,14 @@ export class TerminalRegistry {
107107
if (!process) {
108108
console.error(
109109
"[TerminalRegistry] Shell execution end event received on running terminal, but process is undefined:",
110-
{ terminalId: terminalInfo.id, exitCode: e.exitCode },
110+
{ terminalId: terminal.id, exitCode: e.exitCode },
111111
)
112112

113113
return
114114
}
115115

116116
// Signal completion to any waiting processes.
117-
terminalInfo.shellExecutionComplete(exitDetails)
117+
terminal.shellExecutionComplete(exitDetails)
118118
},
119119
)
120120

@@ -317,8 +317,8 @@ export class TerminalRegistry {
317317
* @param terminal The VSCode terminal instance
318318
* @returns The Terminal object, or undefined if not found
319319
*/
320-
private static getTerminalByVSCETerminal(terminal: vscode.Terminal): RooTerminal | undefined {
321-
const found = this.terminals.find((t) => t instanceof Terminal && t.terminal === terminal)
320+
private static getTerminalByVSCETerminal(vsceTerminal: vscode.Terminal): RooTerminal | undefined {
321+
const found = this.terminals.find((t) => t instanceof Terminal && t.terminal === vsceTerminal)
322322

323323
if (found?.isClosed()) {
324324
this.removeTerminal(found.id)

0 commit comments

Comments
 (0)