ItsEthra / typst-live

Hot reloading for your typst files
MIT License
82 stars 8 forks source link

Running two instances seems fine, but is not. #20

Closed haennes closed 5 months ago

haennes commented 6 months ago

First of all: great simple software. I am having just one minor inconvenience: When one instance is already running, and I am trying to start another one there are two problems:

  1. When in the same directory it complains about output.pdf already existing
  2. When running in a different directory it seems to work fine at a first glance, but: The server fails to bind to the port (which is immediately printed to and cleared from the console), suggesting everything is fine, while only the previous instance is accessible on localhost:5999

Suggestions on how to fix it:

  1. Is creating the output.pdf in a tmp folder a bad idea? Should typst-live even create an output.pdf or can this be hidden behind a cmd option? For my part I only use it as a previewer only. This can actually interfere with file syncing, as changes to output.pdf might keep getting synced, inflating the number of versions To implement this feature (this lib) could be used
  2. Could typst-live just search for the next open port and bind to that? Maybe searching these ports first This could again be hidden behind another cmd option
ItsEthra commented 5 months ago

There was an option to use a different port with --port argument but I changed it so now it looks for an open port if default is not available. See CHANGELOG.md