Last active
October 12, 2024 09:03
-
-
Save willeccles/02228fc54c42942531a072318dcaf82b to your computer and use it in GitHub Desktop.
AppleScript for using Kitty in Alfred. This was made for bash, but can easily be made to work with any shell.
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
(* 2019-06-07: Added nohup and output redirection to fix a bug with "Open Terminal here" feature. | |
Thanks to @fools-mate for bringing the issue to my attention. *) | |
on alfred_script(q) | |
do shell script "cd ~; nohup /Applications/kitty.app/Contents/MacOS/kitty /bin/bash -c \"source ~/.bashrc && " & q & ";/bin/bash\" > /dev/null 2>&1 &" | |
end alfred_script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I just came across this gist as I was trying to set up this functionality in Alfred, however when I tried using it, it kept splitting my active terminal instead of opening a new tab. I did some digging and it turns out that the
new-window
command is deprecated, replaced by thelaunch
command. Here's the snippet that I was able to come up with that opens a new tab instead of splitting the current one.In addition to this, you will need to ensure that
allow_remote_control yes
is present in your~/.config/kitty/kitty.conf
file, and then also create a new file at~/.config/kitty/macos-launch-services-cmdline
which contains the following:This
macos-launch-services-cmdline
file is specific to the Mac version of kitty and specifies launch arguments to use, which is the only way I was able to get it to create the necessary socket file for remote control.