Skip to content
Snippets Groups Projects
Commit b3b02933 authored by George Nachman's avatar George Nachman
Browse files

closeSessionWithConfirmation: would always close the current tab if a tab was...

closeSessionWithConfirmation: would always close the current tab if a tab was to be closed. This was only visible from scripting. Issue 6029.
parent 8ac04c1c
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -1507,10 +1507,13 @@ ITERM_WEAKLY_REFERENCEABLE
}
 
- (IBAction)closeCurrentTab:(id)sender {
NSTabViewItem *tabViewItem = [_contentView.tabView selectedTabViewItem];
PTYTab *tab = self.currentTab;
[self closeTabIfConfirmed:tab];
}
- (void)closeTabIfConfirmed:(PTYTab *)tab {
const BOOL shouldClose = [self tabView:_contentView.tabView
shouldCloseTabViewItem:tabViewItem
shouldCloseTabViewItem:tab.tabViewItem
suppressConfirmation:[self willShowTmuxWarningWhenClosingTab:tab]];
if (shouldClose) {
[self closeTab:tab];
Loading
Loading
@@ -1526,10 +1529,10 @@ ITERM_WEAKLY_REFERENCEABLE
}
}
 
- (void)closeSessionWithConfirmation:(PTYSession *)aSession
{
if ([[[self tabForSession:aSession] sessions] count] == 1) {
[self closeCurrentTab:self];
- (void)closeSessionWithConfirmation:(PTYSession *)aSession {
PTYTab *tab = [self tabForSession:aSession];
if ([[tab sessions] count] == 1) {
[self closeTabIfConfirmed:tab];
return;
}
BOOL okToClose = NO;
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment