Skip to content

If prompt ends in an empty line, the commandline is inserted at the width of the line before #8298

@faho

Description

@faho

(already fixed by 41d6a5b, issue for documentation)

If the prompt looks like

function fish_prompt
    echo prompt # prints a newline
    echo # this prints an additional newline that is trimmed
end

we only trim the last newline, so the commandline would start on an empty line. This is, as intended.

What isn't as intended is that fish neglects to reset the cursor position to 0 after that newline, so entering e.g. echo foo looks like

prompt
     echo foo

(i.e. the echo foo starts after the column prompt would end on!)

This is because we neglected to set the last_line_width if the last_line was empty, which I've now fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that's not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions