From: John Cowan <xxxxxx@ccil.org>Date: Wednesday, August 14, 2019 4:48 PMOn Wed, Aug 14, 2019 at 12:53 PM <xxxxxx@ancell-ent.com> wrote:Providing that behavior is part of the with-raw-mode etc. spec, soonly a crash, (emergency-exit) or the like will potentially leave yourterminal in a messed up state.Exactly. The thunk passed to with-raw-mode is wrapped in a dynamic-wind that enables raw mode in the before-thunk and disables it in the after-thunk.
The following procedures usedynamic-wind
magic when executing theirthunk
arguments; if the thunk's dynamic extent is escaped, the action of the procedure is undone, but if the thunk's dynamic extent is re-entered, the action of the procedure is re-enabled.