[bug] url containing '#' will fail
Freed-Wu opened this issue · 0 comments
Freed-Wu commented
set -g @plugin tmux-plugins/tmux-open
set -g @open x
select a url containing #
, (e.g.., https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate), press x
, tmux will open https://pytorch.org/docs/stable/optim.htmldesktopow-to-adjust-learning-rate
, not containing #h
(my host name is desktop). Bug comes from https://github.com/tmux-plugins/tmux-open/blob/master/open.tmux#L39, should escape #
to ##
:
$ man tmux
...
‘#S’; ‘##’ is replaced by a single ‘#’, ‘#,’ by a ‘,’ and ‘#}’ by a ‘}’.
...
If tmux run-shell -b 'xdg-open https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate'
, the bug will occur. The correct way is tmux run-shell -b 'xdg-open https://pytorch.org/docs/stable/optim.html##how-to-adjust-learning-rate'
Thanks.