# Terminal: Installing and customizing the Kitty terminal emulator on Mac ver. 6

Last Updated on February 19, 2022 by shibatau

## I. Installation

This may be the easiest way though you have to install Homebrew beforehand. Run the following command in the terminal.

brew install kitty

https://techviewleo.com/setup-kitty-terminal-emulator-on-linux-macos/

## II. Change themes

This is also the easiest way of changing colors. Run the following command and select the theme that you like with the arrow keys.

kitty +kitten themes

Changing kitty colors

## III. Layouts

There are many different layouts available. You can switch layouts using ctrl + shift + l. To control which layouts are available use enabled_layouts.

Arrange windows

## IV. Display an image in the terminal

You can display an image with the following code:

kitty +kitten icat NAME.jpg

You can also control how the image appears in the terminal with Python scripts. Here is the minimal Python codes. Save the file as png.py anywhere you like.

import sys
from base64 import standard_b64encode

def serialize_gr_command(**cmd):
cmd = ','.join(f'{k}={v}' for k, v in cmd.items())
ans = []
w = ans.append
w(b'\033_G'), w(cmd.encode('ascii'))
w(b';')
w(b'\033\\')
return b''.join(ans)

def write_chunked(**cmd):
data = standard_b64encode(cmd.pop('data'))
while data:
chunk, data = data[:4096], data[4096:]
m = 1 if data else 0
sys.stdout.flush()
cmd.clear()

with open(sys.argv[-1], 'rb') as f:
write_chunked(a='T', f=100, data=f.read())

Terminal graphics protocol

Now I have saved the above scripts in the home directory. I’m working in the Desktop directory, then I can display NAME.png in the directory with the following scripts.

python ~/Pictures/png.py NAME.png

Here is the image shown:

## V. Commands and Shortcuts

### Tab

Ctrl + shift + t Open a new tab

Ctrl + shift + q Close a tab

Ctrl + shift + right arrow Move to the right tab

Previous tab: ctrl + shift + left arrow Move to the left tab

### Window

Ctrl + shift + enter Open a new window

Ctrl + shift + w Close a window

Ctrl + shift + ] Move to the next window

Ctrl + shift + [ Move to the previous window

### Copy to clipboard

kitty +kitten clipboard

Ex. ls | kitty +kitten clipboard

See more:

Not completed yet.