Views:
4,391β
Votes: 3β
Tags:
command-line
visual-studio-code
Link:
π See Original Answer on Ask Ubuntu β§ π
URL:
https://askubuntu.com/q/1021556
Title:
Can I check if the terminal was started by Visual Studio Code?
ID:
/2018/04/03/Can-I-check-if-the-terminal-was-started-by-Visual-Studio-Code_
Created:
April 3, 2018
Upload:
September 15, 2024
Layout: post
TOC:
false
Navigation: false
Copy to clipboard: false
Using this potentially duplicate answer: https://askubuntu.com/a/1012277/307523
rick@alien:~$ echo $$
25119
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
rick@alien:~$ pstree -aps $$
systemd,1 splash fastboot kaslr
ββlightdm,1026
ββlightdm,1294 --session-child 12 19
ββupstart,1838 --user
ββgnome-terminal-,25109
ββbash,25119
ββpstree,5696 -aps 25119
The environment variable $$
returns the current running processes PID (Process ID) which is the bash terminal.
The pstree
command shows the entire βtreeβ of commands called.