@@ -62,6 +62,8 @@ data DisplayAttrCaps = DisplayAttrCaps
6262 { setAttrStates :: Maybe CapExpression
6363 , enterStandout :: Maybe CapExpression
6464 , exitStandout :: Maybe CapExpression
65+ , enterItalic :: Maybe CapExpression
66+ , exitItalic :: Maybe CapExpression
6567 , enterUnderline :: Maybe CapExpression
6668 , exitUnderline :: Maybe CapExpression
6769 , enterReverseVideo :: Maybe CapExpression
@@ -227,6 +229,8 @@ currentDisplayAttrCaps ti
227229 <*> probeCap ti "sgr"
228230 <*> probeCap ti "smso"
229231 <*> probeCap ti "rmso"
232+ <*> probeCap ti "sitm"
233+ <*> probeCap ti "ritm"
230234 <*> probeCap ti "smul"
231235 <*> probeCap ti "rmul"
232236 <*> probeCap ti "rev"
@@ -434,6 +438,7 @@ data DisplayAttrSeq
434438data DisplayAttrState = DisplayAttrState
435439 { applyStandout :: Bool
436440 , applyUnderline :: Bool
441+ , applyItalic :: Bool
437442 , applyReverseVideo :: Bool
438443 , applyBlink :: Bool
439444 , applyDim :: Bool
@@ -444,6 +449,7 @@ sgrArgsForState :: DisplayAttrState -> [CapParam]
444449sgrArgsForState attrState = map (\b -> if b then 1 else 0)
445450 [ applyStandout attrState
446451 , applyUnderline attrState
452+ , applyItalic attrState
447453 , applyReverseVideo attrState
448454 , applyBlink attrState
449455 , applyDim attrState
@@ -470,6 +476,8 @@ reqDisplayCapSeqFor caps s diffs
470476 -- set state cap then just use the set state cap.
471477 ( True, True ) -> SetState $ stateForStyle s
472478 where
479+ noEnterExitCap ApplyItalic = isNothing $ enterItalic caps
480+ noEnterExitCap RemoveItalic = isNothing $ exitItalic caps
473481 noEnterExitCap ApplyStandout = isNothing $ enterStandout caps
474482 noEnterExitCap RemoveStandout = isNothing $ exitStandout caps
475483 noEnterExitCap ApplyUnderline = isNothing $ enterUnderline caps
@@ -482,6 +490,8 @@ reqDisplayCapSeqFor caps s diffs
482490 noEnterExitCap RemoveDim = True
483491 noEnterExitCap ApplyBold = isNothing $ enterBoldMode caps
484492 noEnterExitCap RemoveBold = True
493+ enterExitCap ApplyItalic = fromJust $ enterItalic caps
494+ enterExitCap RemoveItalic = fromJust $ exitItalic caps
485495 enterExitCap ApplyStandout = fromJust $ enterStandout caps
486496 enterExitCap RemoveStandout = fromJust $ exitStandout caps
487497 enterExitCap ApplyUnderline = fromJust $ enterUnderline caps
@@ -495,6 +505,7 @@ stateForStyle :: Style -> DisplayAttrState
495505stateForStyle s = DisplayAttrState
496506 { applyStandout = isStyleSet standout
497507 , applyUnderline = isStyleSet underline
508+ , applyItalic = isStyleSet italic
498509 , applyReverseVideo = isStyleSet reverseVideo
499510 , applyBlink = isStyleSet blink
500511 , applyDim = isStyleSet dim
@@ -506,6 +517,7 @@ styleToApplySeq :: Style -> [StyleStateChange]
506517styleToApplySeq s = concat
507518 [ applyIfRequired ApplyStandout standout
508519 , applyIfRequired ApplyUnderline underline
520+ , applyIfRequired ApplyItalic italic
509521 , applyIfRequired ApplyReverseVideo reverseVideo
510522 , applyIfRequired ApplyBlink blink
511523 , applyIfRequired ApplyDim dim