1

I'm generating markdown previews from the commandline (to a local file in /tmp) and would like to update the preview tab instead of creating a new one.

Firefox has a new tab option but nothing on reusing an existing one

 --new-tab <url>    Open <url> in a new tab.

I couldn't find anything from Chromium either.

laktak
  • 5,616
  • 20
  • 38
  • If the file in /tmp has a constant name, you can refresh the window using the answers in https://unix.stackexchange.com/a/240497/49439 – Mark Plotnick Oct 09 '20 at 11:31
  • @MarkPlotnick Thanks - if there's nothing builtin that is certainly an interesting workaround! – laktak Oct 09 '20 at 12:10

1 Answers1

0

I've settled on using browser-sync.

It's a web server that refreshes the browser whenever a local file changes.

The only issue is a race condition when the output is not ready in time (at least for now).

laktak
  • 5,616
  • 20
  • 38