Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • karan_m/iterm2
  • zhaochangqing/iterm2
  • joykeeper/iterm2
  • nleroux/iterm2
  • kenji21/iterm2
  • gagasegsegsegeg/iterm2
  • stanhu/iterm2
  • ivyfan/iterm2
  • DAddYE/iterm2
  • trave801/iterm2
  • lordrings/iterm2
  • tweekmonster/iterm2
  • imardaras/iterm2
  • DabeDotCom/iterm2
  • sherifamin83/iterm2
  • aquarecif/iterm2
  • visualrobots/iterm2
  • xmarianox/iterm2
  • doomsayer13/iterm2
  • vikdutt/iterm2
  • me36/iterm2
  • DevGrohl/iterm2
  • manigandan-rajasekar/iterm2
  • DWoodiwiss/iterm2
  • vti/iterm2
  • DamonQin/iterm2
26 results
Show changes
Showing
with 68 additions and 127 deletions
Loading
@@ -95,7 +95,8 @@ typedef enum {
Loading
@@ -95,7 +95,8 @@ typedef enum {
VT100CSI_RESET_MODIFIERS, // CSI > Ps n (Set all modifiers values to -1, disabled) VT100CSI_RESET_MODIFIERS, // CSI > Ps n (Set all modifiers values to -1, disabled)
VT100CSI_DECSLRM, // Set left-right margin VT100CSI_DECSLRM, // Set left-right margin
VT100CSI_DECRQCRA, // Request Checksum of Rectangular Area VT100CSI_DECRQCRA, // Request Checksum of Rectangular Area
VT100CSI_REP, // Repeat
// some xterm extensions // some xterm extensions
XTERMCC_WIN_TITLE, // Set window title XTERMCC_WIN_TITLE, // Set window title
XTERMCC_ICON_TITLE, XTERMCC_ICON_TITLE,
Loading
Loading
Loading
@@ -160,6 +160,7 @@ static iTermObjectPool *gPool;
Loading
@@ -160,6 +160,7 @@ static iTermObjectPool *gPool;
@(VT100CSI_DECDSR): @"VT100CSI_DECDSR", @(VT100CSI_DECDSR): @"VT100CSI_DECDSR",
@(VT100CSI_SET_MODIFIERS): @"VT100CSI_SET_MODIFIERS", @(VT100CSI_SET_MODIFIERS): @"VT100CSI_SET_MODIFIERS",
@(VT100CSI_RESET_MODIFIERS): @"VT100CSI_RESET_MODIFIERS", @(VT100CSI_RESET_MODIFIERS): @"VT100CSI_RESET_MODIFIERS",
@(VT100CSI_REP): @"VT100CSI_REP",
@(VT100CSI_DECSLRM): @"VT100CSI_DECSLRM", @(VT100CSI_DECSLRM): @"VT100CSI_DECSLRM",
@(XTERMCC_WIN_TITLE): @"XTERMCC_WIN_TITLE", @(XTERMCC_WIN_TITLE): @"XTERMCC_WIN_TITLE",
@(XTERMCC_ICON_TITLE): @"XTERMCC_ICON_TITLE", @(XTERMCC_ICON_TITLE): @"XTERMCC_ICON_TITLE",
Loading
Loading
Loading
@@ -84,7 +84,7 @@
Loading
@@ -84,7 +84,7 @@
+ (BOOL)optionIsMetaForSpecialChars; + (BOOL)optionIsMetaForSpecialChars;
   
+ (BOOL)startDebugLoggingAutomatically; + (BOOL)startDebugLoggingAutomatically;
+ (BOOL)aboutToPasteTabs; + (BOOL)aboutToPasteTabsWithCancel;
   
+ (BOOL)alwaysAcceptFirstMouse; + (BOOL)alwaysAcceptFirstMouse;
   
Loading
@@ -197,5 +197,6 @@
Loading
@@ -197,5 +197,6 @@
+ (BOOL)sensitiveScrollWheel; + (BOOL)sensitiveScrollWheel;
+ (BOOL)disableCustomBoxDrawing; + (BOOL)disableCustomBoxDrawing;
+ (BOOL)useExperimentalFontMetrics; + (BOOL)useExperimentalFontMetrics;
+ (BOOL)supportREPCode;
   
@end @end
Loading
@@ -236,7 +236,7 @@ DEFINE_BOOL(noSyncSuppressCaptureOutputToolNotVisibleWarning, NO,
Loading
@@ -236,7 +236,7 @@ DEFINE_BOOL(noSyncSuppressCaptureOutputToolNotVisibleWarning, NO,
@"Warnings: Suppress warning that the Captured Output tool is not visible."); @"Warnings: Suppress warning that the Captured Output tool is not visible.");
DEFINE_BOOL(closingTmuxWindowKillsTmuxWindows, NO, @"Warnings: Suppress kill/hide dialog when closing a tmux window."); DEFINE_BOOL(closingTmuxWindowKillsTmuxWindows, NO, @"Warnings: Suppress kill/hide dialog when closing a tmux window.");
DEFINE_BOOL(closingTmuxTabKillsTmuxWindows, NO, @"Warnings: Suppress kill/hide dialog when closing a tmux tab."); DEFINE_BOOL(closingTmuxTabKillsTmuxWindows, NO, @"Warnings: Suppress kill/hide dialog when closing a tmux tab.");
DEFINE_BOOL(aboutToPasteTabs, NO, @"Warnings: Suppress warning about pasting tabs with offer to convert them to spaces."); DEFINE_BOOL(aboutToPasteTabsWithCancel, NO, @"Warnings: Suppress warning about pasting tabs with offer to convert them to spaces.");
DEFINE_FLOAT(shortLivedSessionDuration, 3, @"Warnings: Warn about short-lived sessions that live less than this many seconds."); DEFINE_FLOAT(shortLivedSessionDuration, 3, @"Warnings: Warn about short-lived sessions that live less than this many seconds.");
   
DEFINE_SETTABLE_BOOL(noSyncDoNotWarnBeforeMultilinePaste, NoSyncDoNotWarnBeforeMultilinePaste, NO, @"Warnings: Suppress warning about multi-line pastes (or a single line ending in a newline).\nThis applies whether you are at the shell prompt or not, provided two or more lines are being pasted."); DEFINE_SETTABLE_BOOL(noSyncDoNotWarnBeforeMultilinePaste, NoSyncDoNotWarnBeforeMultilinePaste, NO, @"Warnings: Suppress warning about multi-line pastes (or a single line ending in a newline).\nThis applies whether you are at the shell prompt or not, provided two or more lines are being pasted.");
Loading
@@ -287,5 +287,9 @@ DEFINE_BOOL(killSessionsOnLogout, NO, @"Experimental Features: Kill sessions on
Loading
@@ -287,5 +287,9 @@ DEFINE_BOOL(killSessionsOnLogout, NO, @"Experimental Features: Kill sessions on
DEFINE_BOOL(experimentalKeyHandling, NO, @"General: Improved support for input method editors like AquaSKK."); DEFINE_BOOL(experimentalKeyHandling, NO, @"General: Improved support for input method editors like AquaSKK.");
   
DEFINE_BOOL(useExperimentalFontMetrics, NO, @"Experimental Features: Use a more theoretically correct technique to measure line height.\nYou must restart iTerm2 or adjust a session's font size for this change to take effect."); DEFINE_BOOL(useExperimentalFontMetrics, NO, @"Experimental Features: Use a more theoretically correct technique to measure line height.\nYou must restart iTerm2 or adjust a session's font size for this change to take effect.");
#if BETA
DEFINE_BOOL(supportREPCode, YES, @"Experimental Features: Enable support for REP (Repeat previous character) escape sequence?");
#else
DEFINE_BOOL(supportREPCode, NO, @"Experimental Features: Enable support for REP (Repeat previous character) escape sequence?");
#endif
@end @end
Loading
@@ -6,7 +6,7 @@
Loading
@@ -6,7 +6,7 @@
#import "iTermEventTap.h" #import "iTermEventTap.h"
#import "NSArray+iTerm.h" #import "NSArray+iTerm.h"
   
static const CGEventFlags kCGEventHotKeyModifierMask = (kCGEventFlagMaskAlphaShift | static const CGEventFlags kCGEventHotKeyModifierMask = (kCGEventFlagMaskShift |
kCGEventFlagMaskAlternate | kCGEventFlagMaskAlternate |
kCGEventFlagMaskCommand | kCGEventFlagMaskCommand |
kCGEventFlagMaskControl); kCGEventFlagMaskControl);
Loading
@@ -212,7 +212,7 @@ ITERM_WEAKLY_REFERENCEABLE
Loading
@@ -212,7 +212,7 @@ ITERM_WEAKLY_REFERENCEABLE
   
switch (self.modifierActivation) { switch (self.modifierActivation) {
case iTermHotKeyModifierActivationShift: case iTermHotKeyModifierActivationShift:
return maskedFlags == kCGEventFlagMaskAlphaShift; return maskedFlags == kCGEventFlagMaskShift;
case iTermHotKeyModifierActivationOption: case iTermHotKeyModifierActivationOption:
return maskedFlags == kCGEventFlagMaskAlternate; return maskedFlags == kCGEventFlagMaskAlternate;
Loading
Loading
//
// iTermCallWithTimeout.h
// iTerm2SharedARC
//
// Created by George Nachman on 10/7/17.
//
#import <Foundation/Foundation.h>
@interface iTermCallWithTimeout : NSObject
+ (instancetype)instanceForIdentifier:(NSString *)identifier;
- (BOOL)executeWithTimeout:(NSTimeInterval)timeout
block:(void (^)(void))block;
@end
//
// iTermCallWithTimeout.m
// iTerm2SharedARC
//
// Created by George Nachman on 10/7/17.
//
#import "iTermCallWithTimeout.h"
@implementation iTermCallWithTimeout {
dispatch_queue_t _queue;
}
+ (instancetype)instanceForIdentifier:(NSString *)identifier {
static NSMutableDictionary *objects;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
objects = [NSMutableDictionary dictionary];
});
iTermCallWithTimeout *object = objects[identifier];
if (object == nil) {
object = [[self alloc] initWithIdentifier:identifier];
objects[identifier] = object;
}
return object;
}
- (instancetype)initWithIdentifier:(NSString *)identifier {
self = [super init];
if (self) {
_queue = dispatch_queue_create([[NSString stringWithFormat:@"com.iterm2.timeoutcall.%@", identifier] UTF8String],
NULL);
}
return self;
}
- (BOOL)executeWithTimeout:(NSTimeInterval)timeout block:(void (^)(void))block {
dispatch_group_t group = dispatch_group_create();
dispatch_group_enter(group);
dispatch_async(_queue, ^{
block();
dispatch_group_leave(group);
});
// Wait up to half a second for the statfs to finish.
long timedOut = dispatch_group_wait(group,
dispatch_time(DISPATCH_TIME_NOW, (int64_t)(timeout * NSEC_PER_SEC)));
return !!timedOut;
}
@end
Loading
@@ -368,16 +368,24 @@ static iTermController *gSharedInstance;
Loading
@@ -368,16 +368,24 @@ static iTermController *gSharedInstance;
NSMutableArray *terminalArrangements = [NSMutableArray arrayWithCapacity:[_terminalWindows count]]; NSMutableArray *terminalArrangements = [NSMutableArray arrayWithCapacity:[_terminalWindows count]];
if (allWindows) { if (allWindows) {
for (PseudoTerminal *terminal in _terminalWindows) { for (PseudoTerminal *terminal in _terminalWindows) {
[terminalArrangements addObject:[terminal arrangement]]; NSDictionary *arrangement = [terminal arrangement];
if (arrangement) {
[terminalArrangements addObject:arrangement];
}
} }
} else { } else {
PseudoTerminal *currentTerminal = [self currentTerminal]; PseudoTerminal *currentTerminal = [self currentTerminal];
if (!currentTerminal) { if (!currentTerminal) {
return; return;
} }
[terminalArrangements addObject:[currentTerminal arrangement]]; NSDictionary *arrangement = [currentTerminal arrangement];
if (arrangement) {
[terminalArrangements addObject:arrangement];
}
}
if (terminalArrangements.count) {
[WindowArrangements setArrangement:terminalArrangements withName:name];
} }
[WindowArrangements setArrangement:terminalArrangements withName:name];
} }
   
- (void)tryOpenArrangement:(NSDictionary *)terminalArrangement { - (void)tryOpenArrangement:(NSDictionary *)terminalArrangement {
Loading
Loading
Loading
@@ -8,7 +8,6 @@
Loading
@@ -8,7 +8,6 @@
   
#import "iTermLSOF.h" #import "iTermLSOF.h"
   
#import "iTermCallWithTimeout.h"
#import "iTermSocketAddress.h" #import "iTermSocketAddress.h"
#import "ProcessCache.h" #import "ProcessCache.h"
#include <arpa/inet.h> #include <arpa/inet.h>
Loading
@@ -19,11 +18,7 @@
Loading
@@ -19,11 +18,7 @@
#include <sys/sysctl.h> #include <sys/sysctl.h>
   
int iTermProcPidInfoWrapper(int pid, int flavor, uint64_t arg, void *buffer, int buffersize) { int iTermProcPidInfoWrapper(int pid, int flavor, uint64_t arg, void *buffer, int buffersize) {
__block int result; return proc_pidinfo(pid, flavor, arg, buffer, buffersize);
BOOL timeout = [[iTermCallWithTimeout instanceForIdentifier:@"pidinfo"] executeWithTimeout:0.5 block:^{
result = proc_pidinfo(pid, flavor, arg, buffer, buffersize);
}];
return timeout ? -1 : result;
} }
   
@implementation iTermLSOF { @implementation iTermLSOF {
Loading
Loading
Loading
@@ -37,6 +37,7 @@ static BOOL sAuthenticated;
Loading
@@ -37,6 +37,7 @@ static BOOL sAuthenticated;
NSArray *_accounts; NSArray *_accounts;
NSString *_passwordBeingShown; NSString *_passwordBeingShown;
NSInteger _rowForPasswordBeingShown; NSInteger _rowForPasswordBeingShown;
NSString *_accountNameToSelectAfterAuthentication;
} }
   
+ (NSArray *)accountNamesWithFilter:(NSString *)filter { + (NSArray *)accountNamesWithFilter:(NSString *)filter {
Loading
@@ -153,6 +154,7 @@ static BOOL sAuthenticated;
Loading
@@ -153,6 +154,7 @@ static BOOL sAuthenticated;
   
- (void)dealloc { - (void)dealloc {
[_accounts release]; [_accounts release];
[_accountNameToSelectAfterAuthentication release];
[[NSNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc]; [super dealloc];
} }
Loading
@@ -190,6 +192,9 @@ static BOOL sAuthenticated;
Loading
@@ -190,6 +192,9 @@ static BOOL sAuthenticated;
if (index != NSNotFound) { if (index != NSNotFound) {
[_tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:index] [_tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:index]
byExtendingSelection:NO]; byExtendingSelection:NO];
} else if (!sAuthenticated) {
[_accountNameToSelectAfterAuthentication autorelease];
_accountNameToSelectAfterAuthentication = [name copy];
} }
} }
   
Loading
@@ -231,6 +236,7 @@ static BOOL sAuthenticated;
Loading
@@ -231,6 +236,7 @@ static BOOL sAuthenticated;
if (sAuthenticated) { if (sAuthenticated) {
NSInteger selectedRow = [_tableView selectedRow]; NSInteger selectedRow = [_tableView selectedRow];
NSString *selectedAccountName = [self accountNameForRow:selectedRow]; NSString *selectedAccountName = [self accountNameForRow:selectedRow];
[_tableView reloadData];
[[self keychain] deletePasswordForService:kServiceName account:selectedAccountName]; [[self keychain] deletePasswordForService:kServiceName account:selectedAccountName];
[self reloadAccounts]; [self reloadAccounts];
[self passwordsDidChange]; [self passwordsDidChange];
Loading
@@ -351,7 +357,13 @@ static BOOL sAuthenticated;
Loading
@@ -351,7 +357,13 @@ static BOOL sAuthenticated;
   
if (success) { if (success) {
[self reloadAccounts]; [self reloadAccounts];
[[self window] makeFirstResponder:_searchField]; if (_accountNameToSelectAfterAuthentication) {
[self selectAccountName:_accountNameToSelectAfterAuthentication];
[_accountNameToSelectAfterAuthentication release];
_accountNameToSelectAfterAuthentication = nil;
} else {
[[self window] makeFirstResponder:_searchField];
}
} else { } else {
[self closeOrEndSheet]; [self closeOrEndSheet];
} }
Loading
@@ -458,6 +470,9 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn
Loading
@@ -458,6 +470,9 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn
if (!sAuthenticated) { if (!sAuthenticated) {
return; return;
} }
if (rowIndex < 0 || rowIndex >= _accounts.count) {
ITCriticalError(NO, @"Row index %@ out of bounds [0, %@)", @(rowIndex), @(_accounts.count));
}
NSString *accountName = [self accountNameForRow:rowIndex]; NSString *accountName = [self accountNameForRow:rowIndex];
if (aTableColumn == _accountNameColumn) { if (aTableColumn == _accountNameColumn) {
NSError *error = nil; NSError *error = nil;
Loading
Loading
Loading
@@ -48,8 +48,7 @@ extern NSString *const kSemanticHistoryWorkingDirectorySubstitutionKey;
Loading
@@ -48,8 +48,7 @@ extern NSString *const kSemanticHistoryWorkingDirectorySubstitutionKey;
- (NSString *)getFullPath:(NSString *)path - (NSString *)getFullPath:(NSString *)path
workingDirectory:(NSString *)workingDirectory workingDirectory:(NSString *)workingDirectory
lineNumber:(NSString **)lineNumber lineNumber:(NSString **)lineNumber
columnNumber:(NSString **)columnNumber columnNumber:(NSString **)columnNumber;
timedOut:(BOOL *)timedOut;
   
// Opens the file at the relative |path| (which may include :lineNumber) in |workingDirectory|. // Opens the file at the relative |path| (which may include :lineNumber) in |workingDirectory|.
// The |substitutions| dictionary is used to expand \references in the command to run (gotten from // The |substitutions| dictionary is used to expand \references in the command to run (gotten from
Loading
Loading
Loading
@@ -43,10 +43,9 @@ NSString *const kSemanticHistoryWorkingDirectorySubstitutionKey = @"semanticHist
Loading
@@ -43,10 +43,9 @@ NSString *const kSemanticHistoryWorkingDirectorySubstitutionKey = @"semanticHist
@synthesize prefs = prefs_; @synthesize prefs = prefs_;
@synthesize delegate = delegate_; @synthesize delegate = delegate_;
   
- (BOOL)fileExistsAtPathLocally:(NSString *)path timedOut:(BOOL *)timedOut { - (BOOL)fileExistsAtPathLocally:(NSString *)path {
return [self.fileManager fileExistsAtPathLocally:path return [self.fileManager fileExistsAtPathLocally:path
additionalNetworkPaths:[[iTermAdvancedSettingsModel pathsToIgnore] componentsSeparatedByString:@","] additionalNetworkPaths:[[iTermAdvancedSettingsModel pathsToIgnore] componentsSeparatedByString:@","]];
timedOut:timedOut];
} }
   
- (BOOL)fileHasForbiddenPrefix:(NSString *)path { - (BOOL)fileHasForbiddenPrefix:(NSString *)path {
Loading
@@ -57,10 +56,8 @@ NSString *const kSemanticHistoryWorkingDirectorySubstitutionKey = @"semanticHist
Loading
@@ -57,10 +56,8 @@ NSString *const kSemanticHistoryWorkingDirectorySubstitutionKey = @"semanticHist
- (NSString *)getFullPath:(NSString *)path - (NSString *)getFullPath:(NSString *)path
workingDirectory:(NSString *)workingDirectory workingDirectory:(NSString *)workingDirectory
lineNumber:(NSString **)lineNumber lineNumber:(NSString **)lineNumber
columnNumber:(NSString **)columnNumber columnNumber:(NSString **)columnNumber {
timedOut:(BOOL *)timedOut {
DLog(@"Check if %@ is a valid path in %@", path, workingDirectory); DLog(@"Check if %@ is a valid path in %@", path, workingDirectory);
*timedOut = NO;
NSString *origPath = path; NSString *origPath = path;
// TODO(chendo): Move regex, define capture semantics in config file/prefs // TODO(chendo): Move regex, define capture semantics in config file/prefs
if (!path || [path length] == 0) { if (!path || [path length] == 0) {
Loading
@@ -107,7 +104,7 @@ NSString *const kSemanticHistoryWorkingDirectorySubstitutionKey = @"semanticHist
Loading
@@ -107,7 +104,7 @@ NSString *const kSemanticHistoryWorkingDirectorySubstitutionKey = @"semanticHist
// be stat()ed, although they were always stat()ed because of unintentional // be stat()ed, although they were always stat()ed because of unintentional
// disk access in the old code. // disk access in the old code.
   
if ([self fileExistsAtPathLocally:path timedOut:timedOut]) { if ([self fileExistsAtPathLocally:path]) {
DLog(@" YES: A file exists at %@", path); DLog(@" YES: A file exists at %@", path);
NSURL *url = [NSURL fileURLWithPath:path]; NSURL *url = [NSURL fileURLWithPath:path];
   
Loading
@@ -120,11 +117,7 @@ NSString *const kSemanticHistoryWorkingDirectorySubstitutionKey = @"semanticHist
Loading
@@ -120,11 +117,7 @@ NSString *const kSemanticHistoryWorkingDirectorySubstitutionKey = @"semanticHist
return nil; return nil;
} }
return path; return path;
} else if (*timedOut) {
DLog(@" NO: timed out");
return nil;
} }
// If path doesn't exist and it starts with "a/" or "b/" (from `diff`). // If path doesn't exist and it starts with "a/" or "b/" (from `diff`).
if ([origPath isMatchedByRegex:@"^[ab]/"]) { if ([origPath isMatchedByRegex:@"^[ab]/"]) {
DLog(@" Treating as diff path"); DLog(@" Treating as diff path");
Loading
@@ -136,8 +129,7 @@ NSString *const kSemanticHistoryWorkingDirectorySubstitutionKey = @"semanticHist
Loading
@@ -136,8 +129,7 @@ NSString *const kSemanticHistoryWorkingDirectorySubstitutionKey = @"semanticHist
return [self getFullPath:origPath return [self getFullPath:origPath
workingDirectory:workingDirectory workingDirectory:workingDirectory
lineNumber:lineNumber lineNumber:lineNumber
columnNumber:columnNumber columnNumber:columnNumber];
timedOut:timedOut];
} }
   
DLog(@" NO: no valid path found"); DLog(@" NO: no valid path found");
Loading
@@ -338,11 +330,9 @@ NSString *const kSemanticHistoryWorkingDirectorySubstitutionKey = @"semanticHist
Loading
@@ -338,11 +330,9 @@ NSString *const kSemanticHistoryWorkingDirectorySubstitutionKey = @"semanticHist
   
BOOL isRawAction = [prefs_[kSemanticHistoryActionKey] isEqualToString:kSemanticHistoryRawCommandAction]; BOOL isRawAction = [prefs_[kSemanticHistoryActionKey] isEqualToString:kSemanticHistoryRawCommandAction];
if (!isRawAction) { if (!isRawAction) {
BOOL timedOut;
path = [self getFullPath:path workingDirectory:workingDirectory path = [self getFullPath:path workingDirectory:workingDirectory
lineNumber:&lineNumber lineNumber:&lineNumber
columnNumber:&columnNumber columnNumber:&columnNumber];
timedOut:&timedOut];
DLog(@"Not a raw action. New path is %@, line number is %@", path, lineNumber); DLog(@"Not a raw action. New path is %@, line number is %@", path, lineNumber);
} }
   
Loading
@@ -455,8 +445,7 @@ NSString *const kSemanticHistoryWorkingDirectorySubstitutionKey = @"semanticHist
Loading
@@ -455,8 +445,7 @@ NSString *const kSemanticHistoryWorkingDirectorySubstitutionKey = @"semanticHist
charsTakenFromPrefix:(int *)charsTakenFromPrefixPtr charsTakenFromPrefix:(int *)charsTakenFromPrefixPtr
charsTakenFromSuffix:(int *)suffixChars charsTakenFromSuffix:(int *)suffixChars
trimWhitespace:(BOOL)trimWhitespace { trimWhitespace:(BOOL)trimWhitespace {
BOOL timedOut; BOOL workingDirectoryIsOk = [self fileExistsAtPathLocally:workingDirectory];
BOOL workingDirectoryIsOk = [self fileExistsAtPathLocally:workingDirectory timedOut:&timedOut];
if (!workingDirectoryIsOk) { if (!workingDirectoryIsOk) {
DLog(@"Working directory %@ is a network share or doesn't exist. Not using it for context.", DLog(@"Working directory %@ is a network share or doesn't exist. Not using it for context.",
workingDirectory); workingDirectory);
Loading
@@ -519,16 +508,10 @@ NSString *const kSemanticHistoryWorkingDirectorySubstitutionKey = @"semanticHist
Loading
@@ -519,16 +508,10 @@ NSString *const kSemanticHistoryWorkingDirectorySubstitutionKey = @"semanticHist
for (NSString *modifiedPossiblePath in [self pathsFromPath:trimmedPath byRemovingBadSuffixes:questionableSuffixes]) { for (NSString *modifiedPossiblePath in [self pathsFromPath:trimmedPath byRemovingBadSuffixes:questionableSuffixes]) {
BOOL exists = NO; BOOL exists = NO;
if (workingDirectoryIsOk || [modifiedPossiblePath hasPrefix:@"/"]) { if (workingDirectoryIsOk || [modifiedPossiblePath hasPrefix:@"/"]) {
BOOL timedOut = NO;
exists = ([self getFullPath:modifiedPossiblePath exists = ([self getFullPath:modifiedPossiblePath
workingDirectory:workingDirectory workingDirectory:workingDirectory
lineNumber:NULL lineNumber:NULL
columnNumber:NULL columnNumber:NULL] != nil);
timedOut:&timedOut] != nil);
if (timedOut) {
DLog(@"Timed out checking path %@ in %@", modifiedPossiblePath, workingDirectory);
return nil;
}
} }
if (exists) { if (exists) {
if (charsTakenFromPrefixPtr) { if (charsTakenFromPrefixPtr) {
Loading
Loading
Loading
@@ -198,7 +198,8 @@ static const NSTimeInterval kMaxTimeToRememberDirectories = 60 * 60 * 24 * 90;
Loading
@@ -198,7 +198,8 @@ static const NSTimeInterval kMaxTimeToRememberDirectories = 60 * 60 * 24 * 90;
storeType = NSInMemoryStoreType; storeType = NSInMemoryStoreType;
} }
   
NSDictionary *options = @{}; NSDictionary *options = @{ NSInferMappingModelAutomaticallyOption: @YES,
NSMigratePersistentStoresAutomaticallyOption: @YES };
if (vacuum) { if (vacuum) {
options = @{ NSSQLiteManualVacuumOption: @YES }; options = @{ NSSQLiteManualVacuumOption: @YES };
} }
Loading
Loading
Loading
@@ -1457,19 +1457,19 @@ typedef struct iTermTextColorContext {
Loading
@@ -1457,19 +1457,19 @@ typedef struct iTermTextColorContext {
atPoint:(NSPoint)origin atPoint:(NSPoint)origin
positions:(CGFloat *)stringPositions positions:(CGFloat *)stringPositions
backgroundColor:(NSColor *)backgroundColor { backgroundColor:(NSColor *)backgroundColor {
NSGraphicsContext *graphicsContet = [NSGraphicsContext currentContext]; NSGraphicsContext *graphicsContext = [NSGraphicsContext currentContext];
[self drawTextOnlyAttributedStringWithoutUnderline:attributedString [self drawTextOnlyAttributedStringWithoutUnderline:attributedString
atPoint:origin atPoint:origin
positions:stringPositions positions:stringPositions
backgroundColor:backgroundColor backgroundColor:backgroundColor
graphicsContext:graphicsContet graphicsContext:graphicsContext
smear:NO]; smear:NO];
   
__block CGContextRef maskGraphicsContext = nil; __block CGContextRef maskGraphicsContext = nil;
__block CGImageRef alphaMask = nil; __block CGImageRef alphaMask = nil;
NSDictionary *maskingAttributes = @{ (NSString *)kCTForegroundColorAttributeName: (id)[[NSColor colorWithSRGBRed:0 green:0 blue:0 alpha:1] CGColor] }; NSDictionary *maskingAttributes = @{ (NSString *)kCTForegroundColorAttributeName: (id)[[NSColor colorWithSRGBRed:0 green:0 blue:0 alpha:1] CGColor] };
CGContextRef cgContext = (CGContextRef) [graphicsContet graphicsPort]; CGContextRef cgContext = (CGContextRef) [graphicsContext graphicsPort];
   
[attributedString enumerateAttribute:NSUnderlineStyleAttributeName [attributedString enumerateAttribute:NSUnderlineStyleAttributeName
inRange:NSMakeRange(0, attributedString.length) inRange:NSMakeRange(0, attributedString.length)
Loading
Loading
Loading
@@ -196,12 +196,10 @@
Loading
@@ -196,12 +196,10 @@
range.columnWindow = extractor.logicalWindow; range.columnWindow = extractor.logicalWindow;
action.range = range; action.range = range;
   
BOOL timedOut;
action.fullPath = [semanticHistoryController getFullPath:filename action.fullPath = [semanticHistoryController getFullPath:filename
workingDirectory:workingDirectory workingDirectory:workingDirectory
lineNumber:NULL lineNumber:NULL
columnNumber:NULL columnNumber:NULL];
timedOut:&timedOut];
action.workingDirectory = workingDirectory; action.workingDirectory = workingDirectory;
return action; return action;
} }
Loading
Loading
Loading
@@ -358,7 +358,7 @@ class DECSETTests(object):
Loading
@@ -358,7 +358,7 @@ class DECSETTests(object):
escio.Write(BS) escio.Write(BS)
AssertEQ(GetCursorPosition().x(), 1) AssertEQ(GetCursorPosition().x(), 1)
   
def doAltBuftest(self, code, altGetsClearedBeforeToMain, cursorSaved): def doAltBuftest(self, code, altGetsClearedBeforeToMain, cursorSaved, movesCursorOnEnter=False):
"""|code| is the code to test with, either 47 or 1047.""" """|code| is the code to test with, either 47 or 1047."""
# Scribble in main screen # Scribble in main screen
escio.Write("abc" + CR + LF + "abc") escio.Write("abc" + CR + LF + "abc")
Loading
@@ -371,8 +371,10 @@ class DECSETTests(object):
Loading
@@ -371,8 +371,10 @@ class DECSETTests(object):
before = GetCursorPosition() before = GetCursorPosition()
esccmd.DECSET(code) esccmd.DECSET(code)
after = GetCursorPosition() after = GetCursorPosition()
AssertEQ(before.x(), after.x()) if not movesCursorOnEnter:
AssertEQ(before.y(), after.y()) # 1049 moves the cursor on enter
AssertEQ(before.x(), after.x())
AssertEQ(before.y(), after.y())
   
# Scribble in alt screen, clearing it first since who knows what might have # Scribble in alt screen, clearing it first since who knows what might have
# been there. # been there.
Loading
@@ -401,8 +403,10 @@ class DECSETTests(object):
Loading
@@ -401,8 +403,10 @@ class DECSETTests(object):
before = GetCursorPosition() before = GetCursorPosition()
esccmd.DECSET(code) esccmd.DECSET(code)
after = GetCursorPosition() after = GetCursorPosition()
AssertEQ(before.x(), after.x()) if not movesCursorOnEnter:
AssertEQ(before.y(), after.y()) # 1049 moves the cursor on enter
AssertEQ(before.x(), after.x())
AssertEQ(before.y(), after.y())
   
if altGetsClearedBeforeToMain: if altGetsClearedBeforeToMain:
AssertScreenCharsInRectEqual(Rect(1, 1, 3, 3), [ NUL * 3, NUL * 3, NUL * 3 ]) AssertScreenCharsInRectEqual(Rect(1, 1, 3, 3), [ NUL * 3, NUL * 3, NUL * 3 ])
Loading
@@ -429,7 +433,7 @@ class DECSETTests(object):
Loading
@@ -429,7 +433,7 @@ class DECSETTests(object):
def test_DECSET_OPT_ALTBUF_CURSOR(self): def test_DECSET_OPT_ALTBUF_CURSOR(self):
"""DECSET 1049 is like 1047 but it also saves the cursor position before """DECSET 1049 is like 1047 but it also saves the cursor position before
entering alt and restores it after returning to main.""" entering alt and restores it after returning to main."""
self.doAltBuftest(esccmd.OPT_ALTBUF_CURSOR, True, True) self.doAltBuftest(esccmd.OPT_ALTBUF_CURSOR, True, True, True)
   
# xterm doesn't implement auto-wrap mode when wide characters are disabled. # xterm doesn't implement auto-wrap mode when wide characters are disabled.
@optionRejects(terminal="xterm", option=escargs.DISABLE_WIDE_CHARS) @optionRejects(terminal="xterm", option=escargs.DISABLE_WIDE_CHARS)
Loading
Loading
Loading
@@ -86,7 +86,7 @@ SVNDIR=~/iterm2-website
Loading
@@ -86,7 +86,7 @@ SVNDIR=~/iterm2-website
ORIG_DIR=`pwd` ORIG_DIR=`pwd`
   
   
echo "Build deployment release" echo "Build beta release"
make clean make clean
make Beta make Beta
   
Loading
Loading
3.1.%(extra)s 3.1.5.beta.2