Skip to content

Commit 908358a

Browse files
committed
Escape $ before sending commands to tmux. Fixes #39
1 parent c5216bb commit 908358a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plugin/vimux.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,14 @@ class TmuxSession
315315
end
316316

317317
def _send_command(command, target, auto_return = true)
318-
_run("send-keys -t #{target} \"#{command.gsub('"', '\"')}\"")
318+
_run("send-keys -t #{target} \"#{_escape_command(command)}\"")
319319
_run("send-keys -t #{target} Enter") if auto_return
320320
end
321321

322+
def _escape_command(command)
323+
command.gsub('"', '\"').gsub('$', '\$')
324+
end
325+
322326
def _run(command)
323327
`tmux #{command}`
324328
end

0 commit comments

Comments
 (0)