Skip to content

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

Closed

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.

Activity

  1. added
    bug
    on Sep 15, 2021
  2. added this to the fish 3.4.0 milestone on Sep 15, 2021
  3. added a commit that references this issue on Dec 12, 2021
  4. locked as resolved and limited conversation to collaborators on Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions