{"action":"created","issue":{"url":"https://api.github.com/repos/NSLS-II/bluesky/issues/152","labels_url":"https://api.github.com/repos/NSLS-II/bluesky/issues/152/labels{/name}","comments_url":"https://api.github.com/repos/NSLS-II/bluesky/issues/152/comments","events_url":"https://api.github.com/repos/NSLS-II/bluesky/issues/152/events","html_url":"https://github.com/NSLS-II/bluesky/issues/152","id":99107059,"number":152,"title":"A/B testing on scan pause command","user":{"login":"ericdill","id":6223243,"avatar_url":"https://avatars.githubusercontent.com/u/6223243?v=3","gravatar_id":"","url":"https://api.github.com/users/ericdill","html_url":"https://github.com/ericdill","followers_url":"https://api.github.com/users/ericdill/followers","following_url":"https://api.github.com/users/ericdill/following{/other_user}","gists_url":"https://api.github.com/users/ericdill/gists{/gist_id}","starred_url":"https://api.github.com/users/ericdill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericdill/subscriptions","organizations_url":"https://api.github.com/users/ericdill/orgs","repos_url":"https://api.github.com/users/ericdill/repos","events_url":"https://api.github.com/users/ericdill/events{/privacy}","received_events_url":"https://api.github.com/users/ericdill/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-05T03:11:51Z","updated_at":"2015-08-05T20:52:53Z","closed_at":null,"body":"@tacaswell and I are having a disagreement on what hitting `ctrl+c` should do.\r\n\r\n@tacaswell wants this behavior:\r\n```\r\n...scan is running\r\n[user input] ctrl+c captured\r\n...behind the scenes there is a 0.5 second timeout that is waiting for another \r\n   ctrl+c. If this other ctrl+c is captured, the scan will end with an Abort state\r\n...if no additional ctrl+c is received within 0.5 seconds, the user is dropped \r\n   back to the IPython REPL\r\n```\r\n\r\n@ericdill wants this behavior:\r\n```\r\n...scan is running\r\n[user input] ctrl+c captured\r\n\r\nYou pressed ctrl+c. Do you want to:\r\n(r) resume the scan                                                     \r\n(a) abort the scan (bad exit state)\r\n(s) stop the scan (good exit state)\r\n(p) pause the scan (and return to the REPL)\r\n\r\nNote that an additional ctrl+c will (a)bort the scan.\r\ninput --> \r\n\r\n...indefinitely wait for user input.\r\n```\r\n\r\nIt seems like the right approach here is to do some A/B testing!  Build both and see which one users like!\r\n\r\n\r\ncc @danielballan "},"comment":{"url":"https://api.github.com/repos/NSLS-II/bluesky/issues/comments/128144722","html_url":"https://github.com/NSLS-II/bluesky/issues/152#issuecomment-128144722","issue_url":"https://api.github.com/repos/NSLS-II/bluesky/issues/152","id":128144722,"user":{"login":"danielballan","id":2279598,"avatar_url":"https://avatars.githubusercontent.com/u/2279598?v=3","gravatar_id":"","url":"https://api.github.com/users/danielballan","html_url":"https://github.com/danielballan","followers_url":"https://api.github.com/users/danielballan/followers","following_url":"https://api.github.com/users/danielballan/following{/other_user}","gists_url":"https://api.github.com/users/danielballan/gists{/gist_id}","starred_url":"https://api.github.com/users/danielballan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielballan/subscriptions","organizations_url":"https://api.github.com/users/danielballan/orgs","repos_url":"https://api.github.com/users/danielballan/repos","events_url":"https://api.github.com/users/danielballan/events{/privacy}","received_events_url":"https://api.github.com/users/danielballan/received_events","type":"User","site_admin":false},"created_at":"2015-08-05T20:52:53Z","updated_at":"2015-08-05T20:52:53Z","body":"I think you are onto something. Let me spell it out in tedious detail to\nmake sure we are on the same page.\n\n1. The RunEngine catches a Ctrl+C signal.\n2. The RunEngine starts listening for a second Ctrl+C signal.\n3. The RunEngine requests a pause.\n4. If a pause is not possible, the RunEngine aborts, becomes idle, and\nreturns the REPL. A message is printed, the same as it is now, and we are\ndone.\n5. If a pause is possible, the RunEngine enters a paused state and\nwithholds the REPL for half a second, enough time for a second Ctrl+C to\nregister. If a Ctrl+C is caught, the RunEngine aborts, as in (4).\n6. Otherwise, the RunEngine prints a message like the one you suggested\nabove.\n\nI like the half-second pause because it removes any doubt about whether the\nRunEngine is blocking Ctrl+C or not: if the user has the REPL, the user\nowns Ctrl+C. If not, the RunEngine owns it.\n\nDan\n\nOn Wed, Aug 5, 2015 at 3:26 PM Eric Dill <notifications@github.com> wrote:\n\n> My real concern with the first option above is that the user will be\n> returned to the REPL with no clear indication of what to do next. That\n> concern is the *entire* motivation with the (perhaps unecessarily)\n> complicated input prompt I proposed.\n>\n> How about this. I am fully on-board with @tacaswell\n> <https://github.com/tacaswell> 's option above (which might actually be\n> @danielballan <https://github.com/danielballan> 's suggestions, I'm not\n> sure how the credit falls out here!), but print out a few lines that is\n> (roughly) like this and then return the user to the REPL with the run\n> engine in a paused state. Unless two ctrl+c's are intercepted which\n> should (abort or stop?) the scan.\n>\n> Your RunEngine is now in a paused state. These are your options for changing\n> the state of the RunEngine:\n>\n> resume()  --> will resume the scan\n>  abort()  --> will kill the scan with an 'aborted' state to indicate\n>               the scan was interrupted\n>   stop()  --> will kill the scan with a 'finished' state to indicate\n>               the scan stopped normally\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/NSLS-II/bluesky/issues/152#issuecomment-128119497>.\n>\n"}}