{"action":"created","comment":{"url":"https://api.github.com/repos/zeit/hyper/pulls/comments/94350542","pull_request_review_id":14876336,"id":94350542,"diff_hunk":"@@ -0,0 +1,37 @@\n+// Application state fallback upon unexpected quit\n+const {app} = require('electron');\n+const Config = require('electron-config');\n+const wins = require('./windows');\n+\n+// local storage\n+const rec = new Config();\n+const recordInterval = 2000;","path":"app/win/record.js","position":8,"original_position":8,"commit_id":"1eb7b05b85e458656bb37656c094b29ca029a430","original_commit_id":"1eb7b05b85e458656bb37656c094b29ca029a430","user":{"login":"ppot","id":5577409,"avatar_url":"https://avatars.githubusercontent.com/u/5577409?v=3","gravatar_id":"","url":"https://api.github.com/users/ppot","html_url":"https://github.com/ppot","followers_url":"https://api.github.com/users/ppot/followers","following_url":"https://api.github.com/users/ppot/following{/other_user}","gists_url":"https://api.github.com/users/ppot/gists{/gist_id}","starred_url":"https://api.github.com/users/ppot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppot/subscriptions","organizations_url":"https://api.github.com/users/ppot/orgs","repos_url":"https://api.github.com/users/ppot/repos","events_url":"https://api.github.com/users/ppot/events{/privacy}","received_events_url":"https://api.github.com/users/ppot/received_events","type":"User","site_admin":false},"body":"You can't lower this cause the process it take to save when there is multiple windows open with multiple panes","created_at":"2017-01-02T23:28:35Z","updated_at":"2017-01-02T23:28:35Z","html_url":"https://github.com/zeit/hyper/pull/945#discussion_r94350542","pull_request_url":"https://api.github.com/repos/zeit/hyper/pulls/945","_links":{"self":{"href":"https://api.github.com/repos/zeit/hyper/pulls/comments/94350542"},"html":{"href":"https://github.com/zeit/hyper/pull/945#discussion_r94350542"},"pull_request":{"href":"https://api.github.com/repos/zeit/hyper/pulls/945"}}},"pull_request":{"url":"https://api.github.com/repos/zeit/hyper/pulls/945","id":91538240,"html_url":"https://github.com/zeit/hyper/pull/945","diff_url":"https://github.com/zeit/hyper/pull/945.diff","patch_url":"https://github.com/zeit/hyper/pull/945.patch","issue_url":"https://api.github.com/repos/zeit/hyper/issues/945","number":945,"state":"open","locked":false,"title":"Hyper Sessions restoration  ","user":{"login":"ppot","id":5577409,"avatar_url":"https://avatars.githubusercontent.com/u/5577409?v=3","gravatar_id":"","url":"https://api.github.com/users/ppot","html_url":"https://github.com/ppot","followers_url":"https://api.github.com/users/ppot/followers","following_url":"https://api.github.com/users/ppot/following{/other_user}","gists_url":"https://api.github.com/users/ppot/gists{/gist_id}","starred_url":"https://api.github.com/users/ppot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppot/subscriptions","organizations_url":"https://api.github.com/users/ppot/orgs","repos_url":"https://api.github.com/users/ppot/repos","events_url":"https://api.github.com/users/ppot/events{/privacy}","received_events_url":"https://api.github.com/users/ppot/received_events","type":"User","site_admin":false},"body":"# Ready to merge 🎉 👍 📦 \r\nCloses Issues #785, #567\r\n\r\n## Provide\r\n__app quit and process quit -> state restoration after shutdown / restart__\r\n\r\nThis PR includes important changes in order to allow sessions record and restoration.\r\n\r\n## Concern \r\nAt the moment, the session is not affiliated to any opened tabs or splits in the `win` object. Sessions are created and then added to the sessions map in the `win` object so each win inside the `windowsSet` has multiples session.\r\n\r\n## Update\r\n- Add win folder\r\n- Add window object extanding `BrowserWindow`\r\n- window now have a `Set` of `Tab`\r\n- `Tab` now include a root Pane and each pane have `childs`\r\n\r\n## Apply hyper\r\n#### Record\r\n- [x] periodically save state\r\n- [x] record all windows positions and sizes\r\n- [x] record windows opened tabs\r\n- [x] record tab root Pane and childs\r\n- [x] record each Pane session cwd\r\n#### Restoration\r\n- [x] restore windows\r\n- [x] restore windows tabs\r\n- [x] restore tab Pane and child\r\n- [x] restore Pane session cwd\r\n\r\nThis way, we can record the `windowSet` object and apply the restoration on restart and reload the precedent recorded state.\r\n![hyper_restore](https://cloud.githubusercontent.com/assets/5577409/20637775/9b5ea5d8-b35f-11e6-9c1a-10bc6362a7bf.gif)\r\n","created_at":"2016-10-30T21:58:19Z","updated_at":"2017-01-02T23:28:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c719eb8c2cffa2f2848ac7a13d336ab14b517f0f","assignee":{"login":"matheuss","id":4721750,"avatar_url":"https://avatars.githubusercontent.com/u/4721750?v=3","gravatar_id":"","url":"https://api.github.com/users/matheuss","html_url":"https://github.com/matheuss","followers_url":"https://api.github.com/users/matheuss/followers","following_url":"https://api.github.com/users/matheuss/following{/other_user}","gists_url":"https://api.github.com/users/matheuss/gists{/gist_id}","starred_url":"https://api.github.com/users/matheuss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matheuss/subscriptions","organizations_url":"https://api.github.com/users/matheuss/orgs","repos_url":"https://api.github.com/users/matheuss/repos","events_url":"https://api.github.com/users/matheuss/events{/privacy}","received_events_url":"https://api.github.com/users/matheuss/received_events","type":"User","site_admin":false},"assignees":[{"login":"matheuss","id":4721750,"avatar_url":"https://avatars.githubusercontent.com/u/4721750?v=3","gravatar_id":"","url":"https://api.github.com/users/matheuss","html_url":"https://github.com/matheuss","followers_url":"https://api.github.com/users/matheuss/followers","following_url":"https://api.github.com/users/matheuss/following{/other_user}","gists_url":"https://api.github.com/users/matheuss/gists{/gist_id}","starred_url":"https://api.github.com/users/matheuss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matheuss/subscriptions","organizations_url":"https://api.github.com/users/matheuss/orgs","repos_url":"https://api.github.com/users/matheuss/repos","events_url":"https://api.github.com/users/matheuss/events{/privacy}","received_events_url":"https://api.github.com/users/matheuss/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/zeit/hyper/pulls/945/commits","review_comments_url":"https://api.github.com/repos/zeit/hyper/pulls/945/comments","review_comment_url":"https://api.github.com/repos/zeit/hyper/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zeit/hyper/issues/945/comments","statuses_url":"https://api.github.com/repos/zeit/hyper/statuses/1eb7b05b85e458656bb37656c094b29ca029a430","head":{"label":"ppot:hyper_record","ref":"hyper_record","sha":"1eb7b05b85e458656bb37656c094b29ca029a430","user":{"login":"ppot","id":5577409,"avatar_url":"https://avatars.githubusercontent.com/u/5577409?v=3","gravatar_id":"","url":"https://api.github.com/users/ppot","html_url":"https://github.com/ppot","followers_url":"https://api.github.com/users/ppot/followers","following_url":"https://api.github.com/users/ppot/following{/other_user}","gists_url":"https://api.github.com/users/ppot/gists{/gist_id}","starred_url":"https://api.github.com/users/ppot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppot/subscriptions","organizations_url":"https://api.github.com/users/ppot/orgs","repos_url":"https://api.github.com/users/ppot/repos","events_url":"https://api.github.com/users/ppot/events{/privacy}","received_events_url":"https://api.github.com/users/ppot/received_events","type":"User","site_admin":false},"repo":{"id":70296187,"name":"hyper","full_name":"ppot/hyper","owner":{"login":"ppot","id":5577409,"avatar_url":"https://avatars.githubusercontent.com/u/5577409?v=3","gravatar_id":"","url":"https://api.github.com/users/ppot","html_url":"https://github.com/ppot","followers_url":"https://api.github.com/users/ppot/followers","following_url":"https://api.github.com/users/ppot/following{/other_user}","gists_url":"https://api.github.com/users/ppot/gists{/gist_id}","starred_url":"https://api.github.com/users/ppot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppot/subscriptions","organizations_url":"https://api.github.com/users/ppot/orgs","repos_url":"https://api.github.com/users/ppot/repos","events_url":"https://api.github.com/users/ppot/events{/privacy}","received_events_url":"https://api.github.com/users/ppot/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ppot/hyper","description":"A terminal built on web technologies","fork":true,"url":"https://api.github.com/repos/ppot/hyper","forks_url":"https://api.github.com/repos/ppot/hyper/forks","keys_url":"https://api.github.com/repos/ppot/hyper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ppot/hyper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ppot/hyper/teams","hooks_url":"https://api.github.com/repos/ppot/hyper/hooks","issue_events_url":"https://api.github.com/repos/ppot/hyper/issues/events{/number}","events_url":"https://api.github.com/repos/ppot/hyper/events","assignees_url":"https://api.github.com/repos/ppot/hyper/assignees{/user}","branches_url":"https://api.github.com/repos/ppot/hyper/branches{/branch}","tags_url":"https://api.github.com/repos/ppot/hyper/tags","blobs_url":"https://api.github.com/repos/ppot/hyper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ppot/hyper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ppot/hyper/git/refs{/sha}","trees_url":"https://api.github.com/repos/ppot/hyper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ppot/hyper/statuses/{sha}","languages_url":"https://api.github.com/repos/ppot/hyper/languages","stargazers_url":"https://api.github.com/repos/ppot/hyper/stargazers","contributors_url":"https://api.github.com/repos/ppot/hyper/contributors","subscribers_url":"https://api.github.com/repos/ppot/hyper/subscribers","subscription_url":"https://api.github.com/repos/ppot/hyper/subscription","commits_url":"https://api.github.com/repos/ppot/hyper/commits{/sha}","git_commits_url":"https://api.github.com/repos/ppot/hyper/git/commits{/sha}","comments_url":"https://api.github.com/repos/ppot/hyper/comments{/number}","issue_comment_url":"https://api.github.com/repos/ppot/hyper/issues/comments{/number}","contents_url":"https://api.github.com/repos/ppot/hyper/contents/{+path}","compare_url":"https://api.github.com/repos/ppot/hyper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ppot/hyper/merges","archive_url":"https://api.github.com/repos/ppot/hyper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ppot/hyper/downloads","issues_url":"https://api.github.com/repos/ppot/hyper/issues{/number}","pulls_url":"https://api.github.com/repos/ppot/hyper/pulls{/number}","milestones_url":"https://api.github.com/repos/ppot/hyper/milestones{/number}","notifications_url":"https://api.github.com/repos/ppot/hyper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ppot/hyper/labels{/name}","releases_url":"https://api.github.com/repos/ppot/hyper/releases{/id}","deployments_url":"https://api.github.com/repos/ppot/hyper/deployments","created_at":"2016-10-08T02:03:04Z","updated_at":"2016-10-08T02:03:05Z","pushed_at":"2016-12-30T00:10:33Z","git_url":"git://github.com/ppot/hyper.git","ssh_url":"git@github.com:ppot/hyper.git","clone_url":"https://github.com/ppot/hyper.git","svn_url":"https://github.com/ppot/hyper","homepage":"https://hyper.is","size":1913,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"zeit:master","ref":"master","sha":"63ab44778bf6170ddabcdb8a520258cbb295a4d4","user":{"login":"zeit","id":14985020,"avatar_url":"https://avatars.githubusercontent.com/u/14985020?v=3","gravatar_id":"","url":"https://api.github.com/users/zeit","html_url":"https://github.com/zeit","followers_url":"https://api.github.com/users/zeit/followers","following_url":"https://api.github.com/users/zeit/following{/other_user}","gists_url":"https://api.github.com/users/zeit/gists{/gist_id}","starred_url":"https://api.github.com/users/zeit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeit/subscriptions","organizations_url":"https://api.github.com/users/zeit/orgs","repos_url":"https://api.github.com/users/zeit/repos","events_url":"https://api.github.com/users/zeit/events{/privacy}","received_events_url":"https://api.github.com/users/zeit/received_events","type":"Organization","site_admin":false},"repo":{"id":62367558,"name":"hyper","full_name":"zeit/hyper","owner":{"login":"zeit","id":14985020,"avatar_url":"https://avatars.githubusercontent.com/u/14985020?v=3","gravatar_id":"","url":"https://api.github.com/users/zeit","html_url":"https://github.com/zeit","followers_url":"https://api.github.com/users/zeit/followers","following_url":"https://api.github.com/users/zeit/following{/other_user}","gists_url":"https://api.github.com/users/zeit/gists{/gist_id}","starred_url":"https://api.github.com/users/zeit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeit/subscriptions","organizations_url":"https://api.github.com/users/zeit/orgs","repos_url":"https://api.github.com/users/zeit/repos","events_url":"https://api.github.com/users/zeit/events{/privacy}","received_events_url":"https://api.github.com/users/zeit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zeit/hyper","description":"A terminal built on web technologies","fork":false,"url":"https://api.github.com/repos/zeit/hyper","forks_url":"https://api.github.com/repos/zeit/hyper/forks","keys_url":"https://api.github.com/repos/zeit/hyper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zeit/hyper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zeit/hyper/teams","hooks_url":"https://api.github.com/repos/zeit/hyper/hooks","issue_events_url":"https://api.github.com/repos/zeit/hyper/issues/events{/number}","events_url":"https://api.github.com/repos/zeit/hyper/events","assignees_url":"https://api.github.com/repos/zeit/hyper/assignees{/user}","branches_url":"https://api.github.com/repos/zeit/hyper/branches{/branch}","tags_url":"https://api.github.com/repos/zeit/hyper/tags","blobs_url":"https://api.github.com/repos/zeit/hyper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zeit/hyper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zeit/hyper/git/refs{/sha}","trees_url":"https://api.github.com/repos/zeit/hyper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zeit/hyper/statuses/{sha}","languages_url":"https://api.github.com/repos/zeit/hyper/languages","stargazers_url":"https://api.github.com/repos/zeit/hyper/stargazers","contributors_url":"https://api.github.com/repos/zeit/hyper/contributors","subscribers_url":"https://api.github.com/repos/zeit/hyper/subscribers","subscription_url":"https://api.github.com/repos/zeit/hyper/subscription","commits_url":"https://api.github.com/repos/zeit/hyper/commits{/sha}","git_commits_url":"https://api.github.com/repos/zeit/hyper/git/commits{/sha}","comments_url":"https://api.github.com/repos/zeit/hyper/comments{/number}","issue_comment_url":"https://api.github.com/repos/zeit/hyper/issues/comments{/number}","contents_url":"https://api.github.com/repos/zeit/hyper/contents/{+path}","compare_url":"https://api.github.com/repos/zeit/hyper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zeit/hyper/merges","archive_url":"https://api.github.com/repos/zeit/hyper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zeit/hyper/downloads","issues_url":"https://api.github.com/repos/zeit/hyper/issues{/number}","pulls_url":"https://api.github.com/repos/zeit/hyper/pulls{/number}","milestones_url":"https://api.github.com/repos/zeit/hyper/milestones{/number}","notifications_url":"https://api.github.com/repos/zeit/hyper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zeit/hyper/labels{/name}","releases_url":"https://api.github.com/repos/zeit/hyper/releases{/id}","deployments_url":"https://api.github.com/repos/zeit/hyper/deployments","created_at":"2016-07-01T06:01:21Z","updated_at":"2017-01-02T20:27:33Z","pushed_at":"2017-01-02T19:56:49Z","git_url":"git://github.com/zeit/hyper.git","ssh_url":"git@github.com:zeit/hyper.git","clone_url":"https://github.com/zeit/hyper.git","svn_url":"https://github.com/zeit/hyper","homepage":"https://hyper.is","size":1972,"stargazers_count":13675,"watchers_count":13675,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":912,"mirror_url":null,"open_issues_count":429,"forks":912,"open_issues":429,"watchers":13675,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zeit/hyper/pulls/945"},"html":{"href":"https://github.com/zeit/hyper/pull/945"},"issue":{"href":"https://api.github.com/repos/zeit/hyper/issues/945"},"comments":{"href":"https://api.github.com/repos/zeit/hyper/issues/945/comments"},"review_comments":{"href":"https://api.github.com/repos/zeit/hyper/pulls/945/comments"},"review_comment":{"href":"https://api.github.com/repos/zeit/hyper/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zeit/hyper/pulls/945/commits"},"statuses":{"href":"https://api.github.com/repos/zeit/hyper/statuses/1eb7b05b85e458656bb37656c094b29ca029a430"}}}}
{"actor":{"display_login":"ppot"}}