Skip to content

Closes the VS Code terminal on first launch to avoid issues from old sessions

License

Notifications You must be signed in to change notification settings

lvf23/close-vscode-terminal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Close Visual Studio Code Terminal

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

Requirements

A bash-like terminal, I used the Git Bash for Windows (that one comes when you install Git for Windows)

Installation

  1. Cloning this repository, put the script in your best scripts folder, for example:
cp close-vscode-terminal.sh ~/scripts
  1. 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

How to uninstall

  1. Delete the script using the command below or manually delete it:
rm ~/scripts/close-vscode-terminal.sh
  1. 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

  1. Open .bashrc in your editor and remove manually the entry or comment the line like this example:
# source ~/scripts/close-vscode-terminal.sh

License

This project is licensed under the MIT License.

About

Closes the VS Code terminal on first launch to avoid issues from old sessions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages