rkochar
rkochar

Reputation: 570

Split screen in Kitty

I would like to split screen of my terminal (kitty). I know it's possible but there doesn't seem to be a shortcut (pre-made or that I can add to kitty.conf file. I also saw an option for typing a command but I don't understand where this command needs to be typed (and is annoying to type a command to split screen each time).

Sidenote: There is no existing tag for 'Kitty' and I can't create it either.

Thanks

Upvotes: 23

Views: 54393

Answers (3)

Stuart Cardall
Stuart Cardall

Reputation: 2447

I use the grid layout for 5 x split terminals with grid set as the default layout:

5 terminals in a tab

  • ~/.config/kitty/kitty.conf
enabled_layouts         grid,tall:bias=50;full_size=2, *

#: Tab layout {{{
tab_bar_edge   top
tab_bar_style  powerline

#: }}}

I created a custom startup_session configuration which I launch via a bash alias:

alias k='kitty --session ~/.config/kitty/custom.conf'

& launch a kitty terminal with 3 x tabs of 5 terminals + 1 tab with 3 terminals & btop / htop started:

3 terminals in a tab

  • ~/.config/kitty/custom.conf
# Create a new tab
new_tab Homelab

# Set the layout for the tab (enabled_layouts sets grid as default)
#layout grid

# Set the working directory for windows in the current tab
cd ~

# First window, set a user variable on it so we can focus it later
launch --var window=first htop
# Create additional terminals
launch --location=vsplit
launch --location=vsplit
launch --location=vsplit
launch --location=vsplit

# Create a 2nd tab
new_tab USA

# Set the working directory for windows in the current tab
cd ~

# First window, set a user variable on it so we can focus it later
launch --var window=first
# Create additional terminals
launch --location=vsplit
launch --location=vsplit
launch --location=vsplit
launch --location=vsplit

# Create a new tab
new_tab London

# Set the working directory for windows in the current tab
cd ~

# First window, set a user variable on it so we can focus it later
launch --var window=first
# Create additional terminals
launch --location=vsplit
launch --location=vsplit
launch --location=vsplit
launch --location=vsplit

# Create a new tab
new_tab BTOP

# Set the working directory for windows in the current tab
cd ~
launch btop
launch --location=vsplit htop
launch --location=vsplit
  • I also came across the my-kitty-config repo which if configured has an option to dump a terminal layout to a file (useful for more complex terminal configurations)

  • I mainly configured kitty so I could ssh & su to root on some remote clusters. I got this working by configuring passwordless ssh & using a tab launcher of:

launch --location=vsplit ssh -t host-bookmark "sudo su -" 

Upvotes: 1

Sdgh17
Sdgh17

Reputation: 785

As Kitty's document specifies, you can have both tabs and split screens (Kitty calls them "windows").


Tab:

New tab: ctrl + shift + t (also + t on macOS)

Close tab: ctrl + shift + q (also + w on macOS)

Next tab: ctrl + shift + right (also + and + + ] on macOS)

Previous tab: ctrl + shift + left (also + + and + + [ on macOS)


Window (split screen within the main Kitty window):

New window: ctrl + shift + enter (also + on macOS)

Close window: ctrl + shift + w (also + + d on macOS)

Next window: ctrl + shift + ]

Previous window: ctrl + shift + [

After opening a new window (split screen), if you don't like the layout, you can try different layouts by pressing ctrl + shift + l until you find a layout that you like.


OS window:

New OS window: ctrl + shift + n (also + n on macOS)

Upvotes: 65

pti4ka
pti4ka

Reputation: 1

just wanna place more informative docs (windows) that helped me find difference in Mac and Windows shortcuts


Here two important difference on MacOS. Rest works fine

New window: cmd + enter

Close window: shift + cmd + d

Upvotes: 0

Related Questions