Skip to content
Snippets Groups Projects
Commit 90d05674 authored by Tom Feist's avatar Tom Feist
Browse files

merged upstream/master, but using my (shabble/dev) xodeproj files due to reorganisation

parents 260f10b6 8693b16e
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -226,6 +226,7 @@ typedef enum { IsDefault = 1, IsNotDefault = 2 } BookmarkRowIsDefault;
for (BookmarkRow* theRow in bookmarks) {
[underlyingModel moveGuid:[theRow guid] toRow:i++];
}
[underlyingModel rebuildMenus];
}
 
- (NSArray*)sortDescriptors
Loading
Loading
@@ -342,7 +343,9 @@ typedef enum { IsDefault = 1, IsNotDefault = 2 } BookmarkRowIsDefault;
 
// The underlying model doesn't post a change notification for each bookmark
// move because it would be overwhelming so we must do it ourselves. This
// makes all other table views sync with the new order.
// makes all other table views sync with the new order. First, add commands
// to rebuild the menus.
[[dataSource_ underlyingModel] rebuildMenus];
[[dataSource_ underlyingModel] postChangeNotification];
 
NSMutableIndexSet* newIndexes = [[[NSMutableIndexSet alloc] init] autorelease];
Loading
Loading
@@ -525,6 +528,8 @@ typedef enum { IsDefault = 1, IsNotDefault = 2 } BookmarkRowIsDefault;
{
[dataSource_ setSortDescriptors:[aTableView sortDescriptors]];
[dataSource_ sort];
[dataSource_ pushOrderToUnderlyingModel];
[[dataSource_ underlyingModel] postChangeNotification];
 
// Update the sort indicator image for all columns.
NSArray* sortDescriptors = [dataSource_ sortDescriptors];
Loading
Loading
Loading
Loading
@@ -75,12 +75,13 @@ typedef struct {
- (Bookmark*)setObject:(id)object forKey:(NSString*)key inBookmark:(Bookmark*)bookmark;
- (void)setDefaultByGuid:(NSString*)guid;
- (void)moveGuid:(NSString*)guid toRow:(int)row;
- (void)rebuildMenus;
// Return the absolute index of a bookmark given its index with the filter applied.
- (int)convertFilteredIndex:(int)theIndex withFilter:(NSString*)filter;
- (void)dump;
- (NSArray*)bookmarks;
- (NSArray*)guids;
- (void)addBookmark:(Bookmark*)b toMenu:(NSMenu*)menu startingAtItem:(int)skip withTags:(NSArray*)tags params:(JournalParams*)params;
- (void)addBookmark:(Bookmark*)b toMenu:(NSMenu*)menu startingAtItem:(int)skip withTags:(NSArray*)tags params:(JournalParams*)params atPos:(int)pos;
 
// Tell all listeners that the model has changed.
- (void)postChangeNotification;
Loading
Loading
@@ -110,6 +111,7 @@ typedef enum {
BookmarkModel* model;
// Tags before the action was applied.
NSArray* tags;
int index; // Index of bookmark
}
 
+ (BookmarkJournalEntry*)journalWithAction:(JournalAction)action
Loading
Loading
Loading
Loading
@@ -211,6 +211,7 @@ id gAltOpenAllRepresentedObject;
 
bookmark = [[newBookmark copy] autorelease];
 
int theIndex;
if (sort) {
// Insert alphabetically. Sort so that objects with the "bonjour" tag come after objects without.
int insertionPoint = -1;
Loading
Loading
@@ -236,17 +237,22 @@ id gAltOpenAllRepresentedObject;
}
}
if (insertionPoint == -1) {
theIndex = [bookmarks_ count];
[bookmarks_ addObject:[NSDictionary dictionaryWithDictionary:bookmark]];
} else {
theIndex = insertionPoint;
[bookmarks_ insertObject:[NSDictionary dictionaryWithDictionary:bookmark] atIndex:insertionPoint];
}
} else {
theIndex = [bookmarks_ count];
[bookmarks_ addObject:[NSDictionary dictionaryWithDictionary:bookmark]];
}
NSString* isDeprecatedDefaultBookmark = [bookmark objectForKey:KEY_DEFAULT_BOOKMARK];
 
// The call to setDefaultByGuid may add a journal entry so make sure this one comes first.
[journal_ addObject:[BookmarkJournalEntry journalWithAction:JOURNAL_ADD bookmark:bookmark model:self]];
BookmarkJournalEntry* e = [BookmarkJournalEntry journalWithAction:JOURNAL_ADD bookmark:bookmark model:self];
e->index = theIndex;
[journal_ addObject:e];
 
if (![self defaultBookmark] || (isDeprecatedDefaultBookmark && [isDeprecatedDefaultBookmark isEqualToString:@"Yes"])) {
[self setDefaultByGuid:[bookmark objectForKey:KEY_GUID]];
Loading
Loading
@@ -319,10 +325,14 @@ id gAltOpenAllRepresentedObject;
// A change in bookmarks is journal-worthy only if the name, shortcut, tags, or guid changes.
- (BOOL)bookmark:(Bookmark*)a differsJournalablyFrom:(Bookmark*)b
{
// Any field that is shown in a view (profiles window, menus, bookmark list views, etc.) must
// be a criteria for journalability for it to be updated immediately.
if (![[a objectForKey:KEY_NAME] isEqualToString:[b objectForKey:KEY_NAME]] ||
![[a objectForKey:KEY_SHORTCUT] isEqualToString:[b objectForKey:KEY_SHORTCUT]] ||
![[a objectForKey:KEY_TAGS] isEqualToArray:[b objectForKey:KEY_TAGS]] ||
![[a objectForKey:KEY_GUID] isEqualToString:[b objectForKey:KEY_GUID]]) {
![[a objectForKey:KEY_GUID] isEqualToString:[b objectForKey:KEY_GUID]] ||
![[a objectForKey:KEY_COMMAND] isEqualToString:[b objectForKey:KEY_COMMAND]] ||
![[a objectForKey:KEY_CUSTOM_COMMAND] isEqualToString:[b objectForKey:KEY_CUSTOM_COMMAND]]) {
return YES;
} else {
return NO;
Loading
Loading
@@ -344,12 +354,16 @@ id gAltOpenAllRepresentedObject;
}
[bookmarks_ replaceObjectAtIndex:i withObject:bookmark];
if (needJournal) {
[journal_ addObject:[BookmarkJournalEntry journalWithAction:JOURNAL_ADD bookmark:bookmark model:self]];
BookmarkJournalEntry* e = [BookmarkJournalEntry journalWithAction:JOURNAL_ADD bookmark:bookmark model:self];
e->index = i;
[journal_ addObject:e];
}
if (isDefault) {
[self setDefaultByGuid:[bookmark objectForKey:KEY_GUID]];
}
[self postChangeNotification];
if (needJournal) {
[self postChangeNotification];
}
}
 
- (void)setBookmark:(Bookmark*)bookmark withGuid:(NSString*)guid
Loading
Loading
@@ -514,6 +528,18 @@ id gAltOpenAllRepresentedObject;
[bookmark release];
}
 
- (void)rebuildMenus
{
[journal_ addObject:[BookmarkJournalEntry journalWithAction:JOURNAL_REMOVE_ALL bookmark:nil model:self]];
int i = 0;
for (Bookmark* b in bookmarks_) {
BookmarkJournalEntry* e = [BookmarkJournalEntry journalWithAction:JOURNAL_ADD bookmark:b model:self];
e->index = i++;
[journal_ addObject:e];
}
[self postChangeNotification];
}
- (void)postChangeNotification
{
[[NSNotificationCenter defaultCenter] postNotificationName:@"iTermReloadAddressBook"
Loading
Loading
@@ -628,11 +654,38 @@ id gAltOpenAllRepresentedObject;
return pos;
}
 
- (int)positionOfBookmarkWithIndex:(int)theIndex startingAtItem:(int)skip inMenu:(NSMenu*)menu
{
// Find position of bookmark in menu
int N = [menu numberOfItems];
if ([BookmarkModel menuHasOpenAll:menu]) {
N -= 3;
}
NSArray* items = [menu itemArray];
int pos = N;
for (int i = skip; i < N; i++) {
NSMenuItem* cur = [items objectAtIndex:i];
if ([cur isSeparatorItem]) {
break;
}
if ([cur isHidden] || [cur submenu]) {
continue;
}
if ([cur tag] > theIndex) {
pos = i;
break;
}
}
return pos;
}
- (void)addBookmark:(Bookmark*)b
toMenu:(NSMenu*)menu
atPosition:(int)pos
withParams:(JournalParams*)params
isAlternate:(BOOL)isAlternate
withTag:(int)tag
{
NSMenuItem* item = [[NSMenuItem alloc] initWithTitle:[b objectForKey:KEY_NAME]
action:isAlternate ? params->alternateSelector : params->selector
Loading
Loading
@@ -647,17 +700,24 @@ id gAltOpenAllRepresentedObject;
[item setAlternate:isAlternate];
[item setTarget:params->target];
[item setRepresentedObject:[[[b objectForKey:KEY_GUID] copy] autorelease]];
[item setTag:tag];
[menu insertItem:item atIndex:pos];
}
 
- (void)addBookmark:(Bookmark*)b toMenu:(NSMenu*)menu startingAtItem:(int)skip withTags:(NSArray*)tags params:(JournalParams*)params
- (void)addBookmark:(Bookmark*)b toMenu:(NSMenu*)menu startingAtItem:(int)skip withTags:(NSArray*)tags params:(JournalParams*)params atPos:(int)theIndex
{
int pos = [self positionOfBookmark:b startingAtItem:skip inMenu:menu];
int pos;
if (theIndex == -1) {
// Add in sorted order
pos = [self positionOfBookmark:b startingAtItem:skip inMenu:menu];
} else {
pos = [self positionOfBookmarkWithIndex:theIndex startingAtItem:skip inMenu:menu];
}
 
if (![tags count]) {
// Add item & alternate if no tags
[self addBookmark:b toMenu:menu atPosition:pos withParams:params isAlternate:NO];
[self addBookmark:b toMenu:menu atPosition:pos+1 withParams:params isAlternate:YES];
[self addBookmark:b toMenu:menu atPosition:pos withParams:params isAlternate:NO withTag:theIndex];
[self addBookmark:b toMenu:menu atPosition:pos+1 withParams:params isAlternate:YES withTag:theIndex];
}
 
// Add to tag submenus
Loading
Loading
@@ -666,7 +726,7 @@ id gAltOpenAllRepresentedObject;
startingAtItem:skip
withName:tag
params:params];
[self addBookmark:b toMenu:tagSubMenu startingAtItem:0 withTags:nil params:params];
[self addBookmark:b toMenu:tagSubMenu startingAtItem:0 withTags:nil params:params atPos:-1];
}
 
if ([menu numberOfItems] > skip + 2 && ![BookmarkModel menuHasOpenAll:menu]) {
Loading
Loading
@@ -681,7 +741,7 @@ id gAltOpenAllRepresentedObject;
if (!b) {
return;
}
[model addBookmark:b toMenu:menu startingAtItem:skip withTags:[b objectForKey:KEY_TAGS] params:params];
[model addBookmark:b toMenu:menu startingAtItem:skip withTags:[b objectForKey:KEY_TAGS] params:params atPos:e->index];
}
 
+ (void)applyRemoveJournalEntry:(BookmarkJournalEntry*)e toMenu:(NSMenu*)menu startingAtItem:(int)skip params:(JournalParams*)params
Loading
Loading
Loading
Loading
@@ -270,6 +270,7 @@ static const float kBackgroundSessionIntervalSec = 1;
- (void)brokenPipe;
 
// PTYTextView
- (BOOL)hasTextSendingKeyMappingForEvent:(NSEvent*)event;
- (BOOL)hasActionableKeyMappingForEvent: (NSEvent *)event;
- (void)keyDown:(NSEvent *)event;
- (BOOL)willHandleEvent: (NSEvent *)theEvent;
Loading
Loading
Loading
Loading
@@ -420,6 +420,41 @@ static NSString* SESSION_ARRANGEMENT_WORKING_DIRECTORY = @"Working Directory";
return newOutput;
}
 
// This command installs the xterm-256color terminfo in the user's terminfo directory:
// tic -e xterm-256color $FILENAME
- (void)_maybeAskAboutInstallXtermTerminfo
{
NSString* NEVER_WARN = @"NeverWarnAboutXterm256ColorTerminfo";
if ([[NSUserDefaults standardUserDefaults] objectForKey:NEVER_WARN]) {
return;
}
NSString* filename = [[NSBundle bundleForClass: [self class]] pathForResource:@"xterm-terminfo" ofType:@"txt"];
if (!filename) {
return;
}
NSString* cmd = [NSString stringWithFormat:@"tic -e xterm-256color %@", filename];
if (system("infocmp xterm-256color")) {
switch (NSRunAlertPanel(@"Warning",
@"The terminfo file for the terminal type you're using, \"xterm-256color\", is not installed on your system. Would you like to install it now?",
@"Install",
@"Never ask me again",
@"Not Now",
nil)) {
case NSAlertDefaultReturn:
if (system([cmd UTF8String])) {
NSRunAlertPanel(@"Error",
[NSString stringWithFormat:@"Sorry, an error occurred while running: %@", cmd],
@"Ok", nil, nil);
}
break;
case NSAlertAlternateReturn:
[[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithBool:YES] forKey:NEVER_WARN];
break;
}
}
}
- (void)startProgram:(NSString *)program
arguments:(NSArray *)prog_argv
environment:(NSDictionary *)prog_env
Loading
Loading
@@ -437,6 +472,9 @@ static NSString* SESSION_ARRANGEMENT_WORKING_DIRECTORY = @"Working Directory";
#endif
if ([env objectForKey:TERM_ENVNAME] == nil)
[env setObject:TERM_VALUE forKey:TERM_ENVNAME];
if ([[env objectForKey:TERM_ENVNAME] isEqualToString:@"xterm-256color"]) {
[self _maybeAskAboutInstallXtermTerminfo];
}
 
if ([env objectForKey:COLORFGBG_ENVNAME] == nil && COLORFGBG_VALUE != nil)
[env setObject:COLORFGBG_VALUE forKey:COLORFGBG_ENVNAME];
Loading
Loading
@@ -618,7 +656,7 @@ static NSString* SESSION_ARRANGEMENT_WORKING_DIRECTORY = @"Working Directory";
}
}
 
- (BOOL)hasActionableKeyMappingForEvent:(NSEvent *)event
- (int)_keyBindingActionForEvent:(NSEvent*)event
{
unsigned int modflag;
NSString *unmodkeystr;
Loading
Loading
@@ -638,13 +676,31 @@ static NSString* SESSION_ARRANGEMENT_WORKING_DIRECTORY = @"Working Directory";
*/
 
// Check if we have a custom key mapping for this event
keyBindingAction = [iTermKeyBindingMgr actionForKeyCode:unmodunicode
modifiers:modflag
text:&keyBindingText
keyMappings:[[self addressBookEntry] objectForKey: KEY_KEYBOARD_MAP]];
return keyBindingAction;
}
 
- (BOOL)hasTextSendingKeyMappingForEvent:(NSEvent*)event
{
int keyBindingAction = [self _keyBindingActionForEvent:event];
switch (keyBindingAction) {
case KEY_ACTION_ESCAPE_SEQUENCE:
case KEY_ACTION_HEX_CODE:
case KEY_ACTION_TEXT:
case KEY_ACTION_IGNORE:
case KEY_ACTION_SEND_C_H_BACKSPACE:
case KEY_ACTION_SEND_C_QM_BACKSPACE:
return YES;
}
return NO;
}
 
- (BOOL)hasActionableKeyMappingForEvent:(NSEvent *)event
{
int keyBindingAction = [self _keyBindingActionForEvent:event];
return (keyBindingAction >= 0) && (keyBindingAction != KEY_ACTION_DO_NOT_REMAP_MODIFIERS) && (keyBindingAction != KEY_ACTION_REMAP_LOCALLY);
}
 
Loading
Loading
Loading
Loading
@@ -250,14 +250,16 @@ NSString *CommandToolbarItem = @"Command";
// Remove menu items because otherwise they will leak (I think items and menus have a cyclic reference?)
// As soon as -[toolbarItem setImage:] is called, the menuFormRepresentation is lost and leaked.
[self _removeItemsFromMenu:[aPopUpButton menu]];
[self _removeItemsFromMenu:[[toolbarItem menuFormRepresentation] submenu]];
// For some reason, making a call to [toolbarItem menuFormRepresentation] here causes the "new tab"
// toolbar item to turn into the icon version so that when it's clicked in text mode the toolbar
// switches into text+icon mode. See bug 995.
[aPopUpButton addItemWithTitle: @""];
 
[iconMenu_ release];
iconMenu_ = aMenu = [[NSMenu alloc] init];
// first menu item is just a space taker
[aMenu addItem: [[[NSMenuItem alloc] initWithTitle: @"AAA" action:@selector(newSessionInTabAtIndex:) keyEquivalent:@""] autorelease]];
[[iTermController sharedInstance] addBookmarksToMenu:aMenu];
[aMenu addItem:[[[NSMenuItem alloc] initWithTitle: @"AAA" action:@selector(newSessionInTabAtIndex:) keyEquivalent:@""] autorelease]];
[[iTermController sharedInstance] addBookmarksToMenu:aMenu startingAt:1];
 
[aPopUpButton setMenu:aMenu];
 
Loading
Loading
@@ -284,7 +286,7 @@ NSString *CommandToolbarItem = @"Command";
item = [[NSMenuItem alloc] initWithTitle: NSLocalizedStringFromTableInBundle(@"New Tab",@"iTerm", [NSBundle bundleForClass: [self class]], @"Toolbar Item:New") action: nil keyEquivalent: @""];
[textMenu_ release];
textMenu_ = aMenu = [[NSMenu alloc] init];
[[iTermController sharedInstance] addBookmarksToMenu:aMenu];
[[iTermController sharedInstance] addBookmarksToMenu:aMenu startingAt:0];
[item setSubmenu:aMenu];
 
[toolbarItem setMenuFormRepresentation: item];
Loading
Loading
@@ -302,11 +304,10 @@ NSString *CommandToolbarItem = @"Command";
params.openAllSelector = @selector(newSessionsInWindow:);
params.alternateSelector = @selector(newSessionInTabAtIndex:);
params.alternateOpenAllSelector = @selector(newSessionsInWindow:);
params.target = self;
params.target = [iTermController sharedInstance];
 
[BookmarkModel applyJournal:[aNotification userInfo] toMenu:iconMenu_ params:&params];
[BookmarkModel applyJournal:[aNotification userInfo] toMenu:iconMenu_ startingAtItem:1 params:&params];
[BookmarkModel applyJournal:[aNotification userInfo] toMenu:textMenu_ params:&params];
//[self buildToolbarItemPopUpMenu:aToolbarItem forToolbar:_toolbar];
}
}
 
Loading
Loading
Loading
Loading
@@ -174,12 +174,17 @@
 
int windowType_;
BOOL isHotKeyWindow_;
BOOL haveScreenPreference_;
int screenNumber_;
BOOL isOrderedOut_;
 
// Window number, used for keyboard shortcut to select a window.
// This value is 0-based while the UI is 1-based.
int number_;
// True if this window was created by dragging a tab from another window.
// Affects how its size is set when the number of tabview items changes.
BOOL wasDraggedFromAnotherWindow_;
}
 
// Initialize a new PseudoTerminal.
Loading
Loading
Loading
Loading
@@ -202,9 +202,11 @@ NSString *sessionsKey = @"sessions";
if (screenNumber < 0 || screenNumber >= [[NSScreen screens] count]) {
screen = [[self window] screen];
screenNumber_ = 0;
haveScreenPreference_ = NO;
} else {
screen = [[NSScreen screens] objectAtIndex:screenNumber];
screenNumber_ = screenNumber;
haveScreenPreference_ = YES;
}
 
NSRect initialFrame;
Loading
Loading
@@ -222,11 +224,36 @@ NSString *sessionsKey = @"sessions";
PtyLog(@"Unknown window type: %d", (int)windowType);
NSLog(@"Unknown window type: %d", (int)windowType);
// fall through
case WINDOW_TYPE_FULL_SCREEN:
case WINDOW_TYPE_NORMAL:
haveScreenPreference_ = NO;
// fall through
case WINDOW_TYPE_FULL_SCREEN:
// Use the system-supplied frame which has a reasonable origin. It may
// be overridden by smart window placement or a saved window location.
initialFrame = [[self window] frame];
if (screenNumber_ != 0) {
// Move the frame to the desired screen
NSScreen* baseScreen = [[self window] deepestScreen];
NSPoint basePoint = [baseScreen visibleFrame].origin;
double xoffset = initialFrame.origin.x - basePoint.x;
double yoffset = initialFrame.origin.y - basePoint.y;
NSPoint destPoint = [screen visibleFrame].origin;
destPoint.x += xoffset;
destPoint.y += yoffset;
initialFrame.origin = destPoint;
// Make sure the top-right corner of the window is on the screen too
NSRect destScreenFrame = [screen visibleFrame];
double xover = destPoint.x + initialFrame.size.width - (destScreenFrame.origin.x + destScreenFrame.size.width);
double yover = destPoint.y + initialFrame.size.height - (destScreenFrame.origin.y + destScreenFrame.size.height);
if (xover > 0) {
destPoint.x -= xover;
}
if (yover > 0) {
destPoint.y -= yover;
}
[[self window] setFrameOrigin:destPoint];
}
break;
}
preferredOrigin_ = initialFrame.origin;
Loading
Loading
@@ -1439,6 +1466,13 @@ NSString *sessionsKey = @"sessions";
- (void)windowWillShowInitial
{
PTYWindow* window = (PTYWindow*)[self window];
// If it's a full or top-of-screen window with a screen number preference, always honor that.
if (haveScreenPreference_) {
NSRect frame = [window frame];
frame.origin = preferredOrigin_;
[window setFrame:frame display:NO];
return;
}
if (([[[iTermController sharedInstance] terminals] count] == 1) ||
(![[PreferencePanel sharedInstance] smartPlacement])) {
NSRect frame = [window frame];
Loading
Loading
@@ -1561,14 +1595,16 @@ NSString *sessionsKey = @"sessions";
 
[[iTermController sharedInstance] addBookmarksToMenu:aMenu
withSelector:@selector(newSessionInWindowAtIndex:)
openAllSelector:@selector(newSessionsInNewWindow:)];
openAllSelector:@selector(newSessionsInNewWindow:)
startingAt:0];
 
[theMenu setSubmenu:aMenu forItem:[theMenu itemAtIndex:0]];
 
aMenu = [[[NSMenu alloc] init] autorelease];
[[iTermController sharedInstance] addBookmarksToMenu:aMenu
withSelector:@selector(newSessionInTabAtIndex:)
openAllSelector:@selector(newSessionsInWindow:)];
openAllSelector:@selector(newSessionsInWindow:)
startingAt:0];
 
[theMenu setSubmenu:aMenu forItem:[theMenu itemAtIndex:1]];
}
Loading
Loading
@@ -1842,10 +1878,23 @@ NSString *sessionsKey = @"sessions";
}
 
// check window size in case tabs have to be hidden or shown
if (([TABVIEW numberOfTabViewItems] == 1) || ([[PreferencePanel sharedInstance] hideTab] &&
([TABVIEW numberOfTabViewItems] > 1 && [tabBarControl isHidden]))) {
if (([TABVIEW numberOfTabViewItems] == 1) ||
([[PreferencePanel sharedInstance] hideTab] && ([TABVIEW numberOfTabViewItems] > 1 && [tabBarControl isHidden]))) {
PtyLog(@"tabViewDidChangeNumberOfTabViewItems - calling fitWindowToTab");
PTYTab* firstTab = [[[TABVIEW tabViewItems] objectAtIndex:0] identifier];
if (wasDraggedFromAnotherWindow_) {
// A tab was just dragged out of another window's tabbar into its own window.
// When this happens, it loses its size. This is our only chance to resize it.
// So we put it in a mode where it will resize to its "ideal" size instead of
// its incorrect current size.
[firstTab setReportIdealSizeAsCurrent:YES];
}
[self fitWindowToTabs];
[self repositionWidgets];
if (wasDraggedFromAnotherWindow_) {
wasDraggedFromAnotherWindow_ = NO;
[firstTab setReportIdealSizeAsCurrent:NO];
}
}
 
int i;
Loading
Loading
@@ -1941,7 +1990,7 @@ NSString *sessionsKey = @"sessions";
if (term == nil) {
return nil;
}
term->wasDraggedFromAnotherWindow_ = YES;
[term copySettingsFrom:self];
 
[[iTermController sharedInstance] addInTerminals: term];
Loading
Loading
Loading
Loading
@@ -49,10 +49,33 @@
inFocus = ([[[textField window] firstResponder] isKindOfClass:[NSTextView class]]
&& [[textField window] fieldEditor:NO forObject:nil]!=nil
&& [textField isEqualTo:(id)[(NSTextView *)[[textField window] firstResponder]delegate]]);
return inFocus;
}
 
- (BOOL)_eventUsesNavigationKeys:(NSEvent*)event
{
NSString* unmodkeystr = [event charactersIgnoringModifiers];
if ([unmodkeystr length] == 0) {
return NO;
}
unichar unmodunicode = [unmodkeystr length] > 0 ? [unmodkeystr characterAtIndex:0] : 0;
switch (unmodunicode) {
case NSUpArrowFunctionKey:
case NSDownArrowFunctionKey:
case NSLeftArrowFunctionKey:
case NSRightArrowFunctionKey:
case NSInsertFunctionKey:
case NSDeleteFunctionKey:
case NSDeleteCharFunctionKey:
case NSHomeFunctionKey:
case NSEndFunctionKey:
return YES;
default:
return NO;
}
}
// override to catch key press events very early on
- (void)sendEvent:(NSEvent*)event
{
Loading
Loading
@@ -145,7 +168,18 @@
}
}
 
if ([currentSession hasActionableKeyMappingForEvent:event]) {
BOOL okToRemap = YES;
if ([responder isKindOfClass:[NSTextView class]]) {
// Disable keymaps that send text
if ([currentSession hasTextSendingKeyMappingForEvent:event]) {
okToRemap = NO;
}
if ([self _eventUsesNavigationKeys:event]) {
okToRemap = NO;
}
}
if (okToRemap && [currentSession hasActionableKeyMappingForEvent:event]) {
// Remap key.
[currentSession keyDown:event];
return;
Loading
Loading
Loading
Loading
@@ -405,7 +405,10 @@ int gDebugLogFile = -1;
// Build the bookmark menu
bookmarksMenu = [[[NSMenu alloc] init] autorelease];
 
[[iTermController sharedInstance] addBookmarksToMenu:bookmarksMenu withSelector:selector openAllSelector:openAllSelector];
[[iTermController sharedInstance] addBookmarksToMenu:bookmarksMenu
withSelector:selector
openAllSelector:openAllSelector
startingAt:0];
[newMenuItem setSubmenu:bookmarksMenu];
}
 
Loading
Loading
Loading
Loading
@@ -95,8 +95,8 @@
- (PseudoTerminal *)currentTerminal;
- (void)terminalWillClose:(PseudoTerminal*)theTerminalWindow;
- (NSArray*)sortedEncodingList;
- (void)addBookmarksToMenu:(NSMenu *)aMenu;
- (void)addBookmarksToMenu:(NSMenu *)aMenu withSelector:(SEL)selector openAllSelector:(SEL)openAllSelector;
- (void)addBookmarksToMenu:(NSMenu *)aMenu startingAt:(int)startingAt;
- (void)addBookmarksToMenu:(NSMenu *)aMenu withSelector:(SEL)selector openAllSelector:(SEL)openAllSelector startingAt:(int)startingAt;
- (id)launchBookmark:(NSDictionary*)bookmarkData inTerminal:(PseudoTerminal*)theTerm;
- (id)launchBookmark:(NSDictionary *)bookmarkData inTerminal:(PseudoTerminal *)theTerm withCommand:(NSString *)command;
- (id)launchBookmark:(NSDictionary*)bookmarkData inTerminal:(PseudoTerminal*)theTerm withURL:(NSString*)url;
Loading
Loading
Loading
Loading
@@ -637,7 +637,7 @@ static BOOL initDone = NO;
usedGuids:nil bookmarks:nil];
}
 
- (void)addBookmarksToMenu:(NSMenu *)aMenu withSelector:(SEL)selector openAllSelector:(SEL)openAllSelector
- (void)addBookmarksToMenu:(NSMenu *)aMenu withSelector:(SEL)selector openAllSelector:(SEL)openAllSelector startingAt:(int)startingAt
{
JournalParams params;
params.selector = selector;
Loading
Loading
@@ -652,17 +652,19 @@ static BOOL initDone = NO;
Bookmark* b = [bm bookmarkAtIndex:i];
[bm addBookmark:b
toMenu:aMenu
startingAtItem:0
startingAtItem:startingAt
withTags:[b objectForKey:KEY_TAGS]
params:&params];
params:&params
atPos:i];
}
}
 
- (void)addBookmarksToMenu:(NSMenu *)aMenu
- (void)addBookmarksToMenu:(NSMenu *)aMenu startingAt:(int)startingAt
{
[self addBookmarksToMenu:aMenu
withSelector:@selector(newSessionInTabAtIndex:)
openAllSelector:@selector(newSessionsInWindow:)];
openAllSelector:@selector(newSessionsInWindow:)
startingAt:startingAt];
}
 
- (void)irAdvance:(int)dir
Loading
Loading
Loading
Loading
@@ -6,14 +6,14 @@
<description>Most recent changes with links to updates.</description>
<language>en</language>
<item>
<title>Version 0.20.20110413</title>
<title>Version 0.20.20110529</title>
<sparkle:releaseNotesLink>
http://iterm2.googlecode.com/svn/trunk/appcasts/testing_changes.html
</sparkle:releaseNotesLink>
<pubDate>Wed, 13 Apr 2011 21:15:01 -0700</pubDate>
<enclosure url="http://iterm2.googlecode.com/files/iTerm2-beta1.zip"
sparkle:version="0.20.20110413" length="3671235" type="application/octet-stream"
sparkle:dsaSignature="MC4CFQCToeMXPZ8YjoqSb4FUc246qG9TRQIVAIMC7UgdJj25e4rGDiHSPAk0eYi3" />
<pubDate>Wed, 01 Jun 2011 00:05:00 -0700</pubDate>
<enclosure url="http://iterm2.googlecode.com/files/iTerm2-beta2.zip"
sparkle:version="0.20.20110529" length="3743368" type="application/octet-stream"
sparkle:dsaSignature="MCwCFFDl4uHsvnrguWTCJcRxDuFgPElZAhQwIJjD9PxXV+m8YRCKDaDSpCCzAg==" />
</item>
</channel>
</rss>
Loading
Loading
These release notes are for the development builds of iTerm2. If you want something stable, stick with the original iTerm until the first official release of iTerm2. Alpha 17 is known to be quite reliable, though.
These release notes are for the development builds of iTerm2. If you want something stable, stick with the original iTerm until the first official release of iTerm2. Beta 1 is known to be quite reliable, though.
Beta 2
Amazingly bug-free!
Enhancements:
- For the first time in iTerm history, when nothing is happening, CPU usage is at 0%!
- Allow substring searches of profiles. To use, start your search with *. For example, *x matches all tags and profile names containing the letter x.
- Add preference to control whether lines are added to the scrollback buffer when a status line is visible.
- Add preference to allow Hotkey Window to switch spaces when it closes but return focus to the correct terminal window.
- Performance improvements for people with lots of profiles.
Bug fixes:
- Fix bug where spaces indicator hangs when you have a hotkey defined; also fixes compatibility with Synergy and various other programs.
- Fixed bug in parsing 256-color control codes.
- Fix bug with shift-click to extend a selection.
- Prevent clicks that bring iTerm2 to the foreground from accidentally making a selection.
- Change how job names are gotten to prevent terminal becoming non-responsive sometimes.
- Improve growl behavior when a session ends.
- Better support for ssh, ftp, and telnet scheme handlers.
- Fix flickering of status bar when scrolling vim.
- Allow instant replay memory usage to be set to 0.
- Don't close hotkey window when prefs window opens.
- Improve selection of dotted-words in smart selection and add semicolons to URL matching.
- Improve URL parsing when a URL wraps around lines with a hard newline.
- Fix param escaping in "search google" feature.
- Handle changing the number of screens with fullscreen and top of screen windows.
- Memory leak tied to keypresses fixed.
- Improve wording in prefs dialog.
- Improve visor behavior when switching to a terminal or profiles window.
- Make fullscreen and scrollbars work under 10.7.
- Fix crash when going to prev/next pane.
- Fix crash when searching.
- Allow cmd-click to open a file/url in an inactive tab.
- Don't turn off transparency automatically when opening a fullscreen window.
- Fix bug where zooming on a multi-screen system would cause the window to jump to a different screen.
- Performance improvements for autocomplete.
- Suppress growl messages when resizing a window with many tabs.
- Fix use selection for find to work standardly.
- Respect key bindings when focus is in a text field.
- Hide hotkey window when clicking the dock icon.
- Don't hide menu bar when fullscreen window is not on main screen.
- Handle dragging tabs of all window types into a new window.
- Make reuse tab's directory work when opening a new window, not just a new tab.
- Hide hotkey window from expose.
- Don't show menu bar when hotkey window is hidden if current term is fullscreen.
- Allow cmd-w to close the about box.
- Improve perceived brightness formula for contrast calculations.
- Fix bug where bold fg was used to compute bg brightness.
- Fix bugs in computing smart cursor color.
- Swap positions of OK and Cancel buttons in edit key bindings dialog.
- Change default left option key behavior to normal to avoid confusing non-US keyboard users.
- Don't hide menu bar when hidden hotkey window becomes key.
- When clicking on a background window, don't report xterm mouse down.
- Fix hang when you run an app that aborts and tries to fork gdb in error handler for stacktrace.
- Update display immedately after Cmd-R or Cmd-K.
- Swap find next and find prev behavior.
- Don't save lines to scrollback buffer in alternate screen mode.
- Escape more shell characters when dragging a file into a term.
- Fix link to home page.
- Removed unnecessary logging by Growl code.
- Added assert statements.
- Don't warn about outdated key mappings if modifying a global action and no profile has it.
- Set ^T as status char in tty.
- Keep window from resizing when you open a new tab and the existing tab has split panes.
- Improve resizing behavior of screen contents.
- Fix bug where window slowly grew when toggling fullscreen.
- Fix bug where the wrong line was highlighted when doing a search while scrolling with a full buffer.
- Fix crash where a session dies while in instant replay and then you close the window.
- Fix bug where session size isn't restored properly when exiting instant replay.
- Fix assertion in VT100Screen
- Add default key mapping for ctrl-tab to send tab.
 
Beta 1
This release heralds a new age of stability. It also brings some notable UI improvements over the previous release.
Loading
Loading
This diff is collapsed.
This diff is collapsed.
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