mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-01-31 18:22:59 +08:00
type: Add missing newline
Otherwise this would print # Defined interactivelyfunction foo for interactively defined functions.
This commit is contained in:
parent
627fff7971
commit
85ba2ed790
|
@ -155,7 +155,7 @@ maybe_t<int> builtin_type(parser_t &parser, io_streams_t &streams, wchar_t **arg
|
|||
def = comment.append(def);
|
||||
} else {
|
||||
wcstring comment;
|
||||
append_format(comment, L"# Defined interactively");
|
||||
append_format(comment, L"# Defined interactively\n");
|
||||
def = comment.append(def);
|
||||
}
|
||||
if (!streams.out_is_redirected && isatty(STDOUT_FILENO)) {
|
||||
|
|
|
@ -56,3 +56,11 @@ expect_prompt("error: no-execute mode enabled and no script given. Exiting")
|
|||
|
||||
sendline("source; or echo failed")
|
||||
expect_prompt("failed")
|
||||
|
||||
# See that `type` tells us the function was defined interactively.
|
||||
sendline("function foo; end; type foo")
|
||||
expect_str("foo is a function with definition\r\n")
|
||||
expect_str("# Defined interactively\r\n")
|
||||
expect_str("function foo")
|
||||
expect_str("end")
|
||||
expect_prompt()
|
||||
|
|
Loading…
Reference in New Issue
Block a user