tmux-plugins/tmux-open

Bug when opening a file with spaces with <Ctrl-o>

bruno- opened this issue · 1 comments

Thanks to David Melech for reporting this issue.

Here are the steps to reproduce the issue:

  • in tmux copy mode, highlight a file with a space in it. For example: '~/some file'
  • try to open it in vim with prefix + Ctrl-o
  • the bug will manifest now: the plugin executes the following command vim -- ~/somefile (notice the space in ~/some file is gone

This core of the issue falls back how tmux send-keys command works.
It can be reproduced like this:

tmux send-keys foo bar
# output (bad): "foobar"

When arguments are quoted:

tmux send-keys 'foo bar'
# output (good): "foo bar"

In short, arguments need to be quoted.