tmux-plugins / tmux-open

Tmux key bindings for quick opening of a highlighted file or url
MIT License
619 stars 63 forks source link

Not working for specific URLs #37

Closed oblitum closed 5 years ago

oblitum commented 5 years ago

Hi, thanks for this nice plugin I've been using for years.

I noticed there are some URLs that tmux-open will cut and when opened in the browser they just lead to website's home page. For example, URL https://www.youtube.com/watch?time_continue=3&v=I9NCiAVc0-0 will just cause tmux-open to go to youtube homescreen for me. If I copy the URL with prefix<c-u><c-y> (instead of opening with prefix<c-u><c-o>) and paste it in the browser, the URL follows fine.

oblitum commented 5 years ago

This is very weird, now I know why it doesn't work, and why it works just first time after reloading configuration. Just after reloading tmux.conf:

> tmux list-keys

bind-key  -T copy-mode-vi o  send-keys -X copy-pipe-and-cancel "xargs -I {} tmux run-shell -b 'cd #{pane_current_path}; xdg-open \"{}\" > /dev/null'"

Then you execute prefix<c-u><c-o> once, it will work, but checking tmux list-keys again, it has changed???

> tmux list-keys

bind-key  -T copy-mode-vi o  send-keys -X copy-pipe-and-cancel "xargs -I {} tmux run-shell -b 'cd #{pane_current_path}; xdg-open {} > /dev/null'"

xdg-open \"{}\" got replaced by xdg-open {}, hence the issue. Dunno why this happens, maybe a tmux bug. Now prefix<c-u><c-o> for such URLs won't work anymore until reload. Unsure but there may be a vulnerability here too.

oblitum commented 5 years ago

xdg-open \"{}\" got replaced by xdg-open {}, hence the issue. Dunno why this happens, maybe a tmux bug. Now prefix<c-u><c-o> for such URLs won't work anymore until reload. Unsure but there may be a vulnerability here too.

It's tmux-copycat that's causing this.