Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commandline option to exit restview if webbrowser doesn't poll anymore #43

Open
AvdN opened this issue Jan 20, 2016 · 3 comments
Open

Comments

@AvdN
Copy link

AvdN commented Jan 20, 2016

AFAICT the webpage that restview generates polls back for changes using JavaScript. It would be
useful to have a commandline-option/config-option/environmentvariable where you could specify
an amount X, so that if there was no polling for X seconds restview would exit. That way closing the
browser window is enough to stop the restview process.

I could take a shot at a PR if this is deemed useful.

@mgedmin
Copy link
Owner

mgedmin commented Jan 20, 2016

Ooh, this is a nice idea. Exit when the browser tab gets closed. I like it.

Eagerly waiting for a PR.

User interface: I think command-line option is best here. Maybe --auto-exit, or --no-auto-exit since I probably want this on by default. Maybe also an --auto-exit-timeout=10, to specify the timeout in seconds, with the default being something reasonable (5? giving a chance to "undo close tab" quickly, if the user hits Ctrl-W on the wrong tab by accident).

@AvdN
Copy link
Author

AvdN commented Jan 20, 2016

The default time doesn't have to be short, I just want to make sure I don't have to chase processes in some terminal tab. 60 seconds would be ok for me.

If you consider making this behaviour the default, then --auto-exit=0 could just switch the exit off.

@mgedmin
Copy link
Owner

mgedmin commented Jan 20, 2016

Nah, I want --auto=exit=0 to mean exit immediately when the tab is closed.

(That would probably require a different mechanism -- e.g. an onbeforeunload event handler that tells the server-side that the tab is about to be closed -- to prevent false positives, but nevertheless I'd rather not overload 0 to mean something else.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants