forked from lix-project/lix
Temporarily disable the debugger during completion evaluation
readline is not re-entrant, so entering the debugger from the completioncallback results in an eventual segfault. The workaround is to temporarily disable the debugger when searching for possible completions.
This commit is contained in:
parent
0edba4cc1e
commit
444af85552
|
@ -384,6 +384,10 @@ StringSet NixRepl::completePrefix(const std::string & prefix)
|
|||
i++;
|
||||
}
|
||||
} else {
|
||||
/* Temporarily disable the debugger, to avoid re-entering readline. */
|
||||
auto debug_repl = state->debugRepl;
|
||||
state->debugRepl = nullptr;
|
||||
Finally restoreDebug([&]() { state->debugRepl = debug_repl; });
|
||||
try {
|
||||
/* This is an expression that should evaluate to an
|
||||
attribute set. Evaluate it to get the names of the
|
||||
|
|
Loading…
Reference in a new issue