Feature hasn't been suggested before.
Related issues found: #4668 (drag-and-drop), #6331 (Linux paste in Konsole), #10154 (clipboard paste). This feature request covers all three problems with a unified implementation and additionally adds WezTerm-specific DnD support and non-image file attachment handling, which none of the existing issues address.
Describe the enhancement you want to request
The TUI currently has several limitations with paste and drag-and-drop on Linux:
- Clipboard only reads PNG — images copied as JPEG, WebP, GIF, or BMP are silently ignored because
clipboard.ts hardcodes image/png
- No multi-file paste/drop support — dragging multiple files from a file manager (Nautilus, Thunar) pastes raw paths as text instead of attaching them as files
- No non-image file attachments — PDFs, SVGs, code files, and directories pasted via path are not recognized as attachments
- WezTerm drag-and-drop doesn't work — WezTerm sends
DroppedFile events as space-separated, backslash-escaped paths (via quote_dropped_files = "SpacesOnly"), which is a different format from newline-separated paths that other file managers use
Expected behavior: Dragging files from a file manager into the TUI should display virtual tokens ([Image 1], [File: name.ext], [Dir: dirname/]) instead of raw path text. Clipboard paste should support all common image formats.
Proposed solution (implemented in PR #14552):
- Dynamic MIME discovery in
clipboard.ts — probe clipboard for PNG → JPEG → WebP → GIF → BMP in priority order
- Rewritten
onPaste handler — supports newline-separated paths (Nautilus/Thunar), space-separated escaped paths (WezTerm), and single file paths
pasteFile() function for non-image attachments
shellTokens() parser for WezTerm's escaped filename format
Feature hasn't been suggested before.
Describe the enhancement you want to request
The TUI currently has several limitations with paste and drag-and-drop on Linux:
clipboard.tshardcodesimage/pngDroppedFileevents as space-separated, backslash-escaped paths (viaquote_dropped_files = "SpacesOnly"), which is a different format from newline-separated paths that other file managers useExpected behavior: Dragging files from a file manager into the TUI should display virtual tokens (
[Image 1],[File: name.ext],[Dir: dirname/]) instead of raw path text. Clipboard paste should support all common image formats.Proposed solution (implemented in PR #14552):
clipboard.ts— probe clipboard for PNG → JPEG → WebP → GIF → BMP in priority orderonPastehandler — supports newline-separated paths (Nautilus/Thunar), space-separated escaped paths (WezTerm), and single file pathspasteFile()function for non-image attachmentsshellTokens()parser for WezTerm's escaped filename format