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

Merge branch '3.0.11' of https://github.com/gnachman/iTerm2 into 3.0.11

parents c32059b8 50c3ce18
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -7,6 +7,7 @@
//
 
#import "NSWorkspace+iTerm.h"
#import "DebugLogging.h"
 
@implementation NSWorkspace (iTerm)
 
Loading
Loading
@@ -21,6 +22,7 @@
int fileDescriptor = mkstemps(tempFileNameCString, suffix.length);
 
if (fileDescriptor == -1) {
ELog(@"mkstemps failed with template %s: %s", tempFileNameCString, strerror(errno));
free(tempFileNameCString);
return nil;
}
Loading
Loading
Loading
Loading
@@ -491,6 +491,15 @@ static int MyForkPty(int *amaster,
// Create a temporary filename for the unix domain socket. It'll only exist for a moment.
NSString *tempPath = [[NSWorkspace sharedWorkspace] temporaryFileNameWithPrefix:@"iTerm2-temp-socket."
suffix:@""];
if (tempPath == nil) {
NSRunCriticalAlertPanel(@"Error",
@"An error was encountered while creating a temporary file with mkstemps. Verify that %@ exists and is writable.",
@"OK",
nil,
nil,
NSTemporaryDirectory());
return;
}
 
// Begin listening on that path as a unix domain socket.
int serverSocketFd = iTermFileDescriptorServerSocketBindListen(tempPath.UTF8String);
Loading
Loading
Loading
Loading
@@ -154,5 +154,6 @@
+ (BOOL)showYellowMarkForJobStoppedBySignal;
+ (double)slowFrameRate;
+ (BOOL)useColorfgbgFallback;
+ (BOOL)promptForPasteWhenNotAtPrompt;
 
@end
Loading
Loading
@@ -188,6 +188,7 @@ DEFINE_BOOL(copyWithStylesByDefault, NO, @"Pasteboard: Copy to pasteboard on sel
DEFINE_INT(pasteHistoryMaxOptions, 20, @"Pasteboard: Number of entires to save in Paste History.\n.");
DEFINE_BOOL(disallowCopyEmptyString, NO, @"Pasteboard: Disallow copying empty string to pasteboard.\nIf enabled, selecting an empty string (or all whitespace if trimming is enabled) will not erase the contents of the pasteboard.");
DEFINE_BOOL(typingClearsSelection, YES, @"Pasteboard: Pressing a key will remove the selection.");
DEFINE_BOOL(promptForPasteWhenNotAtPrompt, NO, @"Pasteboard: Warn before pasting when not at shell prompt?");
 
#pragma mark - Tip of the day
 
Loading
Loading
Loading
Loading
@@ -443,7 +443,34 @@ static BOOL hasBecomeActive = NO;
[alert runModal];
}
}
- (void)warnAboutChangeToDefaultPasteBehavior {
static NSString *const kHaveWarnedAboutPasteConfirmationChange = @"NoSyncHaveWarnedAboutPasteConfirmationChange";
if ([[NSUserDefaults standardUserDefaults] boolForKey:kHaveWarnedAboutPasteConfirmationChange]) {
// Safety check that we definitely don't show this twice.
return;
}
NSString *identifier = [iTermAdvancedSettingsModel noSyncDoNotWarnBeforeMultilinePasteUserDefaultsKey];
if ([iTermWarning identifierIsSilenced:identifier]) {
return;
}
NSArray *warningList = @[ @"3.0.0", @"3.0.1", @"3.0.2", @"3.0.3", @"3.0.4", @"3.0.5", @"3.0.6", @"3.0.7", @"3.0.8", @"3.0.9", @"3.0.10" ];
if ([warningList containsObject:[iTermPreferences appVersionBeforeThisLaunch]]) {
[iTermWarning showWarningWithTitle:@"iTerm2 no longer warns before a multi-line paste, unless you are at the shell prompt."
actions:@[ @"OK" ]
accessory:nil
identifier:nil
silenceable:kiTermWarningTypePersistent
heading:@"Important Change"];
}
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kHaveWarnedAboutPasteConfirmationChange];
}
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
[self warnAboutChangeToDefaultPasteBehavior];
if ([self shouldNotifyAboutIncompatibleSoftware]) {
[self notifyAboutIncompatibleSoftware];
}
Loading
Loading
Loading
Loading
@@ -157,7 +157,6 @@ int iTermFileDescriptorServerSocketBindListen(const char *path) {
syslog(LOG_NOTICE, "socket() failed: %s", strerror(errno));
return -1;
}
// Mask off all permissions for group and other. Only user can use this socket.
mode_t oldMask = umask(S_IRWXG | S_IRWXO);
 
Loading
Loading
Loading
Loading
@@ -504,11 +504,13 @@ const int kNumberOfSpacesPerTabNoConversion = -1;
[actions addObject:paste];
[actions addObject:cancel];
NSString *identifier = [iTermAdvancedSettingsModel noSyncDoNotWarnBeforeMultilinePasteUserDefaultsKey];
BOOL prompt = YES;
if (lines.count > 1) {
if (atShellPrompt) {
theTitle = [NSString stringWithFormat:@"OK to paste %d lines at shell prompt?",
(int)[lines count]];
} else {
prompt = [iTermAdvancedSettingsModel promptForPasteWhenNotAtPrompt];
theTitle = [NSString stringWithFormat:@"OK to paste %d lines?",
(int)[lines count]];
}
Loading
Loading
@@ -518,10 +520,14 @@ const int kNumberOfSpacesPerTabNoConversion = -1;
identifier = [iTermAdvancedSettingsModel noSyncDoNotWarnBeforePastingOneLineEndingInNewlineAtShellPromptUserDefaultsKey];
theTitle = @"OK to paste one line ending in a newline at shell prompt?";
} else {
prompt = [iTermAdvancedSettingsModel promptForPasteWhenNotAtPrompt];
theTitle = @"OK to paste one line ending in a newline?";
}
}
if (!prompt) {
return YES;
}
// Issue 5115
[iTermWarning unsilenceIdentifier:identifier ifSelectionEquals:[actions indexOfObjectIdenticalTo:cancel]];
Loading
Loading
Loading
Loading
@@ -151,6 +151,9 @@ extern NSString *const kPreferenceKeyShowFullscreenTabBar;
// settings and update the last-used version number.
+ (void)initializeUserDefaults;
 
// Last app version launched, if any.
+ (NSString *)appVersionBeforeThisLaunch;
+ (void)setObject:(id)object forKey:(NSString *)key;
+ (NSObject *)objectForKey:(NSString *)key;
 
Loading
Loading
Loading
Loading
@@ -98,7 +98,7 @@ NSString *const kPreferenceKeyFocusFollowsMouse = @"FocusFollowsMouse";
NSString *const kPreferenceKeyTripleClickSelectsFullWrappedLines = @"TripleClickSelectsFullWrappedLines";
NSString *const kPreferenceKeyDoubleClickPerformsSmartSelection = @"DoubleClickPerformsSmartSelection";
 
NSString *const kPreferenceKeyAppVersion = @"iTerm Version";
NSString *const kPreferenceKeyAppVersion = @"iTerm Version"; // Excluded from syncing
NSString *const kPreferenceAutoCommandHistory = @"AutoCommandHistory";
 
NSString *const kPreferenceKeyPasteSpecialChunkSize = @"PasteSpecialChunkSize";
Loading
Loading
@@ -120,9 +120,14 @@ NSString *const kPreferenceKeyPasteWarningNumberOfSpacesPerTab = @"PasteTabToStr
NSString *const kPreferenceKeyShowFullscreenTabBar = @"ShowFullScreenTabBar";
 
static NSMutableDictionary *gObservers;
static NSString *sPreviousVersion;
 
@implementation iTermPreferences
 
+ (NSString *)appVersionBeforeThisLaunch {
return sPreviousVersion;
}
+ (void)initializeUserDefaults {
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
 
Loading
Loading
@@ -140,6 +145,7 @@ static NSMutableDictionary *gObservers;
 
// Store the current app version in prefs
NSDictionary *infoDictionary = [[NSBundle bundleForClass:[self class]] infoDictionary];
sPreviousVersion = [[userDefaults objectForKey:kPreferenceKeyAppVersion] copy];
[userDefaults setObject:infoDictionary[@"CFBundleVersion"] forKey:kPreferenceKeyAppVersion];
 
// Disable under-titlebar mirror view.
Loading
Loading
Loading
Loading
@@ -53,6 +53,7 @@ typedef void(^iTermWarningActionBlock)(iTermWarningSelection);
 
// Used to unsilence a particular selection (e.g., when you have a bug and silence the Cancel selection).
+ (void)unsilenceIdentifier:(NSString *)identifier ifSelectionEquals:(iTermWarningSelection)problemSelection;
+ (BOOL)identifierIsSilenced:(NSString *)identifier;
 
// Tests can use this to prevent warning popups.
+ (void)setWarningHandler:(id<iTermWarningHandler>)handler;
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