Skip to content

Instantly share code, notes, and snippets.

@milk1000cc
Created November 18, 2009 12:45
Show Gist options
  • Save milk1000cc/237804 to your computer and use it in GitHub Desktop.
Save milk1000cc/237804 to your computer and use it in GitHub Desktop.
diff -cr iTerm/Growl/CFGrowlAdditions.c iTerm.META/Growl/CFGrowlAdditions.c
*** iTerm/Growl/CFGrowlAdditions.c 2009-11-18 08:44:56.000000000 +0900
--- iTerm.META/Growl/CFGrowlAdditions.c 2009-11-18 08:55:28.000000000 +0900
***************
*** 8,14 ****
#include <Carbon/Carbon.h>
#include "CFGrowlAdditions.h"
! #include <c.h>
#include <unistd.h>
static CFStringRef _CFURLAliasDataKey = CFSTR("_CFURLAliasData");
--- 8,15 ----
#include <Carbon/Carbon.h>
#include "CFGrowlAdditions.h"
! #include <fcgimisc.h>
! #include <sys/param.h>
#include <unistd.h>
static CFStringRef _CFURLAliasDataKey = CFSTR("_CFURLAliasData");
diff -cr iTerm/PTYSession.m iTerm.META/PTYSession.m
*** iTerm/PTYSession.m 2009-11-18 08:44:56.000000000 +0900
--- iTerm.META/PTYSession.m 2009-11-18 08:47:45.000000000 +0900
***************
*** 570,575 ****
--- 570,581 ----
send_strlen = [keydat length];
}
}
+ else if ((modflag & NSCommandKeyMask) && (unicode != 0x20 && unicode != 0x74 && unicode != NSLeftArrowFunctionKey && unicode != NSRightArrowFunctionKey))
+ {
+ send_str = (unsigned char*)strdup("\x1b ");
+ send_strlen = 2;
+ send_str[1] = (unsigned char)unicode;
+ }
else if ((modflag & NSAlternateKeyMask) &&
([self optionKey] != OPT_NORMAL))
{
diff -cr iTerm/iTermApplication.m iTerm.META/iTermApplication.m
*** iTerm/iTermApplication.m 2009-11-18 08:44:56.000000000 +0900
--- iTerm.META/iTermApplication.m 2009-11-18 08:50:42.000000000 +0900
***************
*** 45,50 ****
--- 45,52 ----
PseudoTerminal* currentTerminal = [[iTermController sharedInstance] currentTerminal];
PTYTabView* tabView = [currentTerminal tabView];
PTYSession* currentSession = [currentTerminal currentSession];
+ unichar unicode;
+ NSString *keystr;
if(([event modifierFlags] & 0xffff0000) == NSCommandKeyMask) {
int digit = [[event charactersIgnoringModifiers] intValue];
***************
*** 54,60 ****
}
}
! if([currentSession hasKeyMappingForEvent:event highPriority:YES]) {
[currentSession keyDown:event];
return;
}
--- 56,66 ----
}
}
! keystr = [event characters];
!
! unicode = [keystr length]>0?[keystr characterAtIndex:0]:0;
!
! if([currentSession hasKeyMappingForEvent: event highPriority: YES] || (([event modifierFlags] & NSCommandKeyMask) && (unicode != 0x20 && unicode != 0x74 && unicode != NSLeftArrowFunctionKey && unicode != NSRightArrowFunctionKey))) {
[currentSession keyDown:event];
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment