[ruby-dev:48485] [ruby-trunk - Bug #10158] [Closed] Windowsにてエスケープシーケンスのreverse指定が正常に処理されない

From: nobu@...
Date: 2014-08-21 08:10:46 UTC
List: ruby-dev #48485
Issue #10158 has been updated by Nobuyoshi Nakada.

Status changed from Open to Closed
% Done changed from 0 to 100

Applied in changeset r47241.

----------
win32.c: manage reverse video

* win32/win32.c (constat_attr): manage reverse video internally
  since Windows console window does not manage it.  based on the
  patch by white leaf in [ruby-dev:48483].  [Bug #10158]

----------------------------------------
Bug #10158: Windowsにてエスケープシーケンスのreverse指定が正常に処理されない
https://bugs.ruby-lang.org/issues/10158#change-48432

* Author: white leaf
* Status: Closed
* 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上のcmd.exeでRuby2.2.0を実行した場合、reverse (ESC[7m) が正常に処理されない。
(2.0.0から継続してダメ)

サンプルコード

```ruby
# reverseの状態が維持されない
s = "\e[7mAA\e[1mBB\e[31mCC\e[7mDD\e[0m"
p s; puts s

# HOGEの文字にboldが反映されない
s = "\e[7;1;31m!?\e[41mHOGE\e[0m"
p s; puts s

# reverseとboldの順番を変えると表示も変わってしまう
s = "\e[1;7;31mHOGE\e[0m  \e[7;1;31mHOGE\e[0m"
p s; puts s
```

色についてなのでわかりづらいので下記画像を参照して下さい。

修正前
http://i.gyazo.com/24c43cce3c6435d04336d5b24663ca63.png
修正後
http://i.gyazo.com/cd6cf42235096f9c8dd57ea52b9975ff.png

添付のパッチで(少なくとも上記のパターンは)直ります。




参考画像:
MacOSXの標準ターミナル
http://i.gyazo.com/230ebb61fbdac07c2cbc062e89ff96d4.png

mintty(cygwin)
http://i.gyazo.com/206eef477983ec28b31b6bcbb85b3a55.png

---Files--------------------------------
win32.c.patch (1.85 KB)


-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next