Friday, January 18, 2019

[Question] How to automatically check background color?

Hi!

I'm currently trying to write test script for checking background type (based on terminal color) in Vim. I have 'dark' terminal, so Vim normally recognizes it and sets 'background' to 'dark', but when I use:

$ vim -c 'redir @">|silent set bg?|redir END|enew|put|w! testfile|q'

then I have 'backgroung=light' (I think it is default, according some test scripts in src/testdir). Vim will probably communicate with terminal about background after my command is done, so the value is correct in fully loaded Vim... is there a way how to get correct value of 'background'?

Thank you in advance and have a nice day,

Zdenek

--
--
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: