Skip to content

fix clipboard history crash#19

Merged
zortax merged 1 commit intozortax:mainfrom
AlexJonker:clipboard-crash
Jan 13, 2026
Merged

fix clipboard history crash#19
zortax merged 1 commit intozortax:mainfrom
AlexJonker:clipboard-crash

Conversation

@AlexJonker
Copy link
Copy Markdown
Contributor

The small preview cut right trough emojis if the emoji was perfectly placed causing a panic.

The text I had the issue with:

zlaunch on  main [!] is 📦 v0.4.0 via 🦀 v1.92.0-nightly

When you have this in your history and try to open the clipboard the daemon crashes. This pr fixes that.

this was the crash:

thread 'main' (344750) panicked at src/clipboard/item.rs:47:49:
byte index 30 is not a char boundary; it is inside '📦' (bytes 27..31) of `zlaunch on  main [!] is 📦 v0.4.0 via 🦀 v1.92.0-nightly`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The small preview cut right trough emojis if the emoji was perfectly placed causing a panic
Copy link
Copy Markdown
Owner

@zortax zortax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can merge this for now, but I think it would be better to properly handle overflow in the UI anyway instead of cutting the preview string...

@zortax zortax merged commit c091ea3 into zortax:main Jan 13, 2026
1 check passed
@AlexJonker AlexJonker deleted the clipboard-crash branch January 13, 2026 22:53
zortax pushed a commit that referenced this pull request Jan 19, 2026
The small preview cut right trough emojis if the emoji was perfectly placed causing a panic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants