Skip to content

Instantly share code, notes, and snippets.

@khurshid-alam
Created July 8, 2024 23:31
Show Gist options
  • Save khurshid-alam/dd358bd41c938c0d1b2204d5abff622e to your computer and use it in GitHub Desktop.
Save khurshid-alam/dd358bd41c938c0d1b2204d5abff622e to your computer and use it in GitHub Desktop.
#This sets warp as default terminal in mac # Code taken from iTerm2 #https://github.com/warpdotdev/Warp/issues/753#issuecomment-1817856836 #Compile with following #clang -framework Foundation -framework CoreServices -o SetDefaultTerminal <path to your .m file> && ./SetDefaultTerminal in the command line
#This sets warp as default terminal in mac
# Code taken from iTerm2
#https://github.com/warpdotdev/Warp/issues/753#issuecomment-1817856836
#Compile with following
#clang -framework Foundation -framework CoreServices -o SetDefaultTerminal <path to your .m file> && ./SetDefaultTerminal in the command line
#import <Foundation/Foundation.h>
#import <CoreServices/CoreServices.h>
void setDefaultTerminal(NSString *bundleId) {
CFStringRef unixExecutableContentType = (CFStringRef)@"public.unix-executable";
LSSetDefaultRoleHandlerForContentType(unixExecutableContentType, kLSRolesShell, (CFStringRef) bundleId);
}
int main(int argc, const char * argv[]) {
@autoreleasepool {
setDefaultTerminal(@"dev.warp.Warp-Stable");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment