ghalestrilo / seg

A live-coding session manager
Apache License 2.0
11 stars 0 forks source link

Fix broken repl output #27

Open ghalestrilo opened 3 years ago

ghalestrilo commented 3 years ago

Right now the :repl messages are stored inside the state as an array of strings. the problem is: usually the process output doesn't come buffered onto lines, so when rendered, the text comes off broken. Also, sliding is very rudimentary - a better buffer leads to better sliding.

Options

  1. Investigate node's child_process lib, maybe there is a setting for buffering newlines
  2. buffer them manually
    • Store repl output as a string
    • append to this string every evaluation / output (instead of pushing a new string to the array)
    • split on \n
    • limit to n lines
    • join them back together with \n