From 88f64b5fd56582ac79ea6d7c4f690c765a83d01d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=AE=AE=E0=AE=A9=E0=AF=8B=E0=AE=9C=E0=AF=8D=E0=AE=95?= =?UTF-8?q?=E0=AF=81=E0=AE=AE=E0=AE=BE=E0=AE=B0=E0=AF=8D=20=E0=AE=AA?= =?UTF-8?q?=E0=AE=B4=E0=AE=A9=E0=AE=BF=E0=AE=9A=E0=AF=8D=E0=AE=9A=E0=AE=BE?= =?UTF-8?q?=E0=AE=AE=E0=AE=BF?= Date: Mon, 26 May 2025 09:41:42 +0530 Subject: [PATCH] Update PAGER environment variable for Windows compatibility in Terminal class --- src/integrations/terminal/Terminal.ts | 2 +- .../terminal/__tests__/TerminalRegistry.test.ts | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/integrations/terminal/Terminal.ts b/src/integrations/terminal/Terminal.ts index 4b35e92bbf..8bf2072f3d 100644 --- a/src/integrations/terminal/Terminal.ts +++ b/src/integrations/terminal/Terminal.ts @@ -152,7 +152,7 @@ export class Terminal extends BaseTerminal { public static getEnv(): Record { const env: Record = { - PAGER: "cat", + PAGER: process.platform === "win32" ? "" : "cat", // VTE must be disabled because it prevents the prompt command from executing // See https://wiki.gnome.org/Apps/Terminal/VTE diff --git a/src/integrations/terminal/__tests__/TerminalRegistry.test.ts b/src/integrations/terminal/__tests__/TerminalRegistry.test.ts index 3d691df945..283e5b73c4 100644 --- a/src/integrations/terminal/__tests__/TerminalRegistry.test.ts +++ b/src/integrations/terminal/__tests__/TerminalRegistry.test.ts @@ -3,6 +3,8 @@ import { Terminal } from "../Terminal" import { TerminalRegistry } from "../TerminalRegistry" +const PAGER = process.platform === "win32" ? "" : "cat" + // Mock vscode.window.createTerminal const mockCreateTerminal = jest.fn() @@ -29,7 +31,7 @@ describe("TerminalRegistry", () => { }) describe("createTerminal", () => { - it("creates terminal with PAGER set to cat", () => { + it("creates terminal with PAGER set appropriately for platform", () => { TerminalRegistry.createTerminal("/test/path", "vscode") expect(mockCreateTerminal).toHaveBeenCalledWith({ @@ -37,7 +39,7 @@ describe("TerminalRegistry", () => { name: "Roo Code", iconPath: expect.any(Object), env: { - PAGER: "cat", + PAGER, VTE_VERSION: "0", PROMPT_EOL_MARK: "", }, @@ -57,7 +59,7 @@ describe("TerminalRegistry", () => { name: "Roo Code", iconPath: expect.any(Object), env: { - PAGER: "cat", + PAGER, PROMPT_COMMAND: "sleep 0.05", VTE_VERSION: "0", PROMPT_EOL_MARK: "", @@ -79,7 +81,7 @@ describe("TerminalRegistry", () => { name: "Roo Code", iconPath: expect.any(Object), env: { - PAGER: "cat", + PAGER, VTE_VERSION: "0", PROMPT_EOL_MARK: "", ITERM_SHELL_INTEGRATION_INSTALLED: "Yes", @@ -100,7 +102,7 @@ describe("TerminalRegistry", () => { name: "Roo Code", iconPath: expect.any(Object), env: { - PAGER: "cat", + PAGER, VTE_VERSION: "0", PROMPT_EOL_MARK: "", POWERLEVEL9K_TERM_SHELL_INTEGRATION: "true",