1

I referred to in

How can I clear the terminal in Visual Studio Code?

How do I automatically clear VS Code terminal when starting a build?

But there was no solution about clear the terminal automatically.

When I press f5 and run it, I want to automatically initialize and display only new results.

  • I think the output value overlaps if the output value exceeds the terminal window. Overlapping results were produced when the output value was longer than the terminal window, and when the output value was shorter than the terminal window, no overlaps were made.

[images]

Chloe
  • 11
  • 3
  • 1
    *"clear the terminal automatically"* - *When* do you want the terminal window to be cleared? – IInspectable May 15 '20 at 08:32
  • When press f5 to run debug mode. – Chloe May 20 '20 at 05:23
  • I saw it and created 'tasks.json' and wrote 'clear presentation'. However, it did not affect the display of execution results in 'debug' mode on 'terminal'. – Chloe May 20 '20 at 06:59
  • As a result, all I want to do is see the execution results of the 'rust' code written. Therefore, any method is fine if the result can be viewed in a way other than in 'debug' mode. – Chloe May 20 '20 at 07:01
  • Of course, I hope the result window will be automatically initialized when it is executed. – Chloe May 20 '20 at 07:01
  • If you want a fresh console window for every run of the program, you can set [externalConsole](https://code.visualstudio.com/docs/cpp/launch-json-reference#_externalconsole) to `true`. – IInspectable May 20 '20 at 07:08
  • I am currently looking at this and using the 'terminal: clear' shortcut as 'f5'. To view the results, press 'f5' on the Editor to run 'Debugging: Start Debugging'. Press 'f5' at 'Terminal' to initialize the previous result before viewing the new result value. https://stackoverflow.com/questions/48713604/how-can-i-clear-the-terminal-in-visual-studio-code – Chloe May 20 '20 at 07:10
  • What I wanted was a result from 'terminal' in 'vs code', but using 'externalConsole' came out from 'cmd'. But I think this is good too. – Chloe May 20 '20 at 07:26
  • You could run a pre-launch task that runs the terminal clear command. – Mark May 21 '20 at 05:09
  • I run 'Debugging: Start Debugging' to see the results of my code and check the results in 'terminal' in 'vscode'. However, due to an unknown error when executing "Debugging: Start Debugging" again, it is difficult to check the correct result because the previous and new results come together. – Chloe May 21 '20 at 07:23
  • I know there is 'terminal: clear' and I am already using it. I hope that 'terminal: clear' will be automatically executed when 'Debugging: Start Debugging' is executed without further manipulation, and only new results will be printed out. Please let me know if there is any other way to see the results other than 'Debugging: Start Debugging'. – Chloe May 21 '20 at 07:27
  • This is the result of the first, second, and third execution of the same code. [1]: https://i.stack.imgur.com/t3yGo.png [2]: https://i.stack.imgur.com/693C2.png [3]: https://i.stack.imgur.com/DAeRs.png – Chloe May 21 '20 at 07:47
  • I want to see only the first result. – Chloe May 21 '20 at 07:50

0 Answers0