I have my preferences set so that
CTRL-D closes my current window, but I'd like the Terminal application to quit if I close my last/only terminal window. iTerm2 can do this. Can Terminal do it?
open applescript editor and paste in
on is_running(appName) tell application "System Events" to (name of processes) contains appName end is_running set app to "Terminal" repeat if is_running(app) then tell application app set WindowNum to get window count if WindowNum = 0 then quit end if end tell delay 5 end if end repeat
Then save the script and run it by double-clicking it.