When in the terminal pane, I would like to reference the file or folder of the active editor tab via environment variable or PowerShell variable (preferred). Something like this:
ii $vsActivePath
or
ii $vsActiveFile
Is this possible?
Set a breakpoint in your code, and start debugging by pressing F5 or selecting Debug > Start Debugging. When paused at the breakpoint, hover over any variable in the current scope. A data tip appears, showing the name and current value of the variable.
Click the Advanced system settings link. Click Environment Variables. In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Reopen Command prompt window, and run your java code.
After the cell finishes running, you can view the data that was loaded using the Variables Explorer and Data Viewer. First select the Variables icon in the notebook's upper toolbar. A JUPYTER: VARIABLES pane will open at the bottom of VS Code. It contains a list of the variables defined so far in your running kernel.
Open Visual Studio Code and access the Command Palette (⇧⌘P) and start typing shell command and select option Shell Command: Install 'code' command in PATH. After that you're able to start a new terminal window, change into your project directory and use code . to open the current directory in Visual Studio Code.
Not sure if this is exactly what you're looking for but you can get access to various variables in vs code such as:
${workspaceRoot} the path of the folder opened in VS Code
${workspaceRootFolderName} the name of the folder opened in VS Code without any slashes (/)
${file} the current opened file
Full details can be found here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With