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

Fix a bug where a buried tmux gateway could not relay title changed...

Fix a bug where a buried tmux gateway could not relay title changed notifications to the proper PTYTab because it lacks a delegate.
Issue 5890
parent ae673787
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -156,10 +156,8 @@ typedef enum {
hSpacing:(double)horizontalSpacing
vSpacing:(double)verticalSpacing;
 
// Notify the tab that this session, which is a tmux gateway, received a rename of a tmux window.
- (void)sessionWithTmuxGateway:(PTYSession *)session
wasNotifiedWindowWithId:(int)windowId
renamedTo:(NSString *)newName;
// The tmux window title changed.
- (void)sessionDidChangeTmuxWindowNameTo:(NSString *)newName;
 
// Returns the objectSpecifier of the tab (used to identify a tab for Applescript).
- (NSScriptObjectSpecifier *)objectSpecifier;
Loading
Loading
Loading
Loading
@@ -5249,7 +5249,8 @@ ITERM_WEAKLY_REFERENCEABLE
}
 
- (void)tmuxWindowRenamedWithId:(int)windowId to:(NSString *)newName {
[_delegate sessionWithTmuxGateway:self wasNotifiedWindowWithId:windowId renamedTo:newName];
PTYSession *representativeSession = [[_tmuxController sessionsInWindow:windowId] firstObject];
[representativeSession.delegate sessionDidChangeTmuxWindowNameTo:newName];
[_tmuxController windowWasRenamedWithId:windowId to:newName];
}
 
Loading
Loading
Loading
Loading
@@ -208,5 +208,5 @@ extern NSString *const iTermTabDidChangeWindowNotification;
- (void)updateIcon;
 
- (void)checkInvariants:(NSString *)when;
- (void)setTmuxWindowName:(NSString *)tmuxWindowName;
@end
Loading
Loading
@@ -535,13 +535,8 @@ static void SetAgainstGrainDim(BOOL isVertical, NSSize *dest, CGFloat value) {
return [[tabViewItem_ tabView] selectedTabViewItem] == tabViewItem_;
}
 
- (void)sessionWithTmuxGateway:(PTYSession *)session
wasNotifiedWindowWithId:(int)windowId
renamedTo:(NSString *)newName {
PTYTab *tab = [session.tmuxController window:windowId];
if (tab) {
[tab setTmuxWindowName:newName];
}
- (void)sessionDidChangeTmuxWindowNameTo:(NSString *)newName {
[self setTmuxWindowName:newName];
}
 
- (void)sessionSelectContainingTab {
Loading
Loading
Loading
Loading
@@ -73,6 +73,7 @@ extern NSString *const kTmuxControllerSessionWasRenamed;
 
- (PTYSession *)sessionForWindowPane:(int)windowPane;
- (PTYTab *)window:(int)window;
- (NSArray<PTYSession *> *)sessionsInWindow:(int)window;
- (void)registerSession:(PTYSession *)aSession
withPane:(int)windowPane
inWindow:(int)window;
Loading
Loading
Loading
Loading
@@ -569,6 +569,10 @@ static NSString *kListWindowsFormat = @"\"#{session_name}\t#{window_id}\t"
return [[windows_ objectForKey:[NSNumber numberWithInt:window]] objectAtIndex:0];
}
 
- (NSArray<PTYSession *> *)sessionsInWindow:(int)window {
return [[self window:window] sessions];
}
- (BOOL)isAttached
{
return !detached_;
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