How to prevent Terminal window from changing its size after opening and closing tab
The solution is to turn on setting to always show tab bar, even if only one tab is open in window:


in top bar, go to View → Show Tab Bar,
or use keyboard shortcut ⇧+⌘+T.


This is just a workaround I have found on this site to a bug that is present in Terminal app at least since 2009. So far this is the only solution that was working for me consistently on every OS X installation.