дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-06 18:17:15 +02:00
Tool output is shown as a terminal would show the line: backspaces erase (conda's spinner), a carriage return rewrites the line (pip progress) and ANSI sequences are dropped. The interpreter status widget re-reads interpreters when one is created or added in Settings. A conda environment lives outside the project, so no file event announced it, and when the configured path was already set the widget kept showing "Invalid interpreter" and an interpreter list without it.
16 рядки
769 B
TypeScript
16 рядки
769 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { terminalLine } from "../languages/api";
|
|
|
|
describe("terminalLine", () => {
|
|
it.each([
|
|
["Solving environment: -\b\\\b|\b/\bdone", "Solving environment: done"],
|
|
["Downloading 10%\rDownloading 55%\rDownloading 100%", "Downloading 100%"],
|
|
["Collecting pip\r\n", "Collecting pip"],
|
|
["\x1b[32mSuccessfully installed\x1b[0m six", "Successfully installed six"],
|
|
["\x1b]0;conda\x07Preparing transaction", "Preparing transaction"],
|
|
["progress 99%\rdone", "doneress 99%"],
|
|
["\tindented\x07", "\tindented"],
|
|
])("renders %j as %j", (raw, line) => expect(terminalLine(raw)).toBe(line));
|
|
it.each(["", "\b\b", "\x1b[2K\r", " "])("drops %j", (raw) => expect(terminalLine(raw)).toBeNull());
|
|
});
|