|
|
|
|
@ -86,7 +86,14 @@ fn style_opt(lua: &Lua, opts: &Opts, key: &str) -> LuaResult<Option<markup::Styl |
|
|
|
|
/// bypass the capture and trash the test runner's output. In normal builds it
|
|
|
|
|
/// writes the bytes directly, ignores errors (a broken pipe must not panic
|
|
|
|
|
/// the runtime) and flushes (tui.raw is used for `\r` redraws mid-line).
|
|
|
|
|
///
|
|
|
|
|
/// Serialized with the prompts via [`PROMPT_LOCK`]: while a prompt (inquire
|
|
|
|
|
/// or a permission request) owns the terminal, a concurrent coroutine's
|
|
|
|
|
/// output — e.g. a spinner's `<clear=line>` redraw, which would erase the
|
|
|
|
|
/// prompt's question line — blocks until the prompt is answered, then
|
|
|
|
|
/// resumes.
|
|
|
|
|
pub(super) fn write_stdout(bytes: &[u8]) { |
|
|
|
|
let _guard = super::prompts::PROMPT_LOCK.lock().unwrap_or_else(|e| e.into_inner()); |
|
|
|
|
#[cfg(test)] |
|
|
|
|
print!("{}", String::from_utf8_lossy(bytes)); |
|
|
|
|
#[cfg(not(test))] |
|
|
|
|
|