diff --git a/src/highlight.cpp b/src/highlight.cpp index 3149f97aa1a0..2a8fa179db63 100644 --- a/src/highlight.cpp +++ b/src/highlight.cpp @@ -992,8 +992,12 @@ void highlighter_t::color_redirection(tnode_t redirection_node) path_apply_working_directory(target, this->working_directory); switch (*redirect_type) { case redirection_type_t::fd: { - int fd = fish_wcstoi(target.c_str()); - target_is_valid = !errno && fd >= 0; + if (target == L"-") { + target_is_valid = true; + } else { + int fd = fish_wcstoi(target.c_str()); + target_is_valid = !errno && fd >= 0; + } break; } case redirection_type_t::input: {