@@ -64,6 +64,7 @@ data TerminfoCaps = TerminfoCaps
6464 , clearScreen :: CapExpression
6565 , clearEol :: CapExpression
6666 , displayAttrCaps :: DisplayAttrCaps
67+ , ringBellAudio :: Maybe CapExpression
6768 }
6869
6970data DisplayAttrCaps = DisplayAttrCaps
@@ -140,12 +141,15 @@ reserveTerminal termName outFd = liftIO $ do
140141 <*> requireCap ti "clear"
141142 <*> requireCap ti "el"
142143 <*> currentDisplayAttrCaps ti
144+ <*> probeCap ti "bel"
143145 newAssumedStateRef <- newIORef initialAssumedState
144146 let t = Output
145147 { terminalID = termName
146148 , releaseTerminal = liftIO $ do
147149 sendCap setDefaultAttr []
148150 maybeSendCap cnorm []
151+ , supportsBell = return $ isJust $ ringBellAudio terminfoCaps
152+ , ringTerminalBell = liftIO $ maybeSendCap ringBellAudio []
149153 , reserveDisplay = liftIO $ do
150154 -- If there is no support for smcup: Clear the screen and then move the mouse to the
151155 -- home position to approximate the behavior.