mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Merge pull request #1585 from KJ7LNW/roo-fix-win32-terminal-dup-command-issue
This commit is contained in:
commit
4ce2664fc4
4 changed files with 25 additions and 1 deletions
|
|
@ -11,6 +11,7 @@ export class Terminal {
|
|||
private streamClosed: boolean
|
||||
public process?: TerminalProcess
|
||||
public taskId?: string
|
||||
public cmdCounter: number = 0
|
||||
public completedProcesses: TerminalProcess[] = []
|
||||
private initialCwd: string
|
||||
|
||||
|
|
|
|||
|
|
@ -276,7 +276,20 @@ export class TerminalProcess extends EventEmitter<TerminalProcessEvents> {
|
|||
})
|
||||
|
||||
// Execute command
|
||||
terminal.shellIntegration.executeCommand(command)
|
||||
const defaultWindowsShellProfile = vscode.workspace
|
||||
.getConfiguration("terminal.integrated.defaultProfile")
|
||||
.get("windows")
|
||||
const isPowerShell =
|
||||
process.platform === "win32" &&
|
||||
(defaultWindowsShellProfile === null ||
|
||||
(defaultWindowsShellProfile as string)?.toLowerCase().includes("powershell"))
|
||||
if (isPowerShell) {
|
||||
terminal.shellIntegration.executeCommand(
|
||||
`${command} ; ${this.terminalInfo.cmdCounter++} > $null; start-sleep -milliseconds 150`,
|
||||
)
|
||||
} else {
|
||||
terminal.shellIntegration.executeCommand(command)
|
||||
}
|
||||
this.isHot = true
|
||||
|
||||
// Wait for stream to be available
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@ import { TerminalRegistry } from "../TerminalRegistry"
|
|||
const mockCreateTerminal = jest.fn()
|
||||
|
||||
jest.mock("vscode", () => ({
|
||||
workspace: {
|
||||
getConfiguration: jest.fn().mockReturnValue({
|
||||
get: jest.fn().mockReturnValue(null),
|
||||
}),
|
||||
},
|
||||
window: {
|
||||
createTerminal: (...args: any[]) => {
|
||||
mockCreateTerminal(...args)
|
||||
|
|
|
|||
|
|
@ -14,6 +14,11 @@ jest.mock("vscode", () => {
|
|||
}
|
||||
|
||||
return {
|
||||
workspace: {
|
||||
getConfiguration: jest.fn().mockReturnValue({
|
||||
get: jest.fn().mockReturnValue(null),
|
||||
}),
|
||||
},
|
||||
window: {
|
||||
createTerminal: jest.fn(),
|
||||
onDidStartTerminalShellExecution: jest.fn().mockImplementation((handler) => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue