Last line of terminal cast goes off-screen
mihael-stormrage opened this issue · 1 comments
mihael-stormrage commented
Here is an example:
made with this command:
svg-term --cast lArG86KKfUePxjImN9bGx6x5B --out preview.svg --no-cursor --width 80 --height 20 --window
As you can see the last line with prompt and user input only shows after it comes up.
Repository: mihael-stormrage/backend-project-lvl1
mrlnc commented
I ended up changing this line in node_modules/svg-term/lib/to-view-model.js
, worked for me. First time using the tool, not sure if anything else breaks :) [EDIT the first line is gone of course :D anyway i can live with that, just insert a newline before the first command]
function toViewModel(options) {
...
const frames = cast.frames
.filter(([stamp], i, fs) => stamp >= from && stamp <= to)
.map(([delta, data], i) => [delta, data, liner(data)])
.map(([stamp, data, l], index) => {
const lines = l
.map((chars, y) => {
const words = toWords(chars);
return {
- y: y * fontSize * lineHeight,
+ y: (y-1) * fontSize * lineHeight,
words,
hash: hash(words),
ref: null
};
});