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

Merge branch 'master' of github.com:gnachman/iTerm2

parents 10feda0c 9848f35e
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -261,12 +261,12 @@ static NSString* SESSION_ARRANGEMENT_WORKING_DIRECTORY = @"Working Directory";
 
[aSession setPreferencesFromAddressBookEntry:theBookmark];
[[aSession SCREEN] setDisplay:[aSession TEXTVIEW]];
[aSession runCommandWithOldCwd:[arrangement objectForKey:SESSION_ARRANGEMENT_WORKING_DIRECTORY]];
[aSession setName:[theBookmark objectForKey:KEY_NAME]];
if ([[[[theTab realParentWindow] window] title] compare:@"Window"] == NSOrderedSame) {
[[theTab realParentWindow] setWindowTitle];
}
[aSession setTab:theTab];
[aSession runCommandWithOldCwd:[arrangement objectForKey:SESSION_ARRANGEMENT_WORKING_DIRECTORY]];
 
if (needDivorce) {
[aSession divorceAddressBookEntryFromPreferences];
Loading
Loading
@@ -495,8 +495,8 @@ static NSString* SESSION_ARRANGEMENT_WORKING_DIRECTORY = @"Working Directory";
PseudoTerminal *pty = [tab_ realParentWindow];
NSString *itermId = [NSString stringWithFormat:@"w%dt%dp%d",
[pty number],
[tab_ objectCount] - 1,
[tab_ indexOfSession:self]];
[tab_ realObjectCount] - 1,
[tab_ indexOfSessionView:[self view]]];
[env setObject:itermId forKey:@"ITERM_SESSION_ID"];
 
[SHELL launchWithPath:path
Loading
Loading
Loading
Loading
@@ -104,7 +104,7 @@ static const int MIN_SESSION_COLUMNS = 2;
- (void)setTabViewItem:(NSTabViewItem *)theTabViewItem;
- (void)previousSession;
- (void)nextSession;
- (int)indexOfSession:(PTYSession*)session;
- (int)indexOfSessionView:(SessionView*)sessionView;
 
- (void)setLockedSession:(PTYSession*)lockedSession;
- (PTYSession*)activeSession;
Loading
Loading
Loading
Loading
@@ -404,9 +404,9 @@ static const BOOL USE_THIN_SPLITTERS = YES;
}
}
 
- (int)indexOfSession:(PTYSession*)session
- (int)indexOfSessionView:(SessionView*)sessionView
{
return [[self sessions] indexOfObject:session];
return [[self sessionViews] indexOfObject:sessionView];
}
 
- (id<WindowControllerInterface>)parentWindow
Loading
Loading
@@ -710,6 +710,22 @@ static NSString* FormatRect(NSRect r) {
return sessions;
}
 
- (NSArray*)_recursiveSessionViews:(NSMutableArray*)sessionViews
atNode:(NSSplitView*)node
{
for (id subview in [node subviews]) {
if ([subview isKindOfClass:[NSSplitView class]]) {
[self _recursiveSessions:sessionViews atNode:(NSSplitView*)subview];
} else {
SessionView* sessionView = (SessionView*)subview;
if (sessionView) {
[sessionViews addObject:sessionView];
}
}
}
return sessionViews;
}
- (NSArray*)sessions
{
if (idMap_) {
Loading
Loading
@@ -724,6 +740,20 @@ static NSString* FormatRect(NSRect r) {
}
}
 
- (NSArray*)sessionViews
{
if (idMap_) {
NSArray* sessionViews = [idMap_ allValues];
NSMutableArray* result = [NSMutableArray arrayWithCapacity:[sessionViews count]];
for (SessionView* sessionView in sessionViews) {
[result addObject:sessionView];
}
return result;
} else {
return [self _recursiveSessionViews:[NSMutableArray arrayWithCapacity:1] atNode:root_];
}
}
- (BOOL)allSessionsExited
{
return [[self activeSession] exited];
Loading
Loading
@@ -1738,6 +1768,8 @@ static NSString* FormatRect(NSRect r) {
[theTab->tabViewItem_ setLabel:@"Restoring..."];
[newRoot release];
 
[theTab setObjectCount:[term numberOfTabs] + 1];
// Instantiate sessions in the skeleton view tree.
[theTab setActiveSession:[theTab _recursiveRestoreSessions:[arrangement objectForKey:TAB_ARRANGEMENT_ROOT]
atNode:theTab->root_
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