trogon icon indicating copy to clipboard operation
trogon copied to clipboard

Improve file drag and drop support

Open IceFreez3r opened this issue 10 months ago • 2 comments

Dragging a file from the explorer into the terminal enters its path. Since the path could contain special characters, it is escaped with double quotes " on Windows or single quotes ' on Ubuntu 24. The problem is that trogon escapes the input an additional time. So the executed command looks something like this:

script.py --output '"D:\path\to\file.txt"'

The parsed path therefore still contains the quotes leading to a FileNotFoundError. I'd suggest, that trogon should detect when the input is already escaped and not escape it an additional time.

IceFreez3r avatar Feb 24 '25 12:02 IceFreez3r

Thanks for the report @IceFreez3r—this does not appear to be the case in macOS, so seems Windows and Linux specific. I unfortunately don't have access to either type of system at the moment so not sure if I'll be able to effectively test this myself, but happy to accept PRs to this effect!

daneah avatar Mar 06 '25 11:03 daneah

On macOS it just inserts the path without escaping it? What if the path contains special characters?

IceFreez3r avatar Mar 06 '25 12:03 IceFreez3r