On 2021-03-24, Ron Aaron wrote:
> So what I've come up with is the following, though it seems way too verbose:
> 
> vim --not-a-term --cmd 'redir! >/tmp/vimver.txt|echon v:versionlong|quit'
> verlong=`cat /tmp/vimver.text`
> 
> 
> On Thursday, March 25, 2021 at 7:53:07 AM UTC+2 Ron Aaron wrote:
> 
>     I want to get the vim version for a bash script. The way I'm trying to use
>     is:
> 
>     vim --not-a-term --cmd 'echo v:versionlong|quit'
> 
>     However, that spews a bunch of ANSI terminal control stuff as well, which 
> I
>     don't want. Is there an option to suppress that output?

I was able to suppress it by adding the argument

    --cmd 'set t_cd= t_ce= t_cm=\  t_ve= t_vi='

like this, all on one line:

    vim --not-a-term --cmd 'set t_cd= t_ce= t_cm=\  t_ve= t_vi=' --cmd 'echo 
v:versionlong|quit'

That clears the values of all those escape sequences in the output.
Vim loudly complains if the t_cm sequence is empty, so I just set it
to a space.

It seems to me that the --not-a-term option is not doing everything
it should if Vim outputs terminal escape sequences when no terminal
is supposed to be there.

Regards,
Gary

-- 
-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20210325075240.GA22800%40phoenix.

Raspunde prin e-mail lui