Feature #8201

Turn off builded colorizing

Added by Denis Zinin about 1 year ago. Updated 4 months ago.

[ruby-core:53879]
Status:Closed
Priority:Normal
Assignee:Nobuyoshi Nakada
Category:-
Target version:-

Description

GD!
 
In Ruby 1.9.3 the output into console does not process escape secuences and it was good for me becouse i use ConEmu. ConEmu can process advanced escape secuences and some tools like pry theming worked perfectly. Now in ruby 2.0.0 the escape secuences are filtered and its bad for me. Pry theming not working. Background lighting (underline escape secuence) not working. Please say how to tirning off buildin in ruby 2.0 escape secuensec processing.


Related issues

Related to ruby-trunk - Bug #8202: Turn off builded colorizing Closed 04/02/2013

Associated revisions

Revision 40078
Added by Nobuyoshi Nakada about 1 year ago

win32.c: pass through unknown sequence

  • win32/win32.c (constat_apply): pass through unknown sequence which starts with ESC but is not followed by a bracket. [Bug #8201]

Revision 40079
Added by Nobuyoshi Nakada about 1 year ago

win32.c: pass through unknown sequence

  • win32/win32.c (constat_apply): pass through unknown sequence which starts with ESC but is not followed by a bracket. [Bug #8201]

Revision 43131
Added by Nobuyoshi Nakada 7 months ago

win32.c: disable console colorizing

  • win32/win32.c (consoleemulatorp, constat_handle): disable built-in console colorizing when console-emulator-like DLL is injected. [Feature #8201]

History

#1 Updated by Luis Lavena about 1 year ago

  • Status changed from Open to Assigned
  • Assignee set to Usaku NAKAMURA

Hello Denis,

As commented on RubyInstaller list, I think will be better to extend the functionality of built-in ANSI coloring instead of disable it.

Please take a look to #6418 were I provide bench results on how external tools monkey patching result in process slowdown:

http://bugs.ruby-lang.org/issues/6418

https://gist.github.com/luislavena/2655794

PS: Please open tickets to trunk, not Ruby 2.0.

#2 Updated by Denis Zinin about 1 year ago

I think it will be better to introduce comand line key to disable builtin escape secuences processing (and it will be so better other way: special key to enable built-in escape processing). Anyway I think ruby never can give so wide support of escape secuences as it potentially can give external terminals. And so support is not ruby mission.

I think unacceptable that ruby forbid correct escape secuencecs output to external terminal. Standart windows console have winapi functions for very poor colorizing support. How do you want realize extended features of escape secuences by built-it in ruby? I want can define 256 palette with 24 bit colors. I want can use 24 bit pry-theme themes. I want can output any custom escape secuences into terminal. Winapi console function can't do that at all. Current approach with builtin escape processing make extended colorizing and others impossible. It seems very very strange that programming language make some output secuences impossible.

In conclusion. It will be better make spetial key or may be gem to enable or disable ruby escape processing for output.

#3 Updated by Luis Lavena about 1 year ago

  • Tracker changed from Backport to Feature
  • Project changed from Backport200 to ruby-trunk

#4 Updated by Nobuyoshi Nakada about 1 year ago

ConEmu doesn't seem working with 1.9.3 to me.
While it shows color bars certainly when `type AnsiColor16.ans', however it does nothing with a command simply writes the same string by WriteConsole or WriteFile, but seems same as a plain command prompt window, e.g., left arrow, a bracket, and so on.

Does anybody see expected results?

Anyhow, I'll fix a bug that ESC not followed by a bracket is dropped.

#5 Updated by Nobuyoshi Nakada about 1 year ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r40078.
Denis, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


win32.c: pass through unknown sequence

  • win32/win32.c (constat_apply): pass through unknown sequence which starts with ESC but is not followed by a bracket. [Bug #8201]

#6 Updated by Nobuyoshi Nakada about 1 year ago

  • Status changed from Closed to Open
  • % Done changed from 100 to 50

#7 Updated by Denis Zinin about 1 year ago

Last development version ConEmu working for me.

nobu (Nobuyoshi Nakada) wrote:

ConEmu doesn't seem working with 1.9.3 to me.
While it shows color bars certainly when `type AnsiColor16.ans', however it does nothing with a command simply writes the same string by WriteConsole or WriteFile, but seems same as a plain command prompt window, e.g., left arrow, a bracket, and so on.

Does anybody see expected results?

Anyhow, I'll fix a bug that ESC not followed by a bracket is dropped.

#8 Updated by Denis Zinin about 1 year ago

Passing unknown escape sequences is not solution. Some escape sequences behaviour is depended from earlier escape sequences or define behaviour of later escape sequences. This is especialy right for colorizing sentences. I think it will be many conflict and wrong behaviour when some colorizing sequences processed by ruby and other colorizing sequences processed by terminal.

nobu (Nobuyoshi Nakada) wrote:

This issue was solved with changeset r40078.
Denis, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


win32.c: pass through unknown sequence

  • win32/win32.c (constat_apply): pass through unknown sequence which starts with ESC but is not followed by a bracket. [Bug #8201]

#9 Updated by Usaku NAKAMURA about 1 year ago

  • Status changed from Open to Assigned
  • Assignee changed from Usaku NAKAMURA to Nobuyoshi Nakada

#10 Updated by Denis Zinin 7 months ago

Problem still exist in p247. Please, remove processing of escape sequences from ruby interpreter (I think this is true solution). Or remove processing unknown sequences.

#11 Updated by Nobuyoshi Nakada 7 months ago

  • Status changed from Assigned to Closed
  • % Done changed from 50 to 100

This issue was solved with changeset r43131.
Denis, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


win32.c: disable console colorizing

  • win32/win32.c (consoleemulatorp, constat_handle): disable built-in console colorizing when console-emulator-like DLL is injected. [Feature #8201]

#12 Updated by Denis Zinin 4 months ago

Good Day!

Which version of ruby have resolved issue?

2.0.0-p353 still have problem.

#13 Updated by Nobuyoshi Nakada 4 months ago

Trunk.

These commits (and r43307, r43331) haven't been backported yet.

Also available in: Atom PDF