Express cancellation as a possible result of expand_string

This allows us to properly thread control-C signals from command
substitutions into the expanding string.
This commit is contained in:
ridiculousfish
2020-01-22 11:58:10 -08:00
parent 8a9c39d433
commit e640a01ea5
4 changed files with 19 additions and 1 deletions

View File

@@ -680,6 +680,9 @@ void completer_t::complete_cmd(const wcstring &str_cmd) {
this->expand_flags() | expand_flag::special_for_command |
expand_flag::for_completions | expand_flag::executables_only,
ctx);
if (result == expand_result_t::cancel) {
return;
}
if (result != expand_result_t::error && this->wants_descriptions()) {
this->complete_cmd_desc(str_cmd);
}