faressoft / terminalizer

🦄 Record your terminal and generate animated gif images or share a web player
https://terminalizer.com
MIT License
15.39k stars 500 forks source link

two prompts to start #244

Open patrickhener opened 4 months ago

patrickhener commented 4 months ago

I want to visualize a thing and am getting two prompts in the beginning. After the render goes on it is fine, but the first line will have two prompts and I don't know why.

# The configurations that used for the recording, feel free to edit them
config:
  env:
    recording: true
  cols: 85
  rows: 10
  repeat: 0

  # Quality
  # 1 - 100
  quality: 10

  frameDelay: auto
  maxIdleTime: 2000

  frameBox:
    type: floating
    title: goshs
    style:
      border: 0px black solid
      boxShadow: 10px 10px 3px rgb(0 0 0 / 40%)
      margin: 15px

  watermark:
    imagePath: null
    style:
      position: absolute
      right: 15px
      bottom: 15px
      width: 100px
      opacity: 0.9

  cursorStyle: underline

  # Font family
  # You can use any font that is installed on your machine
  # in CSS-like syntax
  fontFamily: "Ubuntu Mono, Monospace"

  fontSize: 24
  lineHeight: 1
  letterSpacing: 0

  # Theme
  theme:
    background: "transparent"
    foreground: "#afafaf"
    cursor: "#c7c7c7"
    black: "#3B4252"
    red: "#fc4384"
    green: "#b3e33b"
    yellow: "#ffa727"
    blue: "#75dff2"
    magenta: "#ae89fe"
    cyan: "#708387"
    white: "#d5d5d0"
    brightBlack: "#626566"
    brightRed: "#ff7fac"
    brightGreen: "#c8ed71"
    brightYellow: "#ebdf86"
    brightBlue: "#75dff2"
    brightMagenta: "#ae89fe"
    brightCyan: "#b1c6ca"
    brightWhite: "#f9f9f4"

# Records, feel free to edit them
records:
  - delay: 430
    content: "\e]0;patrick@mockingjay:~\e\\\e]7;file://mockingjay/home/patrick\e\\\e[?2004h\e]0;patrick@mockingjay: ~\a\e[01;32mpatrick@mockingjay\e[00m:\e[01;34m~\e[00m$ "
  - delay: 100
    content: g
  - delay: 100
    content: o
  - delay: 100
    content: ' '
  - delay: 100
    content: i
  - delay: 100
    content: 'n'
  - delay: 100
    content: s
  - delay: 100
    content: t
  - delay: 100
    content: a
  - delay: 100
    content: l
  - delay: 100
    content: l
  - delay: 100
    content: ' '
  - delay: 100
    content: g
  - delay: 100
    content: i
  - delay: 100
    content: t
  - delay: 100
    content: h
  - delay: 100
    content: u
  - delay: 100
    content: b
  - delay: 100
    content: .
  - delay: 100
    content: c
  - delay: 100
    content: o
  - delay: 100
    content: m
  - delay: 100
    content: /
  - delay: 100
    content: p
  - delay: 100
    content: a
  - delay: 100
    content: t
  - delay: 100
    content: r
  - delay: 100
    content: i
  - delay: 100
    content: c
  - delay: 100
    content: k
  - delay: 100
    content: h
  - delay: 100
    content: e
  - delay: 100
    content: 'n'
  - delay: 100
    content: e
  - delay: 100
    content: r
  - delay: 100
    content: /
  - delay: 100
    content: g
  - delay: 100
    content: o
  - delay: 100
    content: s
  - delay: 100
    content: h
  - delay: 100
    content: s
  - delay: 100
    content: '@'
  - delay: 100
    content: l
  - delay: 100
    content: a
  - delay: 100
    content: t
  - delay: 100
    content: e
  - delay: 100
    content: s
  - delay: 100
    content: t
  - delay: 100
    content: "\r\n\e[?2004l\r"
  - delay: 700
    content: "\e]0;patrick@mockingjay:~\e\\\e]7;file://mockingjay/home/patrick\e\\\e[?2004h\e]0;patrick@mockingjay: ~\a\e[01;32mpatrick@mockingjay\e[00m:\e[01;34m~\e[00m$ "
  - delay: 700
    content: g
  - delay: 100
    content: o
  - delay: 100
    content: s
  - delay: 100
    content: h
  - delay: 100
    content: s
  - delay: 100
    content: "\r\n\e[?2004l\r"
  - delay: 37
    content: "\e[36mINFO   \e[0m[2024-07-04 12:34:45] Download embedded file at: /example.txt?embedded \r\n\e[36mINFO   \e[0m[2024-07-04 12:34:45] Serving on interface eth0 bound to 10.137.0.27:8000 \r\n\e[36mINFO   \e[0m[2024-07-04 12:34:45] Serving on interface lo bound to 127.0.0.1:8000 \r\n\e[36mINFO   \e[0m[2024-07-04 12:34:45] Serving HTTP from /home/patrick       \r\n"
  - delay: 5000
    content: "\e[36mINFO   \e[0m[2024-07-04 12:34:53] 127.0.0.1:45310 - [\e[1;32m200\e[0m] - \"GET / HTTP/1.1\" \r\n"
  - delay: 2000
    content: "\e[36mINFO   \e[0m[2024-07-04 12:34:55] 127.0.0.1:45342 - [\e[1;32m200\e[0m] - \"GET /some-file.txt HTTP/1.1\" \r\n"
  - delay: 2000
    content: "\e]0;patrick@mockingjay:~\e\\\e]7;file://mockingjay/home/patrick\e\\\e[?2004h\e]0;patrick@mockingjay: ~\a\e[01;32mpatrick@mockingjay\e[00m:\e[01;34m~\e[00m$ "

This is my recording and this is the render:

goshs

You can see clearly that this is not correct.

corymurphy commented 4 months ago

I'm experiencing the same issue. I ended up just adding an empty record at the beginning to resolve it in the meantime.

records:
  - delay: 1
    content: " "
patrickhener commented 4 months ago

This indeed does work.

ofabel commented 2 months ago

The advice from @corymurphy is great, but adds an extra space to the prompt.

To avoid this, use \r (carriage return) instead of a space character:

records:
  - delay: 1
    content: "\r"
KarolPWr commented 1 month ago

I'm experiencing the same issue. Workaround does work alright, but it would still look better without it