[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why both ^[(B^[[m and ^[[m work on my terminal?

From: Chris Page
Subject: Re: Why both ^[(B^[[m and ^[[m work on my terminal?
Date: Wed, 10 Jun 2015 18:43:02 -0700

> On Jun 10, 2015, at 6:18 PM, Peng Yu <address@hidden> wrote:
> What is the difference between ^[(B^[[m and ^[[m?

“ESC ( B” is the “SCS – Select Character Set” command for setting the character 
set to ASCII.

“ESC [ m” is the “SGR – Select Graphic Rendition” command for resetting the 
text attributes (color, style, etc.).

For xterm-256color, “sgr0” is defined to reset both the character set and the 
text attributes.

These codes are described in the VT100 manual


and in the XTerm documentation


The reason it sends “ESC ( B” is in case some other character set is selected. 
A common issue is when the graphic character set for drawing lines and boxes is 
left selected when it shouldn't be. Resetting the character set ensures that 
new text is readable.

Chris Page

reply via email to

[Prev in Thread] Current Thread [Next in Thread]