Skip to content

Commit

Permalink
fix: 🐛 image shape is not rendering in iTerm
Browse files Browse the repository at this point in the history
Control code that is used for ending inline image sequence in iTerm
turns out to be wrong. This commit fixes the code and now images can be
shown in iTerm again.
  • Loading branch information
ghaiklor committed May 11, 2020
1 parent e6c6dd9 commit c9b0942
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/kittik-shape-image/spec/Image.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('image shape', () => {

expect(writeSpy).toHaveBeenCalledTimes(1);
expect(writeSpy).toHaveBeenCalledWith(
'\u001b[11;11H\u001b]1337;File=size=6;width=15;height=5;preserveAspectRatio=1;inline=1:dGVzdA==^G'
'\u001b[11;11H\u001b]1337;File=size=6;width=15;height=5;preserveAspectRatio=1;inline=1:dGVzdA==\u0007'
);
});

Expand All @@ -59,7 +59,7 @@ describe('image shape', () => {

expect(writeSpy).toHaveBeenCalledTimes(1);
expect(writeSpy).toHaveBeenCalledWith(
'\u001b[11;11H\u001b]1337;File=size=6;width=15;height=5;preserveAspectRatio=0;inline=1:dGVzdA==^G'
'\u001b[11;11H\u001b]1337;File=size=6;width=15;height=5;preserveAspectRatio=0;inline=1:dGVzdA==\u0007'
);
});

Expand Down
2 changes: 1 addition & 1 deletion packages/kittik-shape-image/src/Image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export class Image extends Shape implements ImageOptions, ShapeRenderable {
'inline=1'
].join(';');

canvas.stream.write(`\u001b[${y + 1};${x + 1}H\u001b]1337;File=${args}:${image}^G`);
canvas.stream.write(`\u001b[${y + 1};${x + 1}H\u001b]1337;File=${args}:${image}\u0007`);
}

public toObject (): ImageObject {
Expand Down

0 comments on commit c9b0942

Please sign in to comment.