Skip to content

Cursor position is incorrect after Status.update() #1212

@hyee

Description

@hyee

In some terminals such as Putty, MobaXterm, the cursor position is incorrect after several updates on the status bar. It should be right after the prompt, however sometime it's at the beginning or the end of the status bar. It seems like writer.flush() is missing when flush is true in Status.class:

    @Override
    public void update(List<AttributedString> newLines, int targetCursorPos, boolean flush) {
        cursorPos = -1;
        firstLine = rows - newLines.size();
        super.update(newLines, targetCursorPos, flush);
        if (cursorPos != -1) {
            terminal.puts(Capability.restore_cursor); //missing terminal.writer().flush() here
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions