1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#![allow(rustdoc::broken_intra_doc_links)]
#![doc = include_str!("../README.md")]
pub mod ansi;
pub mod error;
pub mod render;
pub mod source;
pub mod line_index;
pub mod marks;
pub mod viewport;
pub mod input;
pub mod terminal;
pub mod app;
pub mod cli;
pub mod format;
pub mod file_set;
pub mod filter;
pub mod prompt;
pub mod grep;
pub mod hex;
pub mod prettify;
pub mod batch;
pub mod clipboard;
pub mod shell;
pub mod preprocess;
pub mod keys;
pub mod style_spec;
pub mod open;
pub mod or;
pub mod overlay;
pub mod pane;
pub mod tags;
pub mod keymap;
pub mod config_path;
#[cfg(feature = "image")]
pub mod anim;
#[cfg(feature = "image")]
pub mod image_render;
#[cfg(feature = "image")]
pub mod image_export;
#[cfg(feature = "image")]
pub mod image_protocol;
#[cfg(feature = "image")]
pub mod term_query;
#[cfg(test)]
pub(crate) mod test_env {
use std::sync::{Mutex, MutexGuard};
/// Process-wide lock serializing every test that mutates the global
/// `HOME` / `TESS_GLOBAL_CONFIG_DIR` env vars. Those vars are process
/// global, so a per-module lock can't stop tests in *different* modules
/// (format, keys, config_path, app) from trampling each other under
/// cargo's parallel runner. One shared lock is the only thing that
/// actually serializes them.
static ENV_LOCK: Mutex<()> = Mutex::new(());
/// Poison-tolerant acquire: a test that panics while holding the lock
/// must not cascade `PoisonError` into every other env-mutating test.
pub(crate) fn lock() -> MutexGuard<'static, ()> {
ENV_LOCK.lock().unwrap_or_else(|e| e.into_inner())
}
}