mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-07 18:21:16 -03:00
builtin status: remove spurious newline from current-command (Rust port regression)
WHen "status current-command" is called outside a function it always returns "fish". An extra newline crept in, fix that. Fixes77aeb6a2a8(Port execution, 2023-10-08). Fixes #11503 (cherry picked from commite26b585ce5)
This commit is contained in:
@@ -582,11 +582,10 @@ pub fn status(parser: &Parser, streams: &mut IoStreams, args: &mut [&wstr]) -> O
|
||||
STATUS_CURRENT_CMD => {
|
||||
let command = &parser.libdata().status_vars.command;
|
||||
if !command.is_empty() {
|
||||
streams.out.append(command);
|
||||
streams.out.appendln(command);
|
||||
} else {
|
||||
streams.out.appendln(*PROGRAM_NAME.get().unwrap());
|
||||
}
|
||||
streams.out.append_char('\n');
|
||||
}
|
||||
STATUS_CURRENT_COMMANDLINE => {
|
||||
let commandline = &parser.libdata().status_vars.commandline;
|
||||
|
||||
@@ -38,6 +38,9 @@ status --job-control=1none
|
||||
# Now set it to a valid mode.
|
||||
status job-control none
|
||||
|
||||
status current-command | sed s/^/^/
|
||||
# CHECK: ^fish
|
||||
|
||||
# Check status -u outside functions
|
||||
status current-function
|
||||
#CHECK: Not a function
|
||||
|
||||
Reference in New Issue
Block a user