Skip to content

Conversation

@oblitum
Copy link
Contributor

@oblitum oblitum commented Dec 15, 2018

This is a tmux-open keybinding just after (re)loading 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> once, it will work, but checking tmux list-keys again, the tmux-open keybinding 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 {} , and tmux-open won't work for URLs containing & and other special chars anymore until reload. There may be a vulnerability here too (because of &some_bad_command).

Migrated from: tmux-plugins/tmux-open#37.

@oblitum oblitum changed the title Triggering tmux-copycat cause alter other keybindings Triggering tmux-copycat cause changes to other keybindings Dec 15, 2018
@oblitum
Copy link
Contributor Author

oblitum commented Dec 15, 2018

I think it's due to #119. I think it's possibly not saving/restoring keybinding correctly, like not escaping it properly.

@oblitum oblitum changed the title Triggering tmux-copycat cause changes to other keybindings Triggering tmux-copycat cause unwanted changes to other keybindings Dec 15, 2018
@oblitum
Copy link
Contributor Author

oblitum commented Dec 15, 2018

#121 and #122 are also related.

@oblitum
Copy link
Contributor Author

oblitum commented Dec 15, 2018

@bruno- I've converted the issue into a pull.

@oblitum oblitum changed the title Triggering tmux-copycat cause unwanted changes to other keybindings Fix unwanted changes to other keybindings Dec 15, 2018
@bruno- bruno- merged commit e95528e into tmux-plugins:master Dec 15, 2018
@bruno-
Copy link
Member

bruno- commented Dec 15, 2018

Thanks!

@oblitum
Copy link
Contributor Author

oblitum commented Dec 16, 2018

@bruno- this won't fix it all for tmux-open though.. In the binding

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'"

The xdg-open \"{}\" part will not honor URLs containing quotes, which is pretty common, for example: https://duckduckgo.com/?q="double+quotes". It will strip them and turn it into https://duckduckgo.com/?q=double+quotes.

  • tmux-copycat will not select it correctly too, just up to the first double quote: https://duckduckgo.com/?q=.
  • tmux-yank has presented no issues on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants