visual studio code working directory for subfolders - visual-studio-code

I opened a project directory using ^K^O
inside the project directory is a subdirectory (named 'code') with my python source files.
When I run the files using VS Code's debug session or Code-Runner the current working returned by python's os.getcwd() directory is the top-level project directory and not the actual directory of the code file.
Naturally, when running the code from the command line I get a different behavior.
How can I change the working directory of all the files in this project?
Can this be changed globally, so that the default behavior is that files are debugged from their actual directory?

Related

How to open vscode on a large directory of files

I have a project that has hundreds of .c .h and .cpp files. I'd like to start using vscode with this project; however, I need to be able to tell vscode what files to actually include in the project (because depending on the build, many files are not included). Is there a way to force a file list into vscode without using the GUI/Add-File mechanism?

How to run one debugger after another automatically in vscode?

I have several folders in a workspace, each folder with its launch.json file and its own large configuration. I am trying to run all launch.json files one after another in visual studio code.
Any help?

Opening VSCode project from terminal displays blank folder structure

I'm using ZSH and installed the code command in path for VSCode, I have also made the settings to inherit the env in the integrated terminal. However, when I type in code . from my terminal it launches an empty VSCode folder structure, despite having a bunch of files and folders in it.
What am I missing?

Directory hidden in visual studio code explorer

I have a problem that has been bugging me for months. I have a software directory structure which when viewed in visual studio code explorer is missing a directory called 'install' all other directories are visible. If I delete the 'install' directory and recreate it with visual studio code explorer (right click and select new folder) it does not appear in the explorer but does appear in the file system.
Somehow visual studio explorer seems to be filtering out any directory call 'install' anywhere in the directory structure or on any other filesystem.
The same thing happens if I try and create an 'install' directory on any filesystem, local filesystem, local git repo, remote folder, etc.
Any suggestions about how this is happening and what to do about it?
make sure you don't have by accident a setting like this in your settings.json file:
"files.exclude": {
"install": true
},
If you use the gui for your settings instead of the json file, search for "Files: Exclude" and you will see the files or folders that are told not to display.

Unable to Generate Code First Migration Scripts during Visual Studio Team Services Build

I want to Generate Some files during TFS-Build for e.g. Generate some text files using exe which is executed through powershell.
I added the steps(Powershell) in TFS-build Definition , when my process comes to this step, log generates and shows that file is generated successfully, but I don't see any generated file under Artifacts > drop folder.
NOTE: I am using same directory for generating text files where my exe is available.
How to achieve this in TFS Build , I am using Visual Studio Team Services.
Based on the log files, you just published the files that in the D:\a\1\a folder to the artifacts (e.g. CIRIg.Mvc.zip, CIRIg.Mvc.SourceManifest.xml, CIRIg.Mvc.deploy.cmd, CIRIg.Mvc.SetParameters.xml).
However, the generated txt file (636247216960041685.txt) is in the D:\a\1\s...) and isn’t copied to the D:\a\1\a folder. So, you don’t see it in Artifacts > drop folder.
To deal with that issue, you can generate the file to D:\a\1\a ($(build.artifactstagingdirectory)) folder or copy that file to that folder by using Copy Files step/task.