diff --git a/src/builtin_set.cpp b/src/builtin_set.cpp index 303f089d8..996a5b9d7 100644 --- a/src/builtin_set.cpp +++ b/src/builtin_set.cpp @@ -571,9 +571,14 @@ static void show_scope(const wchar_t *var_name, int scope, io_streams_t &streams wcstring_list_t vals = var->as_list(); streams.out.append_format(_(L"$%ls: set in %ls scope, %ls, with %d elements\n"), var_name, scope_name, exportv, vals.size()); + for (size_t i = 0; i < vals.size(); i++) { if (vals.size() > 100) { - if (i == 50) streams.out.append(L"...\n"); + if (i == 50) { + // try to print a mid-line ellipsis because we are eliding lines not words + streams.out.append(get_ellipsis_char() > 256 ? L"\u22EF" : get_ellipsis_str()); + streams.out.push_back(L'\n'); + } if (i >= 50 && i < vals.size() - 50) continue; } const wcstring value = vals[i]; diff --git a/src/parse_util.cpp b/src/parse_util.cpp index 08d415ebd..e2d730717 100644 --- a/src/parse_util.cpp +++ b/src/parse_util.cpp @@ -882,7 +882,7 @@ void parse_util_expand_variable_error(const wcstring &token, size_t global_token // Make sure we always show something. if (token_after_parens.empty()) { - token_after_parens = L"..."; + token_after_parens = get_ellipsis_str(); } append_syntax_error(errors, global_dollar_pos, ERROR_BAD_VAR_SUBCOMMAND1, @@ -935,7 +935,7 @@ static parser_test_error_bits_t detect_dollar_cmdsub_errors(size_t arg_src_offse wcstring subcommand_first_token = tok_first(cmdsubst_src); if (subcommand_first_token.empty()) { // e.g. $(). Report somthing. - subcommand_first_token = L"..."; + subcommand_first_token = get_ellipsis_str(); } append_syntax_error( out_errors,