2016-07-13 3:44 GMT+03:00 Rafal <vim-dev-git...@256bit.org>:

> I'm using ex/vi with vagrant and each time when I'm printing verbose
> messages, they're scrambled across multiple lines, e.g.
>
> $ vagrant provision
> ==> default: Running provisioner: shell...
>     default: Running: inline script
> ==> default: stdin: is not a tty
> ==> default: Foo bar
> ==> default: "
> ==> default: /
> ==> default: e
> ==> default: t
> ==> default: c
> ==> default: /
> ==> default: h
> ==> default: o
> ==> default: s
> ==> default: t
> ==> default: s
> ==> default: "
> ==> default:
> ==> default: "
> ==> default: /
> ==> default: e
> ==> default: t
> ==> default: c
> ==> default: /
> ==> default: h
> ==> default: o
> ==> default: s
> ==> default: t
> ==> default: s" 7 lines, 197 characters
>
> I'm running:
>
> ex -scq! -V1 /etc/hosts
>
> My Vagrantfile:
>
> Vagrant.configure(2) do |config|
>   config.vm.box = "debian/jessie64"
>
>   config.vm.provision "shell", inline: <<-SHELL
>     echo Foo bar >&2
>     ex -scq! -V1 /etc/hosts
>   SHELL
> end
>
> This is especially trouble when I'm writing the output during VM
> provisioning into the log file such as building apps using Jenkins CI, so
> these messages are not readable at all.
>
> I assume Vim sending these verbose messages per character basis without
> buffering? Is there any solution to that issue?
>

​I guess you found a reason for the problem I see with hilite: Russian
messages from Vim look like

    [0m�тк[0m�[0m�[0m�ие [0m�[0m�[0m�пл[0m�[0m� X за[0m�яло 1 msec
    Открытие дис[0m�ле[0m� X з[0m�няло 5 msec
    "/etc/hosts"
    "/etc/hosts" [т[0m�[0m�[0m�[0m�[0m� [0m�[0m�[0m�
[0m�[0m�[0m�[0m�[0m�[0m�] [0m�[0m�[0m�[0m�[0m�: 57, [0m�имвол[0m�в: 1913

: hilite surrounds stderr output with escape sequences which make text
foreground red and then `^[[0m​`. But it does not know about multibyte
characters. Most of time this is not a problem because hilite receives the
whole message as one chunk, even if I do `perl -e 'print
("«»«»«»«»«»«»«»«»"x 1024)'>&2` I get only three unexpected [0m occurrences
and normally you will not see such lengthy messages in stderr written by
one write(). With Vim output is completely unreadable as you see above.

Note that stderr itself has no bufferring enabled on its own. Vim is also
not expected to do any bufferring (at least by me). But it *is* expected to
call write() once for the whole message and not do lots of syscalls: I
tried `strace -e write ex -scq! /etc/hosts` and found a huge sequence of
`write(2, "{some char}", 1)` with a bit of `write(2, "\r\n", 2)`
occurrences. This is the most inefficient way of using syscalls I know.



> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/vim/vim/issues/919>, .
>
> --
> --
> You received this message from the "vim_dev" 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_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vim_dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui