Permalink
Browse files

Issue list-windows after resize-pane. Pass -PF format to break-pane.

  • Loading branch information...
1 parent 2f2480a commit be4c20f68cefd56879a38ae117c2777127c101ec @gnachman gnachman committed Mar 9, 2012
Showing with 19 additions and 8 deletions.
  1. +19 −8 TmuxController.m
View
@@ -397,13 +397,21 @@ - (void)windowPane:(int)wp
dir = @"U";
}
}
- NSString *cmdStr = [NSString stringWithFormat:@"resize-pane -%@ -t %%%d %d",
- dir, wp, abs(amount)];
+ NSString *resizeStr = [NSString stringWithFormat:@"resize-pane -%@ -t %%%d %d",
+ dir, wp, abs(amount)];
+ NSString *listStr = [NSString stringWithFormat:@"list-windows -F \"#{window_id} #{window_layout}\""];
+ NSArray *commands = [NSArray arrayWithObjects:
+ [gateway_ dictionaryForCommand:resizeStr
+ responseTarget:nil
+ responseSelector:nil
+ responseObject:nil],
+ [gateway_ dictionaryForCommand:listStr
+ responseTarget:self
+ responseSelector:@selector(clientSizeChangeResponse:)
+ responseObject:nil],
+ nil];
++numOutstandingWindowResizes_;
- [gateway_ sendCommand:cmdStr
- responseTarget:self
- responseSelector:@selector(clientSizeChangeResponse:)
- responseObject:nil];
+ [gateway_ sendCommandList:commands];
}
// The splitVertically parameter uses the iTerm2 conventions.
@@ -492,7 +500,7 @@ - (void)breakOutWindowPane:(int)windowPane toPoint:(NSPoint)screenPoint
- (void)breakOutWindowPane:(int)windowPane toTabAside:(NSString *)sibling
{
- [gateway_ sendCommand:[NSString stringWithFormat:@"break-pane -t %%%d", windowPane]
+ [gateway_ sendCommand:[NSString stringWithFormat:@"break-pane -P -F \"#{window_id}\" -t %%%d", windowPane]
responseTarget:self
responseSelector:@selector(windowPaneBrokeOutWithWindowId:setAffinityTo:)
responseObject:sibling];
@@ -501,7 +509,10 @@ - (void)breakOutWindowPane:(int)windowPane toTabAside:(NSString *)sibling
- (void)windowPaneBrokeOutWithWindowId:(NSString *)windowId
setAffinityTo:(NSString *)windowGuid
{
- [affinities_ setValue:windowGuid equalToValue:windowId];
+ if ([windowId hasPrefix:@"@"]) {
+ windowId = [windowId substringFromIndex:1];
+ [affinities_ setValue:windowGuid equalToValue:windowId];
+ }
}
- (void)hideWindow:(int)windowId

0 comments on commit be4c20f

Please sign in to comment.