question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use new vsc API to activate terminal without running any commands in terminal

See original GitHub issue

Contribute to terminal environments

This new API allows extensions to change environment variables when the terminal is starting up.

  • Support terminal activation for debugger without running Commands in terminal
  • Running python in terminal will user correct environment even when terminal is already open
  • Not polluting terminal history with unnecessary commands
  • expose .env variables into terminal without activation of environment
const collection = window.getEnvironmentVariableCollection(true);
const separator = process.platform === 'win32' ? ';' : ':';
collection.prepend('PATH', `/foo${separator}`);
collection.replace('JAVA_HOME', '/bar');

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:39
  • Comments:28 (14 by maintainers)

github_iconTop GitHub Comments

3reactions
Tyriarcommented, May 13, 2020

The API moved to ExtensionContext late last month and should be stable in 1.46.

1reaction
mattseddoncommented, May 30, 2022

Thanks, @brettcannon. We do have one additional use case where the CLI is globally installed (could even be as a binary via brew for example) but the associated project uses some kind of virtual environment. Under these circumstances, we have to add the environment details to PATH as calling the CLI with /path/to/env/interpreter/python -m dvc some command throws an error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Integrated Terminal in Visual Studio Code
Visual Studio Code has an integrated terminal to enable working in your shell of choice ... Use the Ctrl+Shift+` keyboard shortcut to create...
Read more >
VSCode: How to run a command after each terminal open?
My development environment is VSCode, and I open a dozen new terminals each day. After each terminal open, I have to manually run...
Read more >
VS Code tips —Run the current file in the integrated terminal
Use the " Run active file in terminal " command to execute the current file in VS Code's integrated terminal.Keep in mind that...
Read more >
Integrated terminal - vscode-docs1
From the Command Palette ( kb(workbench.action.showCommands) ), use the View:Toggle Integrated Terminal command. Terminal. Note: You can still open an external ...
Read more >
An overview on Windows Terminal | Microsoft Learn
You can set Windows Terminal to launch in a specific configuration using command line arguments. You can specify which profile to open in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found