How can I force VSCode to use a specific terminal when I click run/debug from the GUI? - visual-studio-code

So, I have multiple terminals open in the VSCode editor. I want the VSCode to use a specific terminal that I have named as interactive. Is it possible for me to force VSCode to use that terminal and not the default terminal?
More details
I am trying to run python programs on a cluster that uses lsf scheduler. I have created a remote session in VSCode to the login node of the cluster. Hence, the default terminal of VSCode would run programs on the login node which is not allowed.
In another integrated terminal, I have created an interactive session using the scheduler to a compute node. I am trying to force VSCode to use this terminal.

Related

Is it possible to run the Javascript debug terminal outside of VSCode?

I want the Javascript debug terminal to be run outside of the vscode in the external linux terminal.
How can i do that?
Not found a single relevant answer in any platform.

Change terminal used by Code-Runner extension in VS Code to cmd while workspace default integrated terminal is powershell?

Is there a setting in VS Code for the Code Runner extension that lets you run in a shell that's different than the workspace's default shell?
For context, my default integrated terminal is powershell. I have the code-runner.runInTerminal setting set (see, e.g., here), and whenever I run python using the extension, it creates a new "Code" powershell integrated terminal (unless one already exists), activates my selected python environment, and runs the code. However, when it tries to activate the environment, I get this popup:
So, I'd like to change the shell that Code Runner uses to cmd, BUT I want to keep using powershell as my default integrated terminal for the workspace.
Changing my workspace's default shell to cmd isn't an option, and neither is changing to a third shell like WSL. This issue indicates to me that the environment activation isn't getting fixed in powershell anytime soon. For now, I've done what the issue suggests and have just stopped Code Runner from activating a new environment in the terminals it creates (set python.terminal.activateEnvironment to false), but I'm worried now I won't be able to have Code Runner use any other python environments than the default one. What can I do?

How can i identify different terminal instances in VsCode

I am using VsCode Remote with Linux, and when starting a VsCode integrated terminal in the IDE, I need to run some scripts in the remote server. I would therefore like to identify "which" of my integrated terminals is calling the script. Is there any way to identify the concrete terminal instance from the script in the remote machine? (For example, environment variable containing the name of the terminal, etc...)

VSCode SSH auto-open terminal and run commands

I use VSCode with the Remote - SSH extension to connect to a remote dev enviroment.
During development on the remote machine, I use integrated terminal to view application logs. At this moment, I have to open new terminals and run commands manually, which is too much work for my lazy hands ;)
Questions are:
When I connect, I want VScode to open terminal tabs for me and run some commands (like tail ./logs/whatever). Is that possible?
If (1) is possible, can I also configure the terminals to open in VSCode Split Terminal mode?

How do i open a local terminal from a remote session in VScode?

When i open my workspace in VScode i go directly into my SSH work area, which is what i want. But i want to have a split terminal with access to both my SSH-work area and a terminal for my local computer, but i cant access the local one without making an explicitly new terminal from the dropdown window. And if i try to split the new local terminal i get the error "The terminal shell CWD "/Users/asd/work/" does not exist" as if its being looked for in my SSH work directory. Is there any way of specifying the default terminal to be on my local computer? If i do so in the terminal preferences in VScode i get the CWD-error on startup instead.
This should have been resolved with microsoft/vscode-remote-release issue 1479
Both of you don't have C:\Windows\System32 on your path, I don't understand why that is.
But I will change this to not rely on the PATH.
Even if this was for Windows originally, opening a local shell, (Mac or Windows) should now be possible while having a remote session.
Wtih ctrl+shift+p or cmd+shift+p(Command Palette), you have:
Terminal: Create New Integrated Terminal (local)
Bonus, with VSCode 1.53 (Jan. 2021), there is now:
Remote layout persistence
Terminal layout is restored on remote terminal reconnection. In the video below, the terminal layout is restored when reloading VS Code and reconnecting to a Windows Subsystem for Linux (WSL) remote instance.