Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ma-zal opened this issue Mar 30, 2023 · 0 comments
Open

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

ma-zal opened this issue Mar 30, 2023 · 0 comments

Comments

@ma-zal
Copy link

ma-zal commented Mar 30, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant