Commit 6e011bc
fix(tui): improve clipboard handling for Linux and Windows (#493)
This fixes clipboard issues in the login screen where:
- On Linux: clipboard content was dropped when the Clipboard object went
out of scope before the clipboard manager received the data
- On Windows: clipboard content could be released too quickly
Changes:
1. login_screen.rs: Use the existing safe_clipboard_copy() function instead
of directly using arboard::Clipboard. This centralizes clipboard logic.
2. terminal.rs: Improve safe_clipboard_copy() with platform-specific handling:
- Linux: Already uses SetExtLinux::wait() to ensure clipboard manager
receives data before the Clipboard object is dropped
- Windows: Added a small delay (10ms) after set_text() to ensure the
clipboard operation completes before the object is dropped
- Other platforms: Standard behavior
The safe_clipboard_copy function now properly handles clipboard operations
across all major platforms.
Co-authored-by: Droid Agent <droid@factory.ai>1 parent b1b54bf commit 6e011bc
2 files changed
Lines changed: 23 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
505 | | - | |
| 505 | + | |
| 506 | + | |
506 | 507 | | |
507 | | - | |
508 | | - | |
| 508 | + | |
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
863 | 863 | | |
864 | 864 | | |
865 | 865 | | |
| 866 | + | |
| 867 | + | |
866 | 868 | | |
867 | 869 | | |
868 | 870 | | |
| |||
871 | 873 | | |
872 | 874 | | |
873 | 875 | | |
874 | | - | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
875 | 894 | | |
876 | 895 | | |
877 | 896 | | |
| |||
0 commit comments