-
Notifications
You must be signed in to change notification settings - Fork 299
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
Clear previous output when running in terminal #153
Conversation
src/codeManager.ts
Outdated
@@ -327,6 +327,9 @@ export class CodeManager { | |||
this._appInsightsClient.sendEvent(executor); | |||
let command = this.getFinalCommandToRunCodeFile(executor, appendFile); | |||
command = this.changeCommandForBashOnWindows(command); | |||
if (this._config.get<boolean>('clearPreviousOutput')) { | |||
this._terminal.sendText('clear'); |
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.
Most shell is using clear
, while cmd is cls
. Need to handle it.
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.
Thank you, fixed.
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 found a better solution by calling the built-in 'clear terminal' command. It should be able to handle all kinds of shells. I've tested it using CMD and Powershell.
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.
Awesome!
Addresses #152. I've tested it and it works. Sometimes you can may see the clear command being run for a very brief moment before the console clears.