Phase 4 (fish config): - Fix ip function: replace load-time `which` with `command ip` wrapper - Fix 1Password socket: use -S (socket test) instead of -f, export with -gx - Remove deprecated fish plugins: github-copilot-cli, pisces Phase 5 (repo structure): - Move tpm and kitty-themes to .chezmoiexternal.toml (git-repo externals) - Delete unused tmux-mighty-scroll (not referenced in tmux.conf) - Expand .chezmoiignore: karabiner macOS-only, skip auto-backups/__pycache__ - Remove orphans: duplicate xterm-kitty, empty ssh.conf, karabiner backups - Remove kitty.fish from tracking (auto-generated by kitty) Phase 6 (terminal config): - Comment out debug print in kitty tab_bar.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
45 lines
1.4 KiB
Python
45 lines
1.4 KiB
Python
from kitty.fast_data_types import Screen
|
|
from kitty.tab_bar import DrawData, ExtraData, TabBarData, 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:
|
|
orig_fg = screen.cursor.fg
|
|
orig_bg = screen.cursor.bg
|
|
left_sep, right_sep = ('', '')
|
|
|
|
def draw_sep(which: str) -> None:
|
|
screen.cursor.bg = int(draw_data.default_bg)
|
|
screen.cursor.fg = orig_bg
|
|
screen.draw(which)
|
|
screen.cursor.bg = orig_bg
|
|
screen.cursor.fg = orig_fg
|
|
|
|
if max_title_length <= 1:
|
|
screen.draw('…')
|
|
elif max_title_length == 2:
|
|
screen.draw('…|')
|
|
elif max_title_length < 6:
|
|
draw_sep(left_sep)
|
|
screen.draw((' ' if max_title_length == 5 else '') + '…' + (' ' if max_title_length >= 4 else ''))
|
|
draw_sep(right_sep)
|
|
else:
|
|
draw_sep(left_sep)
|
|
screen.draw(' ')
|
|
draw_title(draw_data, screen, tab, index)
|
|
extra = screen.cursor.x - before - max_title_length
|
|
# print("extra:%d" %(extra))
|
|
if extra >= 0:
|
|
screen.cursor.x -= extra + 3
|
|
screen.draw('…')
|
|
elif extra == -1:
|
|
screen.cursor.x -= 2
|
|
screen.draw('…')
|
|
screen.draw(' ')
|
|
draw_sep(right_sep)
|
|
draw_sep(' ')
|
|
|
|
return screen.cursor.x
|