diff --git a/src/builtins/status.cpp b/src/builtins/status.cpp index d6d390f69..4f97a31d0 100644 --- a/src/builtins/status.cpp +++ b/src/builtins/status.cpp @@ -4,6 +4,7 @@ #include "status.h" #include +#include #include #include @@ -453,9 +454,14 @@ maybe_t builtin_status(parser_t &parser, io_streams_t &streams, const wchar break; } case STATUS_FISH_PATH: { - CHECK_FOR_UNEXPECTED_STATUS_ARGS(opts.status_cmd) - streams.out.append(str2wcstring(get_executable_path("fish"))); - streams.out.push_back(L'\n'); + CHECK_FOR_UNEXPECTED_STATUS_ARGS(opts.status_cmd); + auto real = wrealpath(str2wcstring(get_executable_path("fish"))); + if (real) { + streams.out.append(*real); + streams.out.push_back(L'\n'); + } else { + streams.err.append_format(L"realpath failed: '%s'\n", cmd, std::strerror(errno)); + } break; } }