Home > Net >  Is there a way to edit the VSCode Integrated Terminal to only display the file name when running a f
Is there a way to edit the VSCode Integrated Terminal to only display the file name when running a f

Time:07-16

VsCode Terminal: enter image description here

In the first line of the above image you can see there is a bunch of useless fluff that I want to remove. I managed to remove the fluff in the Prompt changing it to just "$" and want to do something similar for the line where the file is executed.

CodePudding user response:

  1. Add #!/opt/homebrew/bin/python3 to line 1 of hello.py
  2. cd /Users/julioguidotti/Documents/Harvard\ CS50P
  3. Make hello.py executable (chmod 755 hello.py or chmod x hello.py)
  4. Run the file ./hello.py.

CodePudding user response:

Perhaps it would be better to use the Debug Console instead of the Terminal then.

To do this, you need a custom launch configuration:

In the Run and Debug tab click create a launch.json file (if you don't have one already) and select the Python File template. Then, in .vscode/launch.json change property "console": "integratedTerminal", to "console": "internalConsole" for the desired configuration.

Make sure to switch to Debug Console tab after you're done (Cmd Shift Y on Mac, or click the tab next to your Terminal).

enter image description here

  • Related