@@ -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
@@ -166,6 +168,10 @@ reserveTerminal termName outFd = do
166168 sendCap setDefaultAttr []
167169 maybeSendCap cnorm []
168170 , supportsBell = return $ isJust $ ringBellAudio terminfoCaps
171+ , supportsItalics = return $ (isJust $ enterItalic (displayAttrCaps terminfoCaps)) &&
172+ (isJust $ exitItalic (displayAttrCaps terminfoCaps))
173+ , supportsStrikethrough = return $ (isJust $ enterStrikethrough (displayAttrCaps terminfoCaps)) &&
174+ (isJust $ exitStrikethrough (displayAttrCaps terminfoCaps))
169175 , ringTerminalBell = maybeSendCap ringBellAudio []
170176 , reserveDisplay = do
171177 -- If there is no support for smcup: Clear the screen
@@ -203,7 +209,7 @@ reserveTerminal termName outFd = do
203209 , assumedStateRef = newAssumedStateRef
204210 -- I think fix would help assure tActual is the only
205211 -- reference. I was having issues tho.
206− , mkDisplayContext = \tActual -> terminfoDisplayContext tActual terminfoCaps
212+ , mkDisplayContext = (`terminfoDisplayContext` terminfoCaps)
207213 }
208214 sendCap s = sendCapToTerminal t (s terminfoCaps)
209215 maybeSendCap s = when (isJust $ s terminfoCaps) . sendCap (fromJust . s)
@@ -235,6 +241,8 @@ currentDisplayAttrCaps ti
235241 <*> probeCap ti "rmso"
236242 <*> probeCap ti "sitm"
237243 <*> probeCap ti "ritm"
244+ <*> probeCap ti "smxx"
245+ <*> probeCap ti "rmxx"
238246 <*> probeCap ti "smul"
239247 <*> probeCap ti "rmul"
240248 <*> probeCap ti "rev"
@@ -270,7 +278,11 @@ terminfoDisplayContext tActual terminfoCaps r = return dc
270278 , writeSetAttr = terminfoWriteSetAttr dc terminfoCaps
271279 , writeDefaultAttr = \urlsEnabled ->
272280 writeCapExpr (setDefaultAttr terminfoCaps) [] `mappend`
273− (if urlsEnabled then writeURLEscapes EndLink else mempty)
281+ (if urlsEnabled then writeURLEscapes EndLink else mempty) `mappend`
282+ (case exitStrikethrough $ displayAttrCaps terminfoCaps of
283+ Just cap -> writeCapExpr cap []
284+ Nothing -> mempty
285+ )
274286 , writeRowEnd = writeCapExpr (clearEol terminfoCaps) []
275287 , inlineHack = return ()
276288 }
@@ -348,6 +360,7 @@ terminfoWriteSetAttr dc terminfoCaps urlsEnabled prevAttr reqAttr diffs =
348360 )
349361 (sgrArgsForState state)
350362 `mappend` setItalics
363+ `mappend` setStrikethrough
351364 `mappend` setColors
352365 -- Otherwise the display colors are not changing or changing
353366 -- between two non-default points.
@@ -375,6 +388,7 @@ terminfoWriteSetAttr dc terminfoCaps urlsEnabled prevAttr reqAttr diffs =
375388 )
376389 (sgrArgsForState state)
377390 `mappend` setItalics
391+ `mappend` setStrikethrough
378392 `mappend` setColors
379393 where
380394 urlAttrs True = writeURLEscapes (urlDiff diffs)
@@ -392,6 +406,11 @@ terminfoWriteSetAttr dc terminfoCaps urlsEnabled prevAttr reqAttr diffs =
392406 , Just sitm <- enterItalic (displayAttrCaps terminfoCaps)
393407 = writeCapExpr sitm []
394408 | otherwise = mempty
409+ setStrikethrough
410+ | hasStyle (fixedStyle attr) strikethrough
411+ , Just smxx <- enterStrikethrough (displayAttrCaps terminfoCaps)
412+ = writeCapExpr smxx []
413+ | otherwise = mempty
395414 setColors =
396415 (case fixedForeColor attr of
397416 Just c -> writeCapExpr (setForeColor terminfoCaps)
@@ -460,6 +479,7 @@ data DisplayAttrState = DisplayAttrState
460479 { applyStandout :: Bool
461480 , applyUnderline :: Bool
462481 , applyItalic :: Bool
482+ , applyStrikethrough :: Bool
463483 , applyReverseVideo :: Bool
464484 , applyBlink :: Bool
465485 , applyDim :: Bool
@@ -496,6 +516,8 @@ reqDisplayCapSeqFor caps s diffs
496516 -- set state cap then just use the set state cap.
497517 ( True, True ) -> SetState $ stateForStyle s
498518 where
519+ noEnterExitCap ApplyStrikethrough = isNothing $ enterStrikethrough caps
520+ noEnterExitCap RemoveStrikethrough = isNothing $ exitStrikethrough caps
499521 noEnterExitCap ApplyItalic = isNothing $ enterItalic caps
500522 noEnterExitCap RemoveItalic = isNothing $ exitItalic caps
501523 noEnterExitCap ApplyStandout = isNothing $ enterStandout caps
@@ -510,6 +532,8 @@ reqDisplayCapSeqFor caps s diffs
510532 noEnterExitCap RemoveDim = True
511533 noEnterExitCap ApplyBold = isNothing $ enterBoldMode caps
512534 noEnterExitCap RemoveBold = True
535+ enterExitCap ApplyStrikethrough = fromJust $ enterStrikethrough caps
536+ enterExitCap RemoveStrikethrough = fromJust $ exitStrikethrough caps
513537 enterExitCap ApplyItalic = fromJust $ enterItalic caps
514538 enterExitCap RemoveItalic = fromJust $ exitItalic caps
515539 enterExitCap ApplyStandout = fromJust $ enterStandout caps
@@ -526,6 +550,7 @@ stateForStyle s = DisplayAttrState
526550 { applyStandout = isStyleSet standout
527551 , applyUnderline = isStyleSet underline
528552 , applyItalic = isStyleSet italic
553+ , applyStrikethrough = isStyleSet strikethrough
529554 , applyReverseVideo = isStyleSet reverseVideo
530555 , applyBlink = isStyleSet blink
531556 , applyDim = isStyleSet dim
@@ -538,6 +563,7 @@ styleToApplySeq s = concat
538563 [ applyIfRequired ApplyStandout standout
539564 , applyIfRequired ApplyUnderline underline
540565 , applyIfRequired ApplyItalic italic
566+ , applyIfRequired ApplyStrikethrough strikethrough
541567 , applyIfRequired ApplyReverseVideo reverseVideo
542568 , applyIfRequired ApplyBlink blink
543569 , applyIfRequired ApplyDim dim