Project

General

Profile

Actions

Feature #8201

closed

Turn off builded colorizing

Added by Versum (Denis Zinin) over 11 years ago. Updated almost 11 years ago.

Status:
Closed
Target version:
-
[ruby-core:53879]

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 1 (0 open1 closed)

Related to Ruby master - Bug #8202: Turn off builded colorizingClosed04/02/2013Actions

Updated by luislavena (Luis Lavena) over 11 years ago

  • Status changed from Open to Assigned
  • Assignee set to usa (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.

Updated by Versum (Denis Zinin) over 11 years 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.

Actions #3

Updated by luislavena (Luis Lavena) over 11 years ago

  • Tracker changed from Backport to Feature
  • Project changed from Backport200 to Ruby master

Updated by nobu (Nobuyoshi Nakada) over 11 years 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.

Actions #5

Updated by nobu (Nobuyoshi Nakada) over 11 years 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. [ruby-core:53879]
    [Bug #8201]

Updated by nobu (Nobuyoshi Nakada) over 11 years ago

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

Updated by Versum (Denis Zinin) over 11 years 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.

Updated by Versum (Denis Zinin) over 11 years 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. [ruby-core:53879]
    [Bug #8201]

Updated by usa (Usaku NAKAMURA) over 11 years ago

  • Status changed from Open to Assigned
  • Assignee changed from usa (Usaku NAKAMURA) to nobu (Nobuyoshi Nakada)

Updated by Versum (Denis Zinin) about 11 years 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.

Actions #11

Updated by nobu (Nobuyoshi Nakada) about 11 years 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 (console_emulator_p, constat_handle): disable built-in
    console colorizing when console-emulator-like DLL is injected.
    [Feature #8201]

Updated by Versum (Denis Zinin) almost 11 years ago

Good Day!

Which version of ruby have resolved issue?

2.0.0-p353 still have problem.

Updated by nobu (Nobuyoshi Nakada) almost 11 years ago

Trunk.

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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0