mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-28 04:51:15 -03:00
Do not emit newline when running commands if the cursor is on its own line
If the cursor has been wrapped to the last line, and is the only thing on that line, do not emit a newline when executing a command. Fixes #6826
This commit is contained in:
@@ -3581,7 +3581,11 @@ maybe_t<wcstring> reader_data_t::readline(int nchars_or_0) {
|
||||
repaint_if_needed();
|
||||
}
|
||||
|
||||
ignore_result(write(STDOUT_FILENO, "\n", 1));
|
||||
// Emit a newline so that the output is on the line after the command.
|
||||
// But do not emit a newline if the cursor has wrapped onto a new line all its own - see #6826.
|
||||
if (!screen.cursor_is_wrapped_to_own_line()) {
|
||||
ignore_result(write(STDOUT_FILENO, "\n", 1));
|
||||
}
|
||||
|
||||
// Ensure we have no pager contents when we exit.
|
||||
if (!pager.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user