Файли
openidea/src/features/terminal/windowsPty.test.ts
T
l0ng-ai 4d6a21c695 fix(terminal): keep the active ConPTY prompt when a terminal resizes (#4324)
When a ConPTY terminal got narrower (for example, a split opened and then closed), xterm dropped the end of the active PowerShell prompt. PowerShell then echoed input at absolute columns without printing the prompt again, so it came back garbled. Local terminals and embedded Run consoles now turn on xterm's cursor-line reflow on Windows builds whose ConPTY needs it. Remote and non-Windows sessions are unchanged.

Closes #4155
2026-11-18 23:32:50 +08:00

20 рядки
765 B
TypeScript

import { afterEach, expect, it } from "vitest";
import { windowsPtyOptions } from "./windowsPty";
import { usePlatform } from "@/platform/platformInfo";
import { useRemote } from "@/platform/remote";
const initialPlatform = usePlatform.getState();
const initialRemote = useRemote.getState();
afterEach(() => {
useRemote.setState(initialRemote);
usePlatform.setState(initialPlatform);
});
it.each(["linux", "windows"])("does not apply the desktop build to a remote %s PTY", (os) => {
usePlatform.setState({ os: "windows", windowsBuildNumber: 22631 });
useRemote.setState({
session: { os, host: "test", root: "/repo", target: { kind: "ssh", config: "test" }, commands: [] },
});
expect(windowsPtyOptions()).toEqual({ reflowCursorLine: false });
});