Kitty

Login Shell and Startup RC Files

Looks like macOS does not read the shell’s RC startup files by default. Even without changing the default, starting Kitty from the GUI (Spotlight, for example) causes the shell inside kitty not to read RC files. What I do is to launch kitty from Terminal.app or iTerm2.app. I don’t remember having such problems on Arch Linux.

Single vs Multiple Kitty Windows

If we have a running kitty instance windows, and open another one from the running instance, perhaps by running Ctrl+n or Cmd+n, this new window seems to share some main process because setting a new window tittle to this window also changes the window title on the other window and vice-versa. Also, in this case, there is a single Kitty icon on macOS dock.

I generally have at least two or three windows with a few tabs in each one for each thing I am working on. For example, may day job project and at least my personal dotfiles project. In this case, I don’t want both Kitty windows to be the same “process” or whatever. I want to set window titles independently from each other. At least for now, in macOS, the solution seems to open Kitty from a running shell session:

$ kitty -d ~/Projects/dotfiles --title DOTFILES &
$ kitty -d ~/work/src/proj-x --title PROJECT-X &

Setting Title

Here’s a bash script to set the a given title for all kitty windows, which causes the current OS window to have the same title no matter which (non-OS) window or tab is selected.

 1#!/usr/bin/env bash
 2
 3##
 4# Sets all Kitty windows to the given title. Defaults “λ KITTY λ” if not passed.
 5#
 6# Note that Kitty has the concept of windows and OS windows. Check:
 7#
 8# • https://sw.kovidgoyal.net/kitty/overview/#tabs-and-windows
 9#
10# DEPENDENCIES
11#
12# Make sure you have these programs installed:
13#
14# • kitty (duh 🤣)
15# • jq
16# • coreutils (tr, sed, etc).
17##
18
19win_title="${1:-λ KITTY λ}"
20
21IFS=' ' read -ra win_ids <<<$(
22	kitty @ ls \
23		| jq '.[].tabs[] | .windows[] | .id' \
24		| tr '\n' ' '
25)
26
27for id in "${win_ids[@]}" ; do
28	kitty @ set-window-title -m id:"$id" $win_title λ"
29done
30
31#
32# vim: set tw=72 noet ts=2:
33#

Themes

Check the kitty-themes repository.

Vim + Kitty + Solarized Light

The Kitty Solarized Light sets vim’s background to dark (as of 2020~2021, at least). Check this issue for a solution. In short, replace color7 and color15 with these:

color7  #eee8d5
color15  #fdf6e3