# \[ruby-trunk - Bug #10157\] Windowsにてエスケープシーケンスのunderscore

**URL:** <https://www.ruby-forum.com/t/ruby-trunk-bug-10157-windows-underscore/231639>\
**Category:** Development\
**Created:** [August 20, 2014, 4:58pm UTC](https://www.ruby-forum.com/t/ruby-trunk-bug-10157-windows-underscore/231639 "2014-08-20T16:58:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [August 20, 2014, 4:58pm UTC](https://www.ruby-forum.com/t/ruby-trunk-bug-10157-windows-underscore/231639/1 "2014-08-20T16:58:44Z")

</div>

Issue #10157 has been updated by white leaf.

まさに外部のAnsicolor処理するプログラムが入ってました。昔入れっぱなしにして忘れていたようです…。  
ということでこのチケットは問題なしということで終わりにさせていただきますが、  
2.0から変わってないということで reverse ( ESC[7m ) がおかしいままなので、  
もう少し調査してまた報告させていただきます。

2014年8月20日 22:57 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Issue #10157 has been updated by Usaku NAKAMURA.
> 
> うーん、手元の環境(Windows7 x64)では再現しません。
> 
> 2.0.0とtrunkとのエスケープシーケンス処理の違いは、  
> 「WriteConsoleW APIがフックされている時にrubyで処理するか否か」  
> の1点のみです。  
> 何かその手のツールが入っていたりしませんか？

* * *

Bug #10157: Windowsにてエスケープシーケンスのunderscore指定が正常に動かない

> **[Bug #10157: Windowsにてエスケープシーケンスのunderscore指定が正常に動かない - Ruby master - Ruby...](https://bugs.ruby-lang.org/issues/10157#change-48422)**
>
> Redmine

- Author: white leaf
- Status: Open
- Priority: Normal
- Assignee:
- Category:
- Target version: current: 2.2.0
- ruby -v: ruby 2.2.0dev (2014-08-20 trunk 47225) [i386-mingw32]
- Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN

* * *

Windows7上のRuby（trunk）にて、エスケープシーケンスの ESC[4m (underscore) を指定しても  
下線がつかずに背景がグレーになります。

再現コード  
puts “\e[4mHOGE\e[0m”

結果をテキストじゃ表現できないので画像で。

> **[Gyazo](https://gyazo.com/768625ea6c7ed155029d5863022c48e0)**
>
> Gyazo is the easiest way to record screenshots & videos you can share instantly. Save time with async visual communication that's effortless and engaging.

少なくともRuby2.0では正常だったようです。  
期待した出力はRuby2.0のように下線がつくことです。
