Fixed terminals breaking if a tab is clicked twice