Created
July 8, 2024 23:31
-
-
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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