Why does the Terminal tab keep popping up on my MacBook Pro when I try to shut it down?
Open terminal and under the Terminal menu item click on preferences. This will give you the pane shown below.



From this pane click on Profiles in the upper left corner of the pane and notice below the Profiles pane but to the right there is a set of tabs.  Click on the Shell tab.  This opens a pane shown below.



Notice that around the middle of this pane is the phrase: Ask before closing. I've drawn a red rectangle around this. Now make sure the Never button is checked.