preservim / vimux

easily interact with tmux from vim
MIT License
2.2k stars 159 forks source link

Weird display when VimuxRunCommand with multiple lines of input #106

Closed introom closed 3 years ago

introom commented 10 years ago

Vimux send text to the pane by directly invoking tmux send-keys -t PANE Keys When the keys consists of multiple lines, the output is really ugly. See this picture: http://snag.gy/Vbi5y.jpg

We can see that pane1 sends a "hi\nhi" (\n is C-m in the pic). This results an extra showing of the second "hi" in hizsh: command not found: hi.

I guess if vimux sends the text line by line, this problem won't occur.

alerque commented 3 years ago

The run command is directly passed to the shell. If you send stuff that isn't a valid shell command it's going to echo it back to you with an error. A newline is a shell command separator, so in this example it's going to happen twice. I don't see anything here unexpected or not functioning, sending multiline commands just requires special consideration towards quoting. Also there are better ways to join commands in a single line.

Feel free if there is something else unresolved here, but at least the way I understand the issue (without the benefit of your screen shot) I don't think there is anything to fix here.