Quantcast
Channel: Bash: How to determine whether terminal is opened by third-party app - Ask Ubuntu
Browsing all 5 articles
Browse latest View live

Answer by Peter Cordes for Bash: How to determine whether terminal is opened...

If you're talking about one specific third-party app, then use an environment variable. Most programs will pass along the entire environment unchanged when they fork+exec new processes. So, start this...

View Article


Answer by Zalatik for Bash: How to determine whether terminal is opened by...

Here's my 2 cents. Just add it to your .bashrc. Replace terminals with your favorite terminals and export command with yours. run_in_terminal(){ local parent_command="$(ps --no-headers --pid $PPID -o...

View Article


Answer by Sergiy Kolodyazhnyy for Bash: How to determine whether terminal is...

As far as Visual Studio Code goes, there apparently is a way to set additional environment variables for the integrated terminal. So, set up Visual Studio to use this config:...

View Article

Answer by Mark Smith for Bash: How to determine whether terminal is opened by...

You could probably do it by walking back up the ancestry of the shell and working out whether it was started by something that equates to "you", or another program. Get the shell's PID (process ID),...

View Article

Bash: How to determine whether terminal is opened by third-party app

I want my bash script (specifically my ~/.bashrc) to do something only if the terminal was opened by me directly, and do something else if it was opened through an app e.g. VS Code. How can I...

View Article

Browsing all 5 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>