@@ -68,6 +68,8 @@ data DisplayAttrCaps = DisplayAttrCaps
6868 , exitStandout :: Maybe CapExpression
6969 , enterItalic :: Maybe CapExpression
7070 , exitItalic :: Maybe CapExpression
71+ , enterStrikethrough :: Maybe CapExpression
72+ , exitStrikethrough :: Maybe CapExpression
7173 , enterUnderline :: Maybe CapExpression
7274 , exitUnderline :: Maybe CapExpression
7375 , enterReverseVideo :: Maybe CapExpression
@@ -235,6 +237,8 @@ currentDisplayAttrCaps ti
235237 <*> probeCap ti "rmso"
236238 <*> probeCap ti "sitm"
237239 <*> probeCap ti "ritm"
240+ <*> probeCap ti "smxx"
241+ <*> probeCap ti "rmxx"
238242 <*> probeCap ti "smul"
239243 <*> probeCap ti "rmul"
240244 <*> probeCap ti "rev"
@@ -270,7 +274,11 @@ terminfoDisplayContext tActual terminfoCaps r = return dc
270274 , writeSetAttr = terminfoWriteSetAttr dc terminfoCaps
271275 , writeDefaultAttr = \urlsEnabled ->
272276 writeCapExpr (setDefaultAttr terminfoCaps) [] `mappend`
273− (if urlsEnabled then writeURLEscapes EndLink else mempty)
277+ (if urlsEnabled then writeURLEscapes EndLink else mempty) `mappend`
278+ (case exitStrikethrough $ displayAttrCaps terminfoCaps of
279+ Just cap -> writeCapExpr cap []
280+ Nothing -> mempty
281+ )
274282 , writeRowEnd = writeCapExpr (clearEol terminfoCaps) []
275283 , inlineHack = return ()
276284 }
@@ -348,6 +356,7 @@ terminfoWriteSetAttr dc terminfoCaps urlsEnabled prevAttr reqAttr diffs =
348356 )
349357 (sgrArgsForState state)
350358 `mappend` setItalics
359+ `mappend` setStrikethrough
351360 `mappend` setColors
352361 -- Otherwise the display colors are not changing or changing
353362 -- between two non-default points.
@@ -375,6 +384,7 @@ terminfoWriteSetAttr dc terminfoCaps urlsEnabled prevAttr reqAttr diffs =
375384 )
376385 (sgrArgsForState state)
377386 `mappend` setItalics
387+ `mappend` setStrikethrough
378388 `mappend` setColors
379389 where
380390 urlAttrs True = writeURLEscapes (urlDiff diffs)
@@ -392,6 +402,11 @@ terminfoWriteSetAttr dc terminfoCaps urlsEnabled prevAttr reqAttr diffs =
392402 , Just sitm <- enterItalic (displayAttrCaps terminfoCaps)
393403 = writeCapExpr sitm []
394404 | otherwise = mempty
405+ setStrikethrough
406+ | hasStyle (fixedStyle attr) strikethrough
407+ , Just smxx <- enterStrikethrough (displayAttrCaps terminfoCaps)
408+ = writeCapExpr smxx []
409+ | otherwise = mempty
395410 setColors =
396411 (case fixedForeColor attr of
397412 Just c -> writeCapExpr (setForeColor terminfoCaps)
@@ -460,6 +475,7 @@ data DisplayAttrState = DisplayAttrState
460475 { applyStandout :: Bool
461476 , applyUnderline :: Bool
462477 , applyItalic :: Bool
478+ , applyStrikethrough :: Bool
463479 , applyReverseVideo :: Bool
464480 , applyBlink :: Bool
465481 , applyDim :: Bool
@@ -496,6 +512,8 @@ reqDisplayCapSeqFor caps s diffs
496512 -- set state cap then just use the set state cap.
497513 ( True, True ) -> SetState $ stateForStyle s
498514 where
515+ noEnterExitCap ApplyStrikethrough = isNothing $ enterStrikethrough caps
516+ noEnterExitCap RemoveStrikethrough = isNothing $ exitStrikethrough caps
499517 noEnterExitCap ApplyItalic = isNothing $ enterItalic caps
500518 noEnterExitCap RemoveItalic = isNothing $ exitItalic caps
501519 noEnterExitCap ApplyStandout = isNothing $ enterStandout caps
@@ -510,6 +528,8 @@ reqDisplayCapSeqFor caps s diffs
510528 noEnterExitCap RemoveDim = True
511529 noEnterExitCap ApplyBold = isNothing $ enterBoldMode caps
512530 noEnterExitCap RemoveBold = True
531+ enterExitCap ApplyStrikethrough = fromJust $ enterStrikethrough caps
532+ enterExitCap RemoveStrikethrough = fromJust $ exitStrikethrough caps
513533 enterExitCap ApplyItalic = fromJust $ enterItalic caps
514534 enterExitCap RemoveItalic = fromJust $ exitItalic caps
515535 enterExitCap ApplyStandout = fromJust $ enterStandout caps
@@ -526,6 +546,7 @@ stateForStyle s = DisplayAttrState
526546 { applyStandout = isStyleSet standout
527547 , applyUnderline = isStyleSet underline
528548 , applyItalic = isStyleSet italic
549+ , applyStrikethrough = isStyleSet strikethrough
529550 , applyReverseVideo = isStyleSet reverseVideo
530551 , applyBlink = isStyleSet blink
531552 , applyDim = isStyleSet dim
@@ -538,6 +559,7 @@ styleToApplySeq s = concat
538559 [ applyIfRequired ApplyStandout standout
539560 , applyIfRequired ApplyUnderline underline
540561 , applyIfRequired ApplyItalic italic
562+ , applyIfRequired ApplyStrikethrough strikethrough
541563 , applyIfRequired ApplyReverseVideo reverseVideo
542564 , applyIfRequired ApplyBlink blink
543565 , applyIfRequired ApplyDim dim