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

Add cancel button to "what kind of tab/window do you want?"

issue 5795
parent 2f040e01
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -1626,7 +1626,11 @@ static const NSTimeInterval kOneMonth = 30 * 24 * 60 * 60;
 
- (IBAction)newWindow:(id)sender {
DLog(@"newWindow: invoked");
[[iTermController sharedInstance] newWindow:sender possiblyTmux:[self possiblyTmuxValueForWindow:YES]];
BOOL cancel;
BOOL tmux = [self possiblyTmuxValueForWindow:YES cancel:&cancel];
if (!cancel) {
[[iTermController sharedInstance] newWindow:sender possiblyTmux:tmux];
}
}
 
- (IBAction)newSessionWithSameProfile:(id)sender
Loading
Loading
@@ -1637,7 +1641,11 @@ static const NSTimeInterval kOneMonth = 30 * 24 * 60 * 60;
- (IBAction)newSession:(id)sender
{
DLog(@"iTermApplicationDelegate newSession:");
[[iTermController sharedInstance] newSession:sender possiblyTmux:[self possiblyTmuxValueForWindow:NO]];
BOOL cancel;
BOOL tmux = [self possiblyTmuxValueForWindow:NO cancel:&cancel];
if (!cancel) {
[[iTermController sharedInstance] newSession:sender possiblyTmux:tmux];
}
}
 
- (IBAction)arrangeHorizontally:(id)sender
Loading
Loading
@@ -1986,7 +1994,8 @@ static const NSTimeInterval kOneMonth = 30 * 24 * 60 * 60;
return [[iTermHotKeyController sharedInstance] profileHotKeyForWindowController:term];
}
 
- (BOOL)possiblyTmuxValueForWindow:(BOOL)isWindow {
- (BOOL)possiblyTmuxValueForWindow:(BOOL)isWindow cancel:(BOOL *)cancel {
*cancel = NO;
static NSString *const kPossiblyTmuxIdentifier = @"NoSyncNewWindowOrTabFromTmuxOpensTmux";
if ([[[[iTermController sharedInstance] currentTerminal] currentSession] isTmuxClient]) {
NSString *heading =
Loading
Loading
@@ -1998,11 +2007,12 @@ static const NSTimeInterval kOneMonth = 30 * 24 * 60 * 60;
isWindow ? @"window" : @"tab"];
NSString *tmuxAction = isWindow ? @"New tmux Window" : @"New tmux Tab";
iTermWarningSelection selection = [iTermWarning showWarningWithTitle:title
actions:@[ tmuxAction, @"Use Default Profile" ]
actions:@[ tmuxAction, @"Use Default Profile", @"Cancel" ]
accessory:nil
identifier:kPossiblyTmuxIdentifier
silenceable:kiTermWarningTypePermanentlySilenceable
heading:heading];
*cancel = (selection == kiTermWarningSelection2);
return (selection == kiTermWarningSelection0);
} else {
return 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