0

I'm not even sure how to effectively ask this question, but I'm new to Visual Studio Code 2 and every time I run anything, let's say a simple print function, the output shows me all the directories and unnecessary text that to me just seems like clutter. How can I remove the directories for a simple and clean output on terminal?

  • 1
    *I'm new to Visual Studio Code 2* There is no such' version of Visual Studio code as far as I know –  Jul 13 '21 at 01:58
  • Please put up some images or other infomation that show what the mess is like – Zebartin Jul 13 '21 at 02:07
  • Thanks for the reply. I really wanted to use it because it seemed really user friendly and is more visually pleasing. I don't see how people can tolerate all of the unnecessary directories which are the same font and text color as the output itself. It just seems confusing to me. I appreciate your response though, I'll probably just stick to Sublime Text. – Justin Union Jul 13 '21 at 02:10
  • Zebartin, here's what it looks like when I run the program, "variable = Python, print (variable)" (numpy) Justins-MacBook-Pro:Moshtutorial.py justinunion$ cd /Users/justinunion/Desktop/Python/Moshtutorial.py ; /usr/bin/env /anaconda3/envs/numpy/bin/python /Users/justinunion/.vscode/extensions/ms-python.python-2021.2.633441544/pythonFiles/lib/python/debugpy/launcher 49348 -- /Users/justinunion/Desktop/Python/Moshtutorial.py/mosh.py Python No matter what I run though it always outputs these directories before the actual program output. (I'm new so it's difficult for me to explain) – Justin Union Jul 13 '21 at 02:13
  • @JustinUnion I think these are shell commands that are automatically generated by VS Code, which would not matter much except for your visual experience. You may try directly type in the terminal: `python mosh.py` if you are sure that you are in correct working directory and virtual environment. Besides, what Sujay meant was that VS Code does not have a version named 2. – Zebartin Jul 13 '21 at 02:54
  • Oh you're right for some reason on my program it adds a 2 at the end. I'm not sure why but I'm glad I know now. I think the problem is in fact the shell command. It looks like it keeps setting to "Python Debug Console" as Default when I run the program but it doesn't seem to do anything when I change it to say, bash /bin/bash when I try to change the default. I tried to enter directly in the terminal and it didn't do much for me. Do you know of a way to change the shell command so that it isn't constantly reverting baxck to Python Debug Console? Also I appreciate the replies and the help. – Justin Union Jul 13 '21 at 04:19
  • this question is asked lot: VSC uses these directories to always be able to run the script NO MATTER what the current directory of the terminal is, you could have done a `cd foo` and VSC has no idea what the current directory is – rioV8 Jul 13 '21 at 05:38
  • You may like [code runner](https://stackoverflow.com/q/43643629/14313852) extension. – Shub Jun 23 '23 at 16:57

1 Answers1

1

The commands you provided are the description of the debugging. It can help users to clearly know what the VSCode doing through the commands.

It has no way to remove it, and it's helpful in fact. If you really want to reduce the outputs, you can click the green triangle on the top right. It will run the python file only without debugging.

Steven-MSFT
  • 7,438
  • 1
  • 5
  • 13
  • Figured out how to remove it. First you click on Run on the upper program task bar, and then Add Configuration. From there click the first option, Python File. After that it opens up a "launch.json" folder. From there, you go down to "console", and change "integratedTerminal" to "internalConsole" then you save and it gets rid of the directory paths for clean code. Alternatively, if you still want debug option you can just install the CodeRunner extension and it opens up the option to run the clean code with key shortcut control+option+N, Just uncheck execution message in extension settings. – Justin Union Jul 14 '21 at 22:58