mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-31 03:51:14 -03:00
Fix status current-command
As it turns out, this just always printed "fish". The solution here is a bit hacky as we go via the $_ variable. Fixes #5339.
This commit is contained in:
@@ -423,8 +423,15 @@ int builtin_status(parser_t &parser, io_streams_t &streams, wchar_t **argv) {
|
||||
}
|
||||
case STATUS_CURRENT_CMD: {
|
||||
CHECK_FOR_UNEXPECTED_STATUS_ARGS(opts.status_cmd)
|
||||
streams.out.append(program_name);
|
||||
streams.out.push_back(L'\n');
|
||||
// HACK: Go via the deprecated variable to get the command.
|
||||
const auto var = env_get(L"_");
|
||||
if (!var.missing_or_empty()) {
|
||||
streams.out.append(var->as_string());
|
||||
streams.out.push_back(L'\n');
|
||||
} else {
|
||||
streams.out.append(program_name);
|
||||
streams.out.push_back(L'\n');
|
||||
}
|
||||
break;
|
||||
}
|
||||
case STATUS_FISH_PATH: {
|
||||
|
||||
Reference in New Issue
Block a user