forked from vercel/turborepo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tui): replay all logs sent to tui with forced crlf (vercel#9962)
### Description If a task is run without a TTY (e.g. in CI) the logs will be created with LF (`\n`) line endings. The TUI assumes that logs are produced hooked up to a TTY where CRLF (`\r\n`) is used to return the cursor to the first column and move to the next row (`\n` behavior in non-TTY). This PR adds a log replay method that replays logs with CRLF line endings regardless of what is in the actual file. Future PR is to refactor this to share code with the standard log replay as I didn't have time to tackle this right at this moment. ### Testing Instructions Added quick unit test to verify this swaps out LF for CRLF and is a noop if the logs already use CRLF. Manual Test: First populate the logs with a non-TTY run: ``` [0 olszewski@macbookpro] /tmp/tui-test $ turbo @repo/ui#build > /dev/null ``` Using `turbo@2.4.2`: <img width="797" alt="Screenshot 2025-02-13 at 6 24 47 PM" src="https://github.com/user-attachments/assets/45439888-0098-4bb7-92b8-65eb2789cfbf" /> Using `turbo_dev` from this PR <img width="762" alt="Screenshot 2025-02-13 at 6 26 04 PM" src="https://github.com/user-attachments/assets/bd00c5dd-ebd8-41eb-9bd8-4f597925676f" />
- Loading branch information
1 parent
d322f36
commit e75eb2a
Showing
3 changed files
with
76 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters