Skip to content

Commit 87cbfe7

Browse files
committed
fix(shell): resolve upstream merge conflicts and rename Roo Code to Zoo Code (Zoo-Code-Org#321)
- shell.ts: remove existsSync import and revert getWslProfile() to return null when no default profile is configured. Upstream PR Zoo-Code-Org#239's PowerShell fallback was intended for the now-deleted getWindowsShellFromVSCode() and was incorrectly auto-merged into getWslProfile(), causing TS2339 errors. - shell.spec.ts: remove existsSync import and vi.mocked(existsSync) mock that were also carried in by the upstream merge. - Terminal.ts, TerminalProcess.ts, TerminalRegistry.spec.ts: rename "Roo Code" terminal name and "Roo/PS Workaround" string to Zoo Code.
1 parent 55f901c commit 87cbfe7

5 files changed

Lines changed: 14 additions & 24 deletions

File tree

src/integrations/terminal/Terminal.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ export class Terminal extends BaseTerminal {
3030
// the profile path). Explicitly passing shellPath bypasses the profile
3131
// system and prevents VS Code from injecting WSL shell integration.
3232
if (wslProfile) {
33-
this.terminal = terminal ?? vscode.window.createTerminal({ cwd, name: "Roo Code", iconPath, env })
33+
this.terminal = terminal ?? vscode.window.createTerminal({ cwd, name: "Zoo Code", iconPath, env })
3434
} else if (BaseTerminal.getExecaShellPath()) {
3535
const shell = BaseTerminal.getExecaShellPath()!
36-
this.terminal = terminal ?? vscode.window.createTerminal({ cwd, name: "Roo Code", iconPath, env, shellPath: shell })
36+
this.terminal =
37+
terminal ?? vscode.window.createTerminal({ cwd, name: "Zoo Code", iconPath, env, shellPath: shell })
3738
} else {
38-
this.terminal = terminal ?? vscode.window.createTerminal({ cwd, name: "Roo Code", iconPath, env })
39+
this.terminal = terminal ?? vscode.window.createTerminal({ cwd, name: "Zoo Code", iconPath, env })
3940
}
4041

4142
if (Terminal.getTerminalZdotdir()) {

src/integrations/terminal/TerminalProcess.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export class TerminalProcess extends BaseTerminalProcess {
112112

113113
// Only add the PowerShell counter workaround if enabled
114114
if (Terminal.getPowershellCounter()) {
115-
commandToExecute += ` ; "(Roo/PS Workaround: ${this.terminal.cmdCounter++})" > $null`
115+
commandToExecute += ` ; "(Zoo/PS Workaround: ${this.terminal.cmdCounter++})" > $null`
116116
}
117117

118118
// Only add the sleep command if the command delay is greater than 0

src/integrations/terminal/__tests__/TerminalRegistry.spec.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe("TerminalRegistry", () => {
1717
(...args: any[]) =>
1818
({
1919
exitStatus: undefined,
20-
name: "Roo Code",
20+
name: "Zoo Code",
2121
processId: Promise.resolve(123),
2222
creationOptions: {},
2323
state: {
@@ -33,7 +33,6 @@ describe("TerminalRegistry", () => {
3333
},
3434
}) as any,
3535
)
36-
3736
})
3837

3938
afterEach(() => {
@@ -46,7 +45,7 @@ describe("TerminalRegistry", () => {
4645

4746
expect(mockCreateTerminal).toHaveBeenCalledWith({
4847
cwd: "/test/path",
49-
name: "Roo Code",
48+
name: "Zoo Code",
5049
iconPath: expect.objectContaining({ id: expect.any(String) }),
5150
env: {
5251
PAGER,
@@ -67,7 +66,7 @@ describe("TerminalRegistry", () => {
6766

6867
expect(mockCreateTerminal).toHaveBeenCalledWith({
6968
cwd: "/test/path",
70-
name: "Roo Code",
69+
name: "Zoo Code",
7170
iconPath: expect.objectContaining({ id: expect.any(String) }),
7271
env: {
7372
PAGER,
@@ -76,7 +75,7 @@ describe("TerminalRegistry", () => {
7675
VTE_VERSION: "0",
7776
PROMPT_EOL_MARK: "",
7877
},
79-
})
78+
})
8079
} finally {
8180
// Restore original delay
8281
Terminal.setCommandDelay(originalDelay)
@@ -90,7 +89,7 @@ describe("TerminalRegistry", () => {
9089

9190
expect(mockCreateTerminal).toHaveBeenCalledWith({
9291
cwd: "/test/path",
93-
name: "Roo Code",
92+
name: "Zoo Code",
9493
iconPath: expect.objectContaining({ id: expect.any(String) }),
9594
env: {
9695
PAGER,
@@ -99,7 +98,7 @@ describe("TerminalRegistry", () => {
9998
PROMPT_EOL_MARK: "",
10099
ITERM_SHELL_INTEGRATION_INSTALLED: "Yes",
101100
},
102-
})
101+
})
103102
} finally {
104103
Terminal.setTerminalZshOhMy(false)
105104
}
@@ -112,7 +111,7 @@ describe("TerminalRegistry", () => {
112111

113112
expect(mockCreateTerminal).toHaveBeenCalledWith({
114113
cwd: "/test/path",
115-
name: "Roo Code",
114+
name: "Zoo Code",
116115
iconPath: expect.objectContaining({ id: expect.any(String) }),
117116
env: {
118117
PAGER,
@@ -121,7 +120,7 @@ describe("TerminalRegistry", () => {
121120
PROMPT_EOL_MARK: "",
122121
POWERLEVEL9K_TERM_SHELL_INTEGRATION: "true",
123122
},
124-
})
123+
})
125124
} finally {
126125
Terminal.setTerminalZshP10k(false)
127126
}

src/utils/__tests__/shell.spec.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest"
22
import * as vscode from "vscode"
3-
import { existsSync } from "fs"
43
import { userInfo } from "os"
54
import { getShell, getWslProfile, WSL_EXE_PATH } from "../shell"
65

@@ -34,8 +33,6 @@ describe("Shell Detection", () => {
3433

3534
setVSEnvShell("")
3635
vi.mocked(userInfo).mockReturnValue({ shell: null } as any)
37-
// Default: PowerShell 7 is not installed, so the probe falls back to legacy.
38-
vi.mocked(existsSync).mockReturnValue(false)
3936
})
4037

4138
afterEach(() => {

src/utils/shell.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as vscode from "vscode"
2-
import { existsSync } from "fs"
32
import { userInfo } from "os"
43

54
export const WSL_EXE_PATH = "C:\\Windows\\System32\\wsl.exe" as const
@@ -45,12 +44,7 @@ export function getWslProfile(): { path: string; args: string[] } | null {
4544
const { defaultProfileName, profiles } = getWindowsTerminalConfig()
4645

4746
if (!defaultProfileName) {
48-
// No explicit Windows terminal profile is configured. VS Code auto-detects
49-
// the default on modern Windows and prefers PowerShell 7 (pwsh.exe) when it
50-
// is installed, otherwise the always-present Windows PowerShell 5.1. Mirror
51-
// that here so the system prompt advertises the real shell instead of falling
52-
// through to COMSPEC (cmd.exe). See issue #82.
53-
return existsSync(SHELL_PATHS.POWERSHELL_7) ? SHELL_PATHS.POWERSHELL_7 : SHELL_PATHS.POWERSHELL_LEGACY
47+
return null
5448
}
5549

5650
const profile = profiles[defaultProfileName]
@@ -161,4 +155,3 @@ export function getShell(): string {
161155

162156
return shell
163157
}
164-

0 commit comments

Comments
 (0)