Earlier quoted context omitted.
There must be a disconnect here, manually entering a single quote, then pasting my URL, then adding the closing quote is precisely what I wish to avoid. Here is a demonstration about what I'm talking about: https://i.imgur.com/d64lwaB.mp4 > "We don't attempt to detect URLs because that can go wrong, and because we don't know your intention." That much I've gathered from seeing this issue raised with fish people in th…
> How often do users of the fish shell paste a string that starts with 'http' and contains a '?' that is meant to be a wildcard? Okay. Now you can do it for http. What about ftp? Or "file://"? Do we detect _all_ kinds of URLs? And even if we do, and we don't miss some or see something as a URL that isn't, what about _other_ kinds of things? What about shellscript? E.g. if I want to just execute a bash one-liner from…
Some is better than none, that's the lesson learned from OMZ's implementation of this feature. It doesn't cover every single scenario, but it covers enough to make people's lives easier in the common cases. That is the sort of bold decision making that the fish developers should be doing.
`bash -c '`
sftp://${SFTP_USER}:${SFTP_PASSWORD}@example.com/directory/filename
Both of these get pasted unchanged in zsh. I suggest you try it out. But more to your point, this would get improperly escaped: http://${SFTP_USER}:${SFTP_PASSWORD}@example.com/directory/filename
And you know what? That's fine. Because whether you choose to auto-escape or not, something will break. The question you and the fish developers should be asking is which is more likely? Auto-escaping works the vast majority of the time and only fails some of the time. And when it fail in the rare case, the UX is no worse than when it fails in the common case.>"If you paste it insde single-quotes, it'll be escaped."
First of all, that's not what I see. Maybe you're talking about bracketed paste mode or something that's invisible to the user, but when I paste a URL containing wildcards into single quotes in fish, I don't see any escaping taking place. I assume single quotes are the "verbatim quotes", e.g. `ls '*.txt'` doesn't show you all txt files because that wildcard isn't expanded inside those single quotes. With that in mind, it's not clear to me why a string pasted into single quotes should be escaped, it doesn't need escaping and I don't see any escaping being done when I try it out myself.
There's nothing magic about making `mpv 'https://www.youtube.com/watch?v=LBoF1e5YDdQ'` work. Dumb old bash accepts that too.