-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
Add cls command to repl #52206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add cls command to repl #52206
Conversation
2e75463
to
afe8eea
Compare
I understand the proposal for a new command, but given the existing |
In most CLI and REPL having a command to clear the screen. People who is more using commands instead of shortcuts will a little hard to clear the screen while using Node.js REPL. |
afe8eea
to
1d743e5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at this twice at least and I have no strong opinion about adding the additional command.
Maybe it's useful, while it's also not required. I did not see requests for it before, so it's probably not often needed while people might also think about it more with the additional command existing.
Should we just accept this? I guess it won't hurt? @nodejs/repl
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I guess it's fine to add it.
@MrJithil could you please rebase? |
Sure. |
repl: add cls command `.cls` will clear the current repl screen
1d743e5
to
43e1003
Compare
@BridgeAR Rebased. Thanks. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #52206 +/- ##
==========================================
- Coverage 88.49% 88.45% -0.04%
==========================================
Files 703 703
Lines 207529 207545 +16
Branches 40011 40008 -3
==========================================
- Hits 183643 183587 -56
- Misses 15885 15944 +59
- Partials 8001 8014 +13
🚀 New features to boost your workflow:
|
['new Error', 'Promise'].forEach((cmd) => r.write(`${cmd}\n`)); | ||
assert.strictEqual(accum.match(clearChar), null); | ||
r.write('.cls\n'); | ||
assert.strictEqual(accum.match(clearChar).length > 0, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could use assert.match here and have a concrete expectation for the output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm generally -1 on this. console.clear()
works perfectly well for this.
add
.cls
command which will be very convinient for clearing the active screen