简体   繁体   中英

MacOS Terminal: Getting external application to quit when I quit the terminal

I'm trying to figure out how to get the terminal to terminate/quit an application when I quit the terminal. By default, I have the terminal run a long python script that opens any application depending on user input, and it recognises when the application has properly 'quit' and loops the code back to the user input but trying to get the terminal to terminate the application in the tab when I close the terminal is something I'm struggling to figure out. Any help would be grand!

Here's a screenshot of what I mean:

示例截图

When pressing terminate, any app open that's in that terminal tab and run through my python script I want it to 'quit'.

Note: If it doesn't quite make sense, I apologise as I'm awful at explaining!!

set your code input fg=True , bg=False , _bg_exc=False option.

# run command in foreground 
"fg": True, 

# run a command in the background. commands run in the background # ignore SIGHUP and do not automatically exit when the parent process
"bg": False, 

# automatically report exceptions for background commands 
"bg_exc": False,

See:

Here's document

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM