-
I can't wait to experience new features. I’ve switched to the nightly version. I see support for drawing tabs in Python, But I don’t know where to write code (I use Python in my work) . Can you give me some pointers? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
https://github.com/kovidgoyal/kitty/blob/master/kitty/tab_bar.py See ~/.config/kitty/tab_bar.py from kitty.fast_data_types import Screen
# from kitty.rgb import Color
# from kitty.utils import color_as_int
from kitty.tab_bar import DrawData, ExtraData, TabBarData
# from kitty.tab_bar import as_rgb, draw_title
def draw_tab(
draw_data: DrawData, screen: Screen, tab: TabBarData,
before: int, max_title_length: int, index: int, is_last: bool,
extra_data: ExtraData
) -> int:
# Draw your own tab with `screen.draw()`, `screen.apply_sgr()`.
# You can use the function `draw_title(draw_data, screen, tab, index)`.
# Move the cursor by assigning the value to `screen.cursor.x`.
# Set the color and style with `screen.cursor.fg: int, bg: int, bold: bool, italic: bool`.
# Returns the position of the cursor after the tab has been drawn.
end = screen.cursor.x
return end |
Beta Was this translation helpful? Give feedback.
-
Hello. Can't find this feature's documentation on official page. Could you provide minimal config to make tabs edges rounded? So basically speaking I want to be able to change tabs surrounding symbols. |
Beta Was this translation helpful? Give feedback.
https://github.com/kovidgoyal/kitty/blob/master/kitty/tab_bar.py
See
draw_tab_with_*
, e.g.draw_tab_with_separator()
.~/.config/kitty/tab_bar.py