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

Make it possible to open the tmux dashboard if there are no windows opened and...

Make it possible to open the tmux dashboard if there are no windows opened and the tmux gateway is buried. Issue 5835
parent c7270d81
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -1419,11 +1419,6 @@ ITERM_WEAKLY_REFERENCEABLE
}
}
 
- (IBAction)openDashboard:(id)sender
{
[[TmuxDashboardController sharedInstance] showWindow:nil];
}
- (IBAction)findCursor:(id)sender
{
[[[self currentSession] textview] beginFindCursor:YES];
Loading
Loading
@@ -2125,8 +2120,7 @@ ITERM_WEAKLY_REFERENCEABLE
mode:iTermFindModeCaseSensitiveRegex];
}
 
- (IBAction)detachTmux:(id)sender
{
- (IBAction)detachTmux:(id)sender {
[[self currentTmuxController] requestDetach];
}
 
Loading
Loading
@@ -7025,16 +7019,14 @@ ITERM_WEAKLY_REFERENCEABLE
 
 
// Returns true if the given menu item is selectable.
- (BOOL)validateMenuItem:(NSMenuItem *)item
{
- (BOOL)validateMenuItem:(NSMenuItem *)item {
BOOL logging = [[self currentSession] logging];
BOOL result = YES;
 
if ([item action] == @selector(detachTmux:) ||
[item action] == @selector(newTmuxWindow:) ||
[item action] == @selector(newTmuxTab:) ||
[item action] == @selector(openDashboard:)) {
result = [[iTermController sharedInstance] haveTmuxConnection];
[item action] == @selector(newTmuxTab:)) {
return [[iTermController sharedInstance] haveTmuxConnection];
} else if ([item action] == @selector(setDefaultToolbeltWidth:)) {
return _contentView.shouldShowToolbelt;
} else if ([item action] == @selector(toggleToolbeltVisibility:)) {
Loading
Loading
Loading
Loading
@@ -85,6 +85,7 @@
#import "PTYTextView.h"
#import "PTYWindow.h"
#import "QLPreviewPanel+iTerm.h"
#import "TmuxDashboardController.h"
#import "ToastWindowController.h"
#import "VT100Terminal.h"
 
Loading
Loading
@@ -311,7 +312,9 @@ static const NSTimeInterval kOneMonth = 30 * 24 * 60 * 60;
}
 
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
if ([menuItem action] == @selector(toggleUseBackgroundPatternIndicator:)) {
if ([menuItem action] == @selector(openDashboard:)) {
return [[iTermController sharedInstance] haveTmuxConnection];
} else if ([menuItem action] == @selector(toggleUseBackgroundPatternIndicator:)) {
[menuItem setState:[self useBackgroundPatternIndicator]];
return YES;
} else if ([menuItem action] == @selector(undo:)) {
Loading
Loading
@@ -2027,6 +2030,10 @@ static const NSTimeInterval kOneMonth = 30 * 24 * 60 * 60;
[[iTermTipController sharedInstance] showTip];
}
 
- (IBAction)openDashboard:(id)sender {
[[TmuxDashboardController sharedInstance] showWindow:nil];
}
#pragma mark - Private
 
- (void)updateProcessType {
Loading
Loading
Loading
Loading
@@ -31,6 +31,7 @@
#import "FutureMethods.h"
#import "ITAddressBookMgr.h"
#import "iTermAdvancedSettingsModel.h"
#import "iTermBuriedSessions.h"
#import "iTermHotKeyController.h"
#import "NSArray+iTerm.h"
#import "NSFileManager+iTerm.h"
Loading
Loading
@@ -221,6 +222,11 @@ static iTermController *gSharedInstance;
}
}
}
for (PTYSession *session in [[iTermBuriedSessions sharedInstance] buriedSessions]) {
if ([session isTmuxClient] || [session isTmuxGateway]) {
return session;
}
}
return nil;
}
 
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