Skip to content

Clipboard size limit #3937

@wincent

Description

@wincent

Describe the bug

Stuff copied to the clipboard via kitty +kitten clipboard or an explicit OSC 52 escape sequence created with printf fails silently above a certain size.

To Reproduce
Steps to reproduce the behavior:

Use seq to generate a large chunk of output to see where copies start failing:

  1. seq 1 914979 | kitty +kitten clipboard and inspect clipboard — sequence is there.
  2. seq 1 914980 | kitty +kitten clipboard and inspect clipboard — copy failed silently.
  3. seq 1 10000000 | pbcopy (ie. pipe to macOS clipboard tool) and inspect clipboard — even very large sequence is there.

Alternative, in Bash:

seq 1 914979 | printf "\e]52;c;%s\a" "$(cat - | openssl base64 -A)" # sequence gets copied
seq 1 914980 | printf "\e]52;c;%s\a" "$(cat - | openssl base64 -A)" # sequence does not get copied

Environment details

kitty 0.22.2 created by Kovid Goyal
Darwin gregorys-mbp 20.5.0 Darwin Kernel Version 20.5.0: Sat May  8 05:10:31 PDT 2021; root:xnu-7195.121.3~9/RELEASE_ARM64_T8101 arm64
ProductName:	macOS ProductVersion:	11.4 BuildVersion:	20F71
Loaded config files:
  /Users/wincent/.config/kitty/kitty.conf

Config options different from defaults:
active_tab_font_style     (False, False)
active_tab_title_template  « {fmt.bold}{title}{fmt.nobold} » 
disable_ligatures         2
enable_audio_bell         False
font_family               Source Code Pro
font_size                 12.0
hide_window_decorations   1
inactive_tab_font_style   (False, True)
tab_bar_edge              1
tab_bar_style             separator
tab_separator             │
tab_title_template           {title}   
Added mouse actions:
	 cmd+b1 repeat ungrabbed KeyAction('mouse_click_url')
	 cmd+b1 repeat grabbed KeyAction('mouse_click_url')
Added shortcuts:
	ctrl+i KeyAction('send_text', ('application', b'H'))
Colors:
	active_tab_background     #40383a   
	active_tab_foreground     #ffffff   
	inactive_tab_background   #1e1a1a   
	inactive_tab_foreground   #b5b5b4   
	tab_bar_background        #1e1a1a   

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions