New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No escaping spaces in dropped filenames #474
Comments
This function is commented out as it relies on a KDE library kcoreaddons |
Hmm - the question is: Might be kcoreaddons useful for us in other places too - as kcoreaddons are tier1 i would have no big problems to add the dependency.
|
@tsujan @palinek @luis-pereira @yan12125 - if the addons could solve problem and not introduce new ones - why not? I remember that we depend on kcoreaddons times ago, but don't exactly remember why we dropped them. |
I, personally, don't see the OP as a bug, but a normal behavior. The user has to know if escaping is needed and do escape, what he/she need to escape. |
@palinek - i would see it as a feature too |
I see it as a good feature. If it can be added relatively easily, why not? |
This isn't the case in all terminals. For example, iTerm2 can automatically do escaping of filenames for drag-and-dropped files. And there are zsh or bash add-ons that support quoting or escaping arbitrarily pasted text. The underlying terminal feature used is "bracketed paste mode", which puts a special terminal control sequence before and after pasted text. Then the receiving program (e.g. a shell or text editor) can decide what to do with it, like quoting or escaping it according to their semantics. The terminal knows what text is literal pasted text and needs to be escaped, and the receiving program knows how to do escaping. Maybe QTerminal could add bracketed paste mode support, and let the shell handle the escaping? It might be hard for QTerminal to do quoting of filenames etc. itself, because it doesn't necessarily know the quoting syntax of the frontmost program running inside the terminal. |
I think escaping should be done by the terminal emulator rather than the shell as only the former knows where the string comes from. The string shouldn't be escaped if it's just some plain texts (e.g. dragged-and-dropped from a paragraph on a webpage). As you can see in a linked code segment above,
Just an implementation note - as KF5 does not work well on macOS due to an Qt bug [1], there should be a CMake option to build qterm* without KF5. By the way, bracketed paste works fine on Linux. If it doesn't work for you, it might be a macOS-specific issue. |
No, the user just wants to do drag and drop and it should "just work", as it does with other terminal emulator applciations. By quoting paths dropped onto QTerminal things would become much smoother. Peek.2021-01-13.02-56.mp4(QTerminal 0.15.0 on FreeBSD) |
Turns out that the fix is rather straightforward and does not need to introduce new dependencies: fixed.mp4 |
Allows drag-and-drop of files and directories that have spaces in their paths Closes lxqt/qterminal#474
Allows drag-and-drop of files and directories that have spaces in their paths Closes lxqt/qterminal#474
* Quote drag-and-drop filenames Allows drag-and-drop of files and directories that have spaces in their paths Closes lxqt/qterminal#474 * Correctly quote files with quotes in the filename
Thank you very much @yan12125 |
If a file is dropped into the terminal which has spaces in its name, it should be quoted. QTerminal doesn't quote it or even escaping spaces.
The text was updated successfully, but these errors were encountered: