Compare commits

...
Author SHA1 Message Date
szdziedzicandClaude Opus 5.5 b10d44f0ed [eas-cli] Add CHANGELOG entry
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-24 23:49:48 +02:00
szdziedzicandClaude Opus 5.5 1e2a72982f [eas-cli] Stop spinners from repeating their text after a terminal resize
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-24 23:49:23 +02:00
3 changed files with 48 additions and 0 deletions

No files matched your search

+2
View File
@@ -10,6 +10,8 @@ This is the log of notable changes to EAS CLI and related packages.
### 🐛 Bug fixes
- [eas-cli] Stop spinners from printing their text over and over after the terminal is resized. ([#4473](https://github.com/expo/eas-cli/pull/4473) by [@szdziedzic](https://github.com/szdziedzic))
### 🧹 Chores
## [24.8.0](https://github.com/expo/eas-cli/releases/tag/v24.8.0) - 2026-09-24
@@ -0,0 +1,36 @@
jest.unmock('ora');
import { ora } from '../ora';
function createFakeTtyStream(columns: number): NodeJS.WriteStream & { clearedLines: number } {
return {
isTTY: true,
columns,
clearedLines: 0,
write: jest.fn(),
moveCursor: jest.fn(),
cursorTo: jest.fn(),
clearLine(this: { clearedLines: number }) {
this.clearedLines++;
},
} as unknown as NodeJS.WriteStream & { clearedLines: number };
}
describe(ora, () => {
it('clears all wrapped lines after the terminal gets narrower', () => {
const stream = createFakeTtyStream(200);
const spinner = ora({ text: 'x'.repeat(100), stream, isEnabled: true });
spinner.render();
spinner.render();
expect(stream.clearedLines).toBe(1);
stream.columns = 40;
// The frame on screen was written at the old width, so it is cleared with the old line count.
spinner.render();
stream.clearedLines = 0;
spinner.render();
// "- " + 100 characters wraps to 3 lines at 40 columns.
expect(stream.clearedLines).toBe(3);
});
});
+10
View File
@@ -41,6 +41,16 @@ export function ora(options?: Options | string): Ora {
const oraStart = spinner.start.bind(spinner);
const oraStop = spinner.stop.bind(spinner);
const oraStopAndPersist = spinner.stopAndPersist.bind(spinner);
const oraRender = spinner.render.bind(spinner);
spinner.render = (): Ora => {
// ora only recalculates how many terminal lines the text wraps to when the text changes.
// After the terminal is resized, the stale count makes every frame clear too few lines,
// so the spinner text gets printed over and over. Setting the text recalculates the count.
const { text } = spinner;
spinner.text = text;
return oraRender();
};
const logWrap = (method: any, args: any[]): void => {
oraStop();