3 ms·
Unless the URL contains shell meta characters, such as "&"…
by jwilk 5y ago
Unless the URL contains shell meta characters, such as "&"…
- donio 5y agoModern shells have easy ways to deal with this, for example bracketed-paste-magic that ships with zsh. The URL of this comment pastes like this, ready to be passed to commands: https://news.ycombinator.com/edit\?id\=29069520
- jwilk 5y agoInteresting, thanks. So apparently you're supposed to add autoload -Uz url-quote-magic zle -N self-insert url-quote-magic autoload -Uz bracketed-paste-magic zle -N bracketed-paste bracketed-paste-magic to your zshrc to enable it. It doesn't seem to escape $ (e.g. in <https://example.org/$PATH https://example.org/$PATH>), which doesn't inspire confidence… Are there any equivalents for bash?
- donio 5y agoYou can configure what gets quoted using url-metas: zstyle ':url-quote-magic:*' url-metas '*?[]^()~#{}=$' Not sure about bash, I thought I remembered seeing something similar for it but a quick google doesn't turn up anything.