Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add support for ECMA-48 escape sequence for italic

Closes #443
  • Loading branch information...
commit 06561d350036d972507dc155ee10dfa65f9d697e 1 parent d871161
@Tracerneo Tracerneo authored committed
View
6 src/terminal/terminalframebuffer.cc
@@ -388,7 +388,7 @@ void DrawState::resize( int s_width, int s_height )
}
Renditions::Renditions( int s_background )
- : bold( false ), underlined( false ), blink( false ),
+ : bold( false ), italic( false ), underlined( false ), blink( false ),
inverse( false ), invisible( false ), foreground_color( 0 ),
background_color( s_background )
{}
@@ -397,7 +397,7 @@ Renditions::Renditions( int s_background )
void Renditions::set_rendition( int num )
{
if ( num == 0 ) {
- bold = underlined = blink = inverse = invisible = false;
+ bold = italic = underlined = blink = inverse = invisible = false;
foreground_color = background_color = 0;
return;
}
@@ -426,6 +426,7 @@ void Renditions::set_rendition( int num )
switch ( num ) {
case 1: case 22: bold = (num == 1); break;
+ case 3: case 23: italic = (num == 3); break;
case 4: case 24: underlined = (num == 4); break;
case 5: case 25: blink = (num == 5); break;
case 7: case 27: inverse = (num == 7); break;
@@ -453,6 +454,7 @@ std::string Renditions::sgr( void ) const
ret.append( "\033[0" );
if ( bold ) ret.append( ";1" );
+ if ( italic ) ret.append( ";3" );
if ( underlined ) ret.append( ";4" );
if ( blink ) ret.append( ";5" );
if ( inverse ) ret.append( ";7" );
View
4 src/terminal/terminalframebuffer.h
@@ -44,7 +44,7 @@
namespace Terminal {
class Renditions {
public:
- bool bold, underlined, blink, inverse, invisible;
+ bool bold, italic, underlined, blink, inverse, invisible;
int foreground_color;
int background_color;
@@ -58,7 +58,7 @@ namespace Terminal {
bool operator==( const Renditions &x ) const
{
- return (bold == x.bold) && (underlined == x.underlined)
+ return (bold == x.bold) && (italic == x.italic) && (underlined == x.underlined)
&& (blink == x.blink) && (inverse == x.inverse)
&& (invisible == x.invisible) && (foreground_color == x.foreground_color)
&& (background_color == x.background_color);
Please sign in to comment.
Something went wrong with that request. Please try again.