Skip to content

No new line by writeln() after bitmap image #46

Description

@ma-zal

Issue

After the bitmap image drawing the next writeln() command does not add a new line after the text.
But the second text is incorrectly placed directly after the first one.

Example of code with issue:

writeln('line1.');
writeln('line2.');
draw(image);
writeln('line3.');
writeln('line4.');

Example causes the output with issue:

line1.
line2.
[Image]
line3.line4.

Root cause

I have found the incorrect ESC command in draw() function after each bitmap line.

File: src/profile/index.ts

Current (incorrect implementation):

yield this.connection.write(Buffer.from('\x1BJ\x00', 'ascii'));

Should be 0x0A only:

yield this.connection.write(Buffer.from('\x0A', 'ascii'));

ESC commands documentation

Testing:

I have tested my offered change. It corrects the issue on my side.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions