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

Add debug logging for undo session closure

parent 9c07746e
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -5342,18 +5342,23 @@ ITERM_WEAKLY_REFERENCEABLE
uniqueId:(int)tabUniqueId
sessions:(NSArray *)sessions
predecessors:(NSArray *)predecessors {
DLog(@"construct session map with sessions: %@\nArrangement:\n%@", sessions, arrangement);
NSDictionary<NSString *, PTYSession *> *sessionMap = [PTYTab sessionMapWithArrangement:arrangement
sessions:sessions];
if (!sessionMap) {
DLog(@"Failed to create a session map");
// Can't do it. Just add each session as its own tab.
for (PTYSession *session in sessions) {
DLog(@"Revive %@", session);
if ([session revive]) {
DLog(@"Succeeded. Add revived session as a tab");
[self addRevivedSession:session];
}
}
return;
}
 
DLog(@"Creating a tab to receive the arrangement");
PTYTab *tab = [PTYTab tabWithArrangement:arrangement
inTerminal:self
hasFlexibleView:NO
Loading
Loading
@@ -5363,6 +5368,7 @@ ITERM_WEAKLY_REFERENCEABLE
tab.uniqueId = tabUniqueId;
for (NSString *theKey in sessionMap) {
PTYSession *session = sessionMap[theKey];
DLog(@"Revive %@", session);
assert([session revive]); // TODO: This isn't guarantted
}
 
Loading
Loading
Loading
Loading
@@ -1799,8 +1799,10 @@ static const NSTimeInterval kOneMonth = 30 * 24 * 60 * 60;
switch (restorableSession.group) {
case kiTermRestorableSessionGroupSession:
// Restore a single session.
DLog(@"Restore a single session");
term = [controller terminalWithGuid:restorableSession.terminalGuid];
if (term) {
DLog(@"resuse an existing window");
// Reuse an existing window
tab = [term tabWithUniqueId:restorableSession.tabUniqueId];
if (tab) {
Loading
Loading
@@ -1815,6 +1817,7 @@ static const NSTimeInterval kOneMonth = 30 * 24 * 60 * 60;
[term addRevivedSession:restorableSession.sessions[0]];
}
} else {
DLog(@"Create a new window");
// Create a new term and add the session to it.
term = [[[PseudoTerminal alloc] initWithSmartLayout:YES
windowType:WINDOW_TYPE_NORMAL
Loading
Loading
@@ -1832,10 +1835,12 @@ static const NSTimeInterval kOneMonth = 30 * 24 * 60 * 60;
 
case kiTermRestorableSessionGroupTab:
// Restore a tab, possibly with multiple sessions in split panes.
DLog(@"Restore a tab, possibly with multiple sessions in split panes");
term = [controller terminalWithGuid:restorableSession.terminalGuid];
BOOL fitTermToTabs = NO;
if (!term) {
// Create a new window
DLog(@"Create a new window");
term = [[[PseudoTerminal alloc] initWithSmartLayout:YES
windowType:WINDOW_TYPE_NORMAL
savedWindowType:WINDOW_TYPE_NORMAL
Loading
Loading
@@ -1845,6 +1850,7 @@ static const NSTimeInterval kOneMonth = 30 * 24 * 60 * 60;
fitTermToTabs = YES;
}
// Add a tab to it.
DLog(@"Add a tab to the window");
[term addTabWithArrangement:restorableSession.arrangement
uniqueId:restorableSession.tabUniqueId
sessions:restorableSession.sessions
Loading
Loading
@@ -1856,6 +1862,7 @@ static const NSTimeInterval kOneMonth = 30 * 24 * 60 * 60;
 
case kiTermRestorableSessionGroupWindow:
// Restore a widow.
DLog(@"Restore a widow");
term = [PseudoTerminal terminalWithArrangement:restorableSession.arrangement
sessions:restorableSession.sessions
forceOpeningHotKeyWindow:YES];
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