@@ -4,6 +4,7 @@
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed `ProcessTerminal` to fall back to `COLUMNS` and `LINES` before defaulting to 80x24 dimensions ([#4004](https://github.com/badlogic/pi-mono/issues/4004))
|
||||
- Fixed editor rendering artifacts for Thai Sara Am and Lao AM vowel characters ([#3904](https://github.com/badlogic/pi-mono/issues/3904))
|
||||
|
||||
## [0.70.6] - 2026-04-28
|
||||
|
||||
@@ -327,11 +327,11 @@ export class ProcessTerminal implements Terminal {
|
||||
}
|
||||
|
||||
get columns(): number {
|
||||
return process.stdout.columns || 80;
|
||||
return process.stdout.columns || Number(process.env.COLUMNS) || 80;
|
||||
}
|
||||
|
||||
get rows(): number {
|
||||
return process.stdout.rows || 24;
|
||||
return process.stdout.rows || Number(process.env.LINES) || 24;
|
||||
}
|
||||
|
||||
moveBy(lines: number): void {
|
||||
|
||||
45
packages/tui/test/terminal.test.ts
Normal file
45
packages/tui/test/terminal.test.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import assert from "node:assert";
|
||||
import { describe, it } from "node:test";
|
||||
import { ProcessTerminal } from "../src/terminal.js";
|
||||
|
||||
describe("ProcessTerminal dimensions", () => {
|
||||
it("falls back to COLUMNS and LINES before default dimensions", () => {
|
||||
const previousColumnsDescriptor = Object.getOwnPropertyDescriptor(process.stdout, "columns");
|
||||
const previousRowsDescriptor = Object.getOwnPropertyDescriptor(process.stdout, "rows");
|
||||
const previousColumns = process.env.COLUMNS;
|
||||
const previousLines = process.env.LINES;
|
||||
|
||||
try {
|
||||
Object.defineProperty(process.stdout, "columns", { value: undefined, configurable: true });
|
||||
Object.defineProperty(process.stdout, "rows", { value: undefined, configurable: true });
|
||||
process.env.COLUMNS = "123";
|
||||
process.env.LINES = "45";
|
||||
|
||||
const terminal = new ProcessTerminal();
|
||||
|
||||
assert.equal(terminal.columns, 123);
|
||||
assert.equal(terminal.rows, 45);
|
||||
} finally {
|
||||
if (previousColumnsDescriptor) {
|
||||
Object.defineProperty(process.stdout, "columns", previousColumnsDescriptor);
|
||||
} else {
|
||||
Reflect.deleteProperty(process.stdout, "columns");
|
||||
}
|
||||
if (previousRowsDescriptor) {
|
||||
Object.defineProperty(process.stdout, "rows", previousRowsDescriptor);
|
||||
} else {
|
||||
Reflect.deleteProperty(process.stdout, "rows");
|
||||
}
|
||||
if (previousColumns === undefined) {
|
||||
delete process.env.COLUMNS;
|
||||
} else {
|
||||
process.env.COLUMNS = previousColumns;
|
||||
}
|
||||
if (previousLines === undefined) {
|
||||
delete process.env.LINES;
|
||||
} else {
|
||||
process.env.LINES = previousLines;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user