Skip to content

Multiline editing doesn't fix cursor when user hits enter with cursor halfway up  #50

Open
@dragoncoder047

Description

@dragoncoder047

So I'm working on a little terminal-based REPL for my programming language Phoo and I found this for the input part. So far works great (though I did have to apply the patch described in #24 to be able to use color prompts and a similar patch as the one in #31 for custom is-complete handlers).

One big problem is when a multiline edit is triggered, the user can move their cursor up, but it isn't moved back down again when they press enter and the command is already complete.

Screenshot 2022-03-22 at 23-17-07 Phoo

In the screenshot I just had the terminal set up to prompt in blue (-> and ..), and then echo the output back again in red.

I typed the first few lines, hit enter with the cursor at the bottom, and it worked fine.
I hit 'up', moved the cursor to the middle of the b's, and hit enter from there, and you can see it clobbered over the input prompt and text!

How do I fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions