I want to make a "simple" project management system.
The targeted concept:
The app asks for a project name (which same as the directory name)
The app creates that directory in a predefined parent directory [this working correctly] In this step check directory duplication [this working correctly ]
The next step open the project in a new VS Code window - this working correctly - but I want to extend this with a callback function that provides any details of the directory, e.g.:
- Is this directory successfully opened in VS Code?
- Is the directory still exist?
At this point I can get the PID of the main VS Code process with this pgrep -f "/usr/share/code/code --unity-launch" command.
I can get the parent process PID of the VS Code window instances with this pgrep -f "/usr/share/code/code --type=zygote" | tail -1 command.
After that, I can get the exact instance with the next command ps -H --ppid 142549 -o pid,tty,time,cmd,comm using the result of the previous command. But this does not contain any details of the target directory.
In the next example, the highlighted process is the target project. This built-in Process Explorer shows the name of the project/directory and wants to get it from the Bash command line.
