Skip to main content

nu_experimental/options/
background_completions.rs

1use crate::*;
2
3/// Run completions on a background thread instead of blocking the line editor.
4///
5/// Disabling restores the pre-0.115 behavior: completions settle on the
6/// reedline thread, which blocks while they run, so a custom completer can
7/// hand the terminal to an interactive picker (`$candidates | fzf`) without
8/// the line editor stealing its keystrokes.
9pub static BACKGROUND_COMPLETIONS: ExperimentalOption =
10    ExperimentalOption::new(&BackgroundCompletions);
11
12// No documentation needed here since this type isn't public.
13// The static above provides all necessary details.
14struct BackgroundCompletions;
15
16impl ExperimentalOptionMarker for BackgroundCompletions {
17    const IDENTIFIER: &'static str = "background-completions";
18    const DESCRIPTION: &'static str = "\
19        Runs completions on a background thread so typing never blocks. \
20        Disable to let custom completers drive interactive child processes.";
21    const STATUS: Status = Status::OptOut;
22    const SINCE: Version = (0, 115, 0);
23    const ISSUE: u32 = 18839;
24}