I wrote this script to avoid issues when open terminal of VS Code and get a old terminal and run commands in an older session getting problems with python venv (virtual environment) (VS Code opens venv automatically)
This script, if installed correctly, will do the things automatically
A bash-like terminal, I used the Git Bash for Windows (that one comes when you install Git for Windows)
- Cloning this repository, put the script in your best scripts folder, for example:
cp close-vscode-terminal.sh ~/scripts
- Add this entry to load the script using the command or your favorite text editor:
cat <<-EOF >> ~/.bashrc
# this script closes the older terminal when opens VS Code, comment or delete it anytime you want to stop it to use
source ~/scripts/close-vscode-terminal.sh
EOF- Delete the script using the command below or manually delete it:
rm ~/scripts/close-vscode-terminal.sh
- Remove the file generated by the script to control the process and terminal close:
rm ~/.vscode_state
* You can place this file in anyplace you want changing the folder in the close-vscode-terminal.sh script
- Open
.bashrcin your editor and remove manually the entry or comment the line like this example:
# source ~/scripts/close-vscode-terminal.sh
This project is licensed under the MIT License.