$ 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'
select a url containing
#
, (e.g.., https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate), pressx
, tmux will openhttps://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##
: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 istmux run-shell -b 'xdg-open https://pytorch.org/docs/stable/optim.html##how-to-adjust-learning-rate'
Thanks.