-
Notifications
You must be signed in to change notification settings - Fork 29.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose a terminal's creation options as API #63052
Comments
Well terminals aren't bound to workspaces and we can't expose a dynamic cwd, how about this? export interface Terminal {
readonly initialCwd: string;
} |
That's perfect, yes I agree with your comment. |
@DonJayamanne if #46696 worked in multi-root workspaces would that also fix the problem? |
Unfortunately no. |
@DonJayamanne you need to do more than just set the python version on the path, like run some script to set up virtual env or something? |
Yes, thats right. |
Adding to October for discussion, this won't be implemented in October. |
I discussed this at the API meeting today, instead of exposing an export interface Terminal {
/**
* The object used to initialize the terminal, this is useful for things like detecting the
* shell type of shells not launched by the extension or detecting what folder the shell was
* launched in.
*/
readonly creationOptions: Readonly<TerminalOptions | ExtensionTerminalOptions>;
} |
We should use |
@DonJayamanne I'd like some feedback/validation before promoting this to stable, if the idea is validated then we can look at promoting it to stable for December. |
Woo hoo. Perfect. Validated, thanks |
To verify:
|
@connor4312 are you sure it's not working in multi-root workspaces? It's undefined in single root workspaces for me, which means open the default cwd, but for multi-root it always sets it as a URI? Are you by chance using this command? It is expected to come through as undefined for that as well. |
Okay, if that's expected then I think we're good 🙂 |
Thanks, it is an important edge case for extensions to consider, my hope is that it's understood as those terminals were created just like a call to createTerminal when cwd is undefined. |
Right now when a terminal is created the
onDidOpenTerminal
event fires providing the ref to theterminal
created.This information is crucial for the Python Extension when activating the Python Environment in the terminal.
Note: Each workspace folder can have different python environments, hence the workspace folder Uri is necessary when identifying the python environment that needs to be activated.
Suggestion: Add
workspaceUr
orcwd
to theTerminal
object.The text was updated successfully, but these errors were encountered: