AnsiEsc can not show background

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

AnsiEsc can not show background

Peng Yu
Hi,

The following code shows that vim can not show background color correctly form Ansi Color. Is there a command to enable background color? Thanks.

~/linux/test/python/man/library/termcolor/colored/on_red$ cat main.py
#!/usr/bin/env python

from termcolor import colored
print colored('hello', 'white', 'on_red'), colored('world', 'white', 'on_green')

~/linux/test/python/man/library/termcolor/colored/on_red$ type less
less is aliased to `vim -R -c AnsiEsc -'
~/linux/test/python/man/library/termcolor/colored/on_red$ ./main.py |less

Regards,
Peng

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: AnsiEsc can not show background

Charles Campbell
Peng Yu wrote:

> Hi,
>
> The following code shows that vim can not show background color correctly form Ansi Color. Is there a command to enable background color? Thanks.
>
> ~/linux/test/python/man/library/termcolor/colored/on_red$ cat main.py
> #!/usr/bin/env python
>
> from termcolor import colored
> print colored('hello', 'white', 'on_red'), colored('world', 'white', 'on_green')
>
> ~/linux/test/python/man/library/termcolor/colored/on_red$ type less
> less is aliased to `vim -R -c AnsiEsc -'
> ~/linux/test/python/man/library/termcolor/colored/on_red$ ./main.py |less
>
> Regards,
> Peng

I get...
Traceback (most recent call last):
   File "./junk.pm", line 3, in <module>
     from termcolor import colored
ImportError: No module named termcolor
Vim: Reading from stdin...

Regards,
C Campbell

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: AnsiEsc can not show background

Peng Yu
You need to install termcolor (https://pypi.python.org/pypi/termcolor)
first by pip or something else.

On Thu, Dec 12, 2013 at 12:33 PM, Charles Campbell
<[hidden email]> wrote:

> Peng Yu wrote:
>>
>> Hi,
>>
>> The following code shows that vim can not show background color correctly
>> form Ansi Color. Is there a command to enable background color? Thanks.
>>
>> ~/linux/test/python/man/library/termcolor/colored/on_red$ cat main.py
>> #!/usr/bin/env python
>>
>> from termcolor import colored
>> print colored('hello', 'white', 'on_red'), colored('world', 'white',
>> 'on_green')
>>
>> ~/linux/test/python/man/library/termcolor/colored/on_red$ type less
>> less is aliased to `vim -R -c AnsiEsc -'
>> ~/linux/test/python/man/library/termcolor/colored/on_red$ ./main.py |less
>>
>> Regards,
>> Peng
>
>
> I get...
> Traceback (most recent call last):
>   File "./junk.pm", line 3, in <module>
>     from termcolor import colored
> ImportError: No module named termcolor
> Vim: Reading from stdin...
>
> Regards,
> C Campbell
>
>
> --
> --
> 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 a topic in the
> Google Groups "vim_use" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/vim_use/OaASJlRyOGo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [hidden email].
> For more options, visit https://groups.google.com/groups/opt_out.



--
Regards,
Peng

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: AnsiEsc can not show background

Charles Campbell
Peng Yu wrote:
> You need to install termcolor (https://pypi.python.org/pypi/termcolor)
> first by pip or something else.
>
Why not capture the ansi escape sequence involved and tell me what it
is?  If its not an ansi escape sequence, then that likely is beyond the
purview of AnsiEsc.

Regards,
C Campbell

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: AnsiEsc can not show background

Peng Yu
> Why not capture the ansi escape sequence involved and tell me what it is?
> If its not an ansi escape sequence, then that likely is beyond the purview
> of AnsiEsc.

Here is the output of the python script.
 [31mhello [0m  [32mworld [0m

--
Regards,
Peng

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: AnsiEsc can not show background

Charles Campbell
Peng Yu wrote:
>> Why not capture the ansi escape sequence involved and tell me what it is?
>> If its not an ansi escape sequence, then that likely is beyond the purview
>> of AnsiEsc.
> Here is the output of the python script.
>   [31mhello [0m  [32mworld [0m
>
Interpreting this manually:
   <chg to red fgd>hello <reset to normal terminal colorization><chg to
green fgd>world <reset to normal terminal colorization>

When I placed that into a file, inserted the missing escape characters,
and applied AnsiEsc to the file, I got a red "hello", a space, and a
green "world" as I'd expect.  The background is not specified in these
ansi-escape sequences, and so AnsiEsc would be wrong if it did change
the background.

Regards,
C Campbell

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: AnsiEsc can not show background

Peng Yu
I'm sorry. The previous output is wrong. Here is the correct output.

^[[41m^[[37mhello^[[0m ^[[42m^[[37mworld^[[0m

On Thu, Dec 12, 2013 at 3:13 PM, Charles Campbell
<[hidden email]> wrote:

> Peng Yu wrote:
>>>
>>> Why not capture the ansi escape sequence involved and tell me what it is?
>>> If its not an ansi escape sequence, then that likely is beyond the
>>> purview
>>> of AnsiEsc.
>>
>> Here is the output of the python script.
>>   [31mhello [0m  [32mworld [0m
>>
> Interpreting this manually:
>   <chg to red fgd>hello <reset to normal terminal colorization><chg to green
> fgd>world <reset to normal terminal colorization>
>
> When I placed that into a file, inserted the missing escape characters, and
> applied AnsiEsc to the file, I got a red "hello", a space, and a green
> "world" as I'd expect.  The background is not specified in these ansi-escape
> sequences, and so AnsiEsc would be wrong if it did change the background.
>
>
> Regards,
> C Campbell
>
> --
> --
> 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 a topic in the
> Google Groups "vim_use" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/vim_use/OaASJlRyOGo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [hidden email].
> For more options, visit https://groups.google.com/groups/opt_out.



--
Regards,
Peng

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: AnsiEsc can not show background

Christian Brabandt
Hi Peng!

On Do, 12 Dez 2013, Peng Yu wrote:

> I'm sorry. The previous output is wrong. Here is the correct output.
>
> ^[[41m^[[37mhello^[[0m ^[[42m^[[37mworld^[[0m

You can also try my Colorizer plugin
(https://github.com/chrisbra/Color_highlight)
That should be able to handle it.

Best,
Christian
--
Der Verstand ist wie eine Fahrkarte: Sie hat nur dann einen Sinn, wenn
sie benutzt wird.
                -- Ernst R. Hauschka

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: AnsiEsc can not show background

Charles E Campbell Jr
In reply to this post by Peng Yu
Peng Yu wrote:
> I'm sorry. The previous output is wrong. Here is the correct output.
>
> ^[[41m^[[37mhello^[[0m ^[[42m^[[37mworld^[[0m
>
I see the problem and will try to fix it.

Thanks!
Chip Campbell

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: AnsiEsc can not show background

Charles E Campbell Jr
In reply to this post by Peng Yu
Peng Yu wrote:
> I'm sorry. The previous output is wrong. Here is the correct output.
>
> ^[[41m^[[37mhello^[[0m ^[[42m^[[37mworld^[[0m
>
Hello, Peng:

Sorry it took so long -- but I think I have AnsiEsc able to handle the
above.

I've attached a copy.

Regards,
Chip Campbell

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

AnsiEsc.vba.gz (24K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: AnsiEsc can not show background

Peng Yu
I got the following error. Do you know what is wrong?

Also, could you please post it at
<http://www.vim.org/scripts/script.php?script_id=302>.

***vimball*** Source this file to extract it! (:so %)
removed 4 files
Vimball Archive
extracted <plugin/AnsiEscPlugin.vim>: 30 lines
wrote /Users/pengy/.vim/plugin/AnsiEscPlugin.vim
extracted <autoload/AnsiEsc.vim>: 1211 lines
wrote /Users/pengy/.vim/autoload/AnsiEsc.vim
extracted <plugin/cecutil.vim>: 536 lines
wrote /Users/pengy/.vim/plugin/cecutil.vim
extracted <doc/AnsiEsc.txt>: 175 lines
wrote /Users/pengy/.vim/doc/AnsiEsc.txt
did helptags
Error detected while processing SourceCmd Auto commands for "*.vba.gz":
E444: Cannot close last window

On Thu, Dec 11, 2014 at 10:03 PM, Charles E Campbell
<[hidden email]> wrote:

> Peng Yu wrote:
>>
>> I'm sorry. The previous output is wrong. Here is the correct output.
>>
>> ^[[41m^[[37mhello^[[0m ^[[42m^[[37mworld^[[0m
>>
> Hello, Peng:
>
> Sorry it took so long -- but I think I have AnsiEsc able to handle the
> above.
>
> I've attached a copy.
>
> Regards,
> Chip Campbell
>
> --
> --
> 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 a topic in the
> Google Groups "vim_use" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/vim_use/OaASJlRyOGo/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [hidden email].
> For more options, visit https://groups.google.com/d/optout.



--
Regards,
Peng

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: AnsiEsc can not show background

Charles Campbell
Peng Yu wrote:

> I got the following error. Do you know what is wrong?
>
> Also, could you please post it at
> <http://www.vim.org/scripts/script.php?script_id=302>.
>
> ***vimball*** Source this file to extract it! (:so %)
> removed 4 files
> Vimball Archive
> extracted <plugin/AnsiEscPlugin.vim>: 30 lines
> wrote /Users/pengy/.vim/plugin/AnsiEscPlugin.vim
> extracted <autoload/AnsiEsc.vim>: 1211 lines
> wrote /Users/pengy/.vim/autoload/AnsiEsc.vim
> extracted <plugin/cecutil.vim>: 536 lines
> wrote /Users/pengy/.vim/plugin/cecutil.vim
> extracted <doc/AnsiEsc.txt>: 175 lines
> wrote /Users/pengy/.vim/doc/AnsiEsc.txt
> did helptags
> Error detected while processing SourceCmd Auto commands for "*.vba.gz":
> E444: Cannot close last window
>
I am able to duplicate the message "Cannot close last window", so I'll
look into it.  Nonetheless, the AnsiEsc extraction was successful and
helptags generated.

Regards,
Chip Campbell

--
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.