From 84483b4aac7cfd5d59b5a1050f5d11a5f052af50 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Tue, 26 Nov 2013 23:56:47 -0800 Subject: [PATCH] Fix for process expansion off the main thread in syntax highlighting (#1143) --- highlight.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/highlight.cpp b/highlight.cpp index 8d46feb33..2e1543877 100644 --- a/highlight.cpp +++ b/highlight.cpp @@ -710,7 +710,7 @@ static bool autosuggest_parse_command(const wcstring &str, wcstring *out_command { /* Command. First check that the command actually exists. */ wcstring local_cmd = tok_last(&tok); - bool expanded = expand_one(cmd, EXPAND_SKIP_CMDSUBST | EXPAND_SKIP_VARIABLES); + bool expanded = expand_one(cmd, EXPAND_SKIP_CMDSUBST | EXPAND_SKIP_VARIABLES | EXPAND_SKIP_JOBS); if (! expanded || has_expand_reserved(cmd.c_str())) { /* We can't expand this cmd, ignore it */ @@ -873,7 +873,7 @@ bool autosuggest_validate_from_history(const history_item_t &item, file_detectio { /* We can possibly handle this specially */ wcstring dir = parsed_arguments.back(); - if (expand_one(dir, EXPAND_SKIP_CMDSUBST)) + if (expand_one(dir, EXPAND_SKIP_CMDSUBST | EXPAND_SKIP_JOBS)) { handled = true; bool is_help = string_prefixes_string(dir, L"--help") || string_prefixes_string(dir, L"-h"); @@ -997,7 +997,7 @@ static void tokenize(const wchar_t * const buff, std::vector &color, const if (cmd == L"cd") { wcstring dir = tok_last(&tok); - if (expand_one(dir, EXPAND_SKIP_CMDSUBST)) + if (expand_one(dir, EXPAND_SKIP_CMDSUBST | EXPAND_SKIP_JOBS)) { int is_help = string_prefixes_string(dir, L"--help") || string_prefixes_string(dir, L"-h"); if (!is_help && ! is_potential_cd_path(dir, working_directory, PATH_EXPAND_TILDE, NULL)) @@ -1182,7 +1182,7 @@ static void tokenize(const wchar_t * const buff, std::vector &color, const case TOK_STRING: { target_str = tok_last(&tok); - if (expand_one(target_str, EXPAND_SKIP_CMDSUBST)) + if (expand_one(target_str, EXPAND_SKIP_CMDSUBST | EXPAND_SKIP_JOBS)) { target = target_str.c_str(); }