Skip to content

fix: use clearScreen instead of clearLogs#504

Merged
9aoy merged 3 commits intomainfrom
clearScreen
Aug 22, 2025
Merged

fix: use clearScreen instead of clearLogs#504
9aoy merged 3 commits intomainfrom
clearScreen

Conversation

@9aoy
Copy link
Copy Markdown
Collaborator

@9aoy 9aoy commented Aug 22, 2025

Summary

use clearScreen instead of clearLogs.

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings August 22, 2025 09:40
@netlify
Copy link
Copy Markdown

netlify bot commented Aug 22, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit aa49f67
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/68a83df4d668e20007b9fc8f
😎 Deploy Preview https://deploy-preview-504--rstest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@9aoy 9aoy requested a review from fi3ework August 22, 2025 09:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR changes the screen clearing mechanism from console.clear() to using ANSI escape sequences (console.log('\x1Bc')) for better terminal control. The change renames the function from clearLogs to clearScreen to better reflect its purpose and updates all call sites accordingly.

  • Replaces console.clear() with ANSI escape sequence \x1Bc for screen clearing
  • Renames function from clearLogs to clearScreen for better semantic clarity
  • Updates all function calls throughout the watch mode handlers

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

const clearScreen = () => {
if (!isDebug()) {
console.clear();
// clear screen
Copy link

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The comment 'clear screen' is redundant given the clear function name clearScreen. Consider removing this comment or making it more descriptive about why ANSI escape sequences are used instead of console.clear().

Suggested change
// clear screen
// Use ANSI escape sequence to clear the screen, as console.clear() may not work reliably in all environments

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

@fi3ework fi3ework left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the console.clear in packages/core/src/core/cliShortcuts.ts should be repalced as well?

@9aoy
Copy link
Copy Markdown
Collaborator Author

9aoy commented Aug 22, 2025

is the console.clear in packages/core/src/core/cliShortcuts.ts should be repalced as well?

nice catch!

@9aoy 9aoy merged commit 29967cb into main Aug 22, 2025
16 checks passed
@9aoy 9aoy deleted the clearScreen branch August 22, 2025 10:00
@9aoy 9aoy mentioned this pull request Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants