Skip to content
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

Merged
merged 5 commits into from
Jul 31, 2017
Merged

Clear previous output when running in terminal #153

merged 5 commits into from
Jul 31, 2017

Conversation

JeffreyCA
Copy link
Contributor

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.

@@ -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');
Copy link
Owner

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, fixed.

Copy link
Contributor Author

@JeffreyCA JeffreyCA left a 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.

Copy link
Owner

@formulahendry formulahendry left a comment

Choose a reason for hiding this comment

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

Awesome!

@formulahendry formulahendry merged commit 49de48a into formulahendry:master Jul 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants