-
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
Add a way to initialize new terminals #91284
Comments
Do the |
Doesn't that setting just let you pass options to the shell? (in my case, I don't know of any way to use that option to achieve what I'm trying to do (open the shell like normal, but insert a command right after the shell opens.) |
Huh... I've actually had this issue for quite a while, but just now I thought of a nice workaround. I've added this to the bottom of my #
# Allow parent to initialize shell
#
if [[ -n $ZSH_INIT_COMMAND ]]; then
echo "Running: $ZSH_INIT_COMMAND"
eval "$ZSH_INIT_COMMAND"
fi And I added this to my workspace settings: {
"settings": {
"terminal.integrated.env.linux": {
"ZSH_INIT_COMMAND": "source dev-session.sh"
},
// ... It's not ideal, as it requires me to modify my shell config file, but it works perfectly. It eliminates my need for this feature though, so I'll just close this for now. |
For basically all my projects, I have a
dev-session.sh
script that sets up environment variables and paths for language runtimes (usually NodeJS and Python.)Every time I open a new terminal in VSCode, I run
source dev-session.sh
.It would save me a lot of key presses over the years if VSCode could add a way to automatically initialize new terminal windows.
One way to do this would be to make a general version of the vscode-python
python.terminal.activateEnvironment
option. For example an option liketerminal.integrated.shellSetupCommand
that I could set to a string like"source dev-session.sh"
.All this would need to do is wait 500ms after a new terminal is opened, then write the contents of the setting followed by "\n".
The text was updated successfully, but these errors were encountered: