Monday, May 23, 2016

Channel commands: special characters, quotes and escaping

Hi list!

I'm currently playing around with the new channel support and came across something I do not fully understand. Playing around with the demoserver.py I tried to send a command to my vim-instance via feedkeys. The original command was:

:call feedkeys("ggOHello, world!\e")

From within vim this works. I tried to enter it in the server stdin as:

["ex", "..."]

and had to fight with the nested quotes. The special character "\e" is only accepted within double-quotes. So I tried to include the whole call-command in single quotes which is not accepted by the default handler leaving me with

["ex", 'call feedkeys("ggOHello, world!\e")']
> Decoding failed - discarding input

in the ch_log. A working version is

["ex", "call feedkeys(\"ggOHello, world!\\e\")"]

with a lot of escapes. I do not understand why the first solution does not work.

Tanks
Jan

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment