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

Adhoc build 3.0.20160813_232251

parent f5190349
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -7067,16 +7067,20 @@ ITERM_WEAKLY_REFERENCEABLE
}
 
- (NSString *)currentLocalWorkingDirectory {
NSLog(@"Begin computing current local working directory");
// Ask the kernel what the child's process's working directory is.
NSString *localDirectoryWithResolvedSymlinks = [_shell getWorkingDirectory];
NSLog(@"PTYTask reports working directory with resolved symlinks of %@", localDirectoryWithResolvedSymlinks);
if (_lastDirectory) {
// See if the last directory from shell integration matches what the kernel reports.
// Normally, _lastDirectory will contain unfollowed symlinks, which we'd prefer to use
// (since it's what the user sees). But there's no way to tell if _lastDirectory refers to
// local path or one on a remote host. If it resolves to the same location as
// localDirectoryWithResolvedSymlinks then it's very likely ok.
NSLog(@"The last directory seen was %@", _lastDirectory);
NSString *resolvedLastDirectory = [_lastDirectory stringByResolvingSymlinksInPath];
NSLog(@"After resolving symlinks, it is %@", resolvedLastDirectory);
if ([resolvedLastDirectory isEqualToString:localDirectoryWithResolvedSymlinks]) {
return _lastDirectory;
}
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