@@ -62,6 +62,8 @@ data DisplayAttrCaps = DisplayAttrCaps
62 { setAttrStates :: Maybe CapExpression
62 { setAttrStates :: Maybe CapExpression
63 , enterStandout :: Maybe CapExpression
63 , enterStandout :: Maybe CapExpression
64 , exitStandout :: Maybe CapExpression
64 , exitStandout :: Maybe CapExpression
65+ , enterItalic :: Maybe CapExpression
66+ , exitItalic :: Maybe CapExpression
65 , enterUnderline :: Maybe CapExpression
67 , enterUnderline :: Maybe CapExpression
66 , exitUnderline :: Maybe CapExpression
68 , exitUnderline :: Maybe CapExpression
67 , enterReverseVideo :: Maybe CapExpression
69 , enterReverseVideo :: Maybe CapExpression
@@ -227,6 +229,8 @@ currentDisplayAttrCaps ti
227 <*> probeCap ti "sgr"
229 <*> probeCap ti "sgr"
228 <*> probeCap ti "smso"
230 <*> probeCap ti "smso"
229 <*> probeCap ti "rmso"
231 <*> probeCap ti "rmso"
232+ <*> probeCap ti "sitm"
233+ <*> probeCap ti "ritm"
230 <*> probeCap ti "smul"
234 <*> probeCap ti "smul"
231 <*> probeCap ti "rmul"
235 <*> probeCap ti "rmul"
232 <*> probeCap ti "rev"
236 <*> probeCap ti "rev"
@@ -434,6 +438,7 @@ data DisplayAttrSeq
434data DisplayAttrState = DisplayAttrState
438data DisplayAttrState = DisplayAttrState
435 { applyStandout :: Bool
439 { applyStandout :: Bool
436 , applyUnderline :: Bool
440 , applyUnderline :: Bool
441+ , applyItalic :: Bool
437 , applyReverseVideo :: Bool
442 , applyReverseVideo :: Bool
438 , applyBlink :: Bool
443 , applyBlink :: Bool
439 , applyDim :: Bool
444 , applyDim :: Bool
@@ -444,6 +449,7 @@ sgrArgsForState :: DisplayAttrState -> [CapParam]
444sgrArgsForState attrState = map (\b -> if b then 1 else 0)
449sgrArgsForState attrState = map (\b -> if b then 1 else 0)
445 [ applyStandout attrState
450 [ applyStandout attrState
446 , applyUnderline attrState
451 , applyUnderline attrState
452+ , applyItalic attrState
447 , applyReverseVideo attrState
453 , applyReverseVideo attrState
448 , applyBlink attrState
454 , applyBlink attrState
449 , applyDim attrState
455 , applyDim attrState
@@ -470,6 +476,8 @@ reqDisplayCapSeqFor caps s diffs
470 -- set state cap then just use the set state cap.
476 -- set state cap then just use the set state cap.
471 ( True, True ) -> SetState $ stateForStyle s
477 ( True, True ) -> SetState $ stateForStyle s
479+ noEnterExitCap ApplyItalic = isNothing $ enterItalic caps
480+ noEnterExitCap RemoveItalic = isNothing $ exitItalic caps
473 noEnterExitCap ApplyStandout = isNothing $ enterStandout caps
481 noEnterExitCap ApplyStandout = isNothing $ enterStandout caps
474 noEnterExitCap RemoveStandout = isNothing $ exitStandout caps
482 noEnterExitCap RemoveStandout = isNothing $ exitStandout caps
475 noEnterExitCap ApplyUnderline = isNothing $ enterUnderline caps
483 noEnterExitCap ApplyUnderline = isNothing $ enterUnderline caps
@@ -482,6 +490,8 @@ reqDisplayCapSeqFor caps s diffs
482 noEnterExitCap RemoveDim = True
490 noEnterExitCap RemoveDim = True
483 noEnterExitCap ApplyBold = isNothing $ enterBoldMode caps
491 noEnterExitCap ApplyBold = isNothing $ enterBoldMode caps
484 noEnterExitCap RemoveBold = True
492 noEnterExitCap RemoveBold = True
493+ enterExitCap ApplyItalic = fromJust $ enterItalic caps
494+ enterExitCap RemoveItalic = fromJust $ exitItalic caps
485 enterExitCap ApplyStandout = fromJust $ enterStandout caps
495 enterExitCap ApplyStandout = fromJust $ enterStandout caps
486 enterExitCap RemoveStandout = fromJust $ exitStandout caps
496 enterExitCap RemoveStandout = fromJust $ exitStandout caps
487 enterExitCap ApplyUnderline = fromJust $ enterUnderline caps
497 enterExitCap ApplyUnderline = fromJust $ enterUnderline caps
@@ -495,6 +505,7 @@ stateForStyle :: Style -> DisplayAttrState
495stateForStyle s = DisplayAttrState
505stateForStyle s = DisplayAttrState
496 { applyStandout = isStyleSet standout
506 { applyStandout = isStyleSet standout
497 , applyUnderline = isStyleSet underline
507 , applyUnderline = isStyleSet underline
508+ , applyItalic = isStyleSet italic
498 , applyReverseVideo = isStyleSet reverseVideo
509 , applyReverseVideo = isStyleSet reverseVideo
499 , applyBlink = isStyleSet blink
510 , applyBlink = isStyleSet blink
500 , applyDim = isStyleSet dim
511 , applyDim = isStyleSet dim
@@ -506,6 +517,7 @@ styleToApplySeq :: Style -> [StyleStateChange]
506styleToApplySeq s = concat
517styleToApplySeq s = concat
507 [ applyIfRequired ApplyStandout standout
518 [ applyIfRequired ApplyStandout standout
508 , applyIfRequired ApplyUnderline underline
519 , applyIfRequired ApplyUnderline underline
520+ , applyIfRequired ApplyItalic italic
509 , applyIfRequired ApplyReverseVideo reverseVideo
521 , applyIfRequired ApplyReverseVideo reverseVideo
510 , applyIfRequired ApplyBlink blink
522 , applyIfRequired ApplyBlink blink
511 , applyIfRequired ApplyDim dim
523 , applyIfRequired ApplyDim dim