Skip to content

LinusVanElswijk/kitty-jumptab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kitty-jumptab

effortlessly switch and launch terminal tabs

jumptab usage demo

Quick start

Installation

Download src/jumpapp.py and place it into your kitty config directory (usually ~/.config/kitty/).

The following command does exactly this:

wget -O ~/.config/kitty/jumptab.py https://raw.githubusercontent.com/LinusVanElswijk/kitty-jumptab/refs/heads/main/src/jumptab.py

Configuration

Add the following to your kitty config file (usually ~/.config/kitty/kitty.conf):

# jumptab open: focus or launch a predefined tab
action_alias open kitten jumptab.py open --cwd=current
map alt+1 open 1
map alt+2 open 2
map alt+3 open 3
map alt+4 open 4
map alt+5 open 5
map alt+6 open 6
map alt+7 open 7
map alt+8 open 8
map alt+9 open 9

# jumptab send: move a window to a predefined tab
action_alias send kitten jumptab.py send --keep-focus
map shift+alt+1 send 1
map shift+alt+2 send 2
map shift+alt+3 send 3
map shift+alt+4 send 4
map shift+alt+5 send 5
map shift+alt+6 send 6
map shift+alt+7 send 7
map shift+alt+8 send 8
map shift+alt+9 send 9

# detach_tab complements jumptab in multi-window and multi-monitor workflows
map alt+d detach_tab

It is recommended to make kitty start on one of the predefined tab. This is done by adding the following text to your session config (usually ~/.config/kitty/startup.kitty; you may need to create it first):

new_tab 1

Goals

  • Minimize manual tab management: Enable seamless multi-session workflows by automating tab creation, switching, and organization with simple shortcuts.

  • Minimize reliance on multiplexers: Eliminate multiplexers as non-persistent session managers by leveraging Kitty’s native tabs for faster, more intuitive multi-session control.

  • Easy to start: The send and open commands require only one positional argument, with sensible defaults for all others to get you up and running quickly.

  • Full flexibility for power-users: This is designed to be highly configurable, so that you can adapt it to your unique workflow.

Reference

This kitten provides two powerful mappable actions, kitty jumptab.py open and kitty jumptab.py send. We highly recommend to create an action_alias for both commands, to reduce visual clutter and to have a single place to configure the desired behavior. See the config provided above.

action_alias jumptab kitten jumptab.py

All examples assume this alias is defined. Without it, you will have to replace jumptab with kitten jumptab.py to make them work.

jumptab open

# simple
kitten jumptab.py open <tab_title>

# full
kitten jumptab.py open <tab_title> [--match=<match_pattern>] [--keep-focus] [--location=<value>] [additional_args]

Focuses a matching tab if it exists, otherwise launches a new one.

jumptab send

# simple
kitten jumptab.py send <tab_title>

# full
kitten jumptab.py send <tab_title> [--match=<match_pattern>] [--keep-focus] [--location=<value>]

Moves the current window to a matching tab, or to a new tab if no match is found.

supported arguments

Command(s) Argument Values Default Description
open, send <tab_title> Any string Title assigned to the tab when created
open, send --match=<value> Any tab matching pattern Exact match on <tab_title> Match criteria for selecting the target tab
open, send --keep-focus Keep focus on the current tab instead of switching
open, send --location=<value> by-title, first, last, before, after, neighbor by-title Position where the new tab is inserted. by-title maintains alphabetical order by placing the new tab to the left of the first tab with a title that sorts after it. See location modes for the other options
open Additional args… Any launch command argument None Extra arguments passed to launch when creating a new tab

Inspiration

  • Jumpapp is "A run-or-raise application switcher for any X11 desktop" and the main inspiration for this kitten. Jumptab gives you similar functionality, but for Kitty tabs instead of OS windows.
  • Tab switcher kitten I used this for while and then decided to roll my own solution, because I needed more flexibility.
  • i3wm, a tiling window manager. This kitten handles tab navigation in a way similar to how i3 handles workspace navigation.