{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/io.js/pulls/comments/35353584","id":35353584,"diff_hunk":"@@ -51,19 +53,45 @@ function createRepl(env, cb) {\n   }\n \n   const repl = REPL.start(opts);\n-  if (opts.terminal && env.NODE_REPL_HISTORY_FILE) {\n-    return setupHistory(repl, env.NODE_REPL_HISTORY_FILE, cb);\n+  if (opts.terminal && env.NODE_REPL_HISTORY !== '') {\n+    return setupHistory(repl, env.NODE_REPL_HISTORY,\n+                        env.NODE_REPL_HISTORY_FILE, cb);\n   }\n   repl._historyPrev = _replHistoryMessage;\n   cb(null, repl);\n }\n \n-function setupHistory(repl, historyPath, ready) {\n-  const fs = require('fs');\n+function setupHistory(repl, historyPath, oldHistoryPath, ready) {\n+  if (!historyPath) {\n+    try {\n+      historyPath = path.join(os.homedir(), '.node_repl_history');\n+    } catch {","path":"lib/internal/repl.js","position":29,"original_position":29,"commit_id":"e23566ff8703a14205412699d5fcf169081674f8","original_commit_id":"e23566ff8703a14205412699d5fcf169081674f8","user":{"login":"chrisdickinson","id":37303,"avatar_url":"https://avatars.githubusercontent.com/u/37303?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdickinson","html_url":"https://github.com/chrisdickinson","followers_url":"https://api.github.com/users/chrisdickinson/followers","following_url":"https://api.github.com/users/chrisdickinson/following{/other_user}","gists_url":"https://api.github.com/users/chrisdickinson/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdickinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdickinson/subscriptions","organizations_url":"https://api.github.com/users/chrisdickinson/orgs","repos_url":"https://api.github.com/users/chrisdickinson/repos","events_url":"https://api.github.com/users/chrisdickinson/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdickinson/received_events","type":"User","site_admin":false},"body":"This is missing `(err)`","created_at":"2015-07-23T18:18:51Z","updated_at":"2015-07-23T18:18:51Z","html_url":"https://github.com/nodejs/io.js/pull/2224#discussion_r35353584","pull_request_url":"https://api.github.com/repos/nodejs/io.js/pulls/2224","_links":{"self":{"href":"https://api.github.com/repos/nodejs/io.js/pulls/comments/35353584"},"html":{"href":"https://github.com/nodejs/io.js/pull/2224#discussion_r35353584"},"pull_request":{"href":"https://api.github.com/repos/nodejs/io.js/pulls/2224"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/io.js/pulls/2224","id":40586526,"html_url":"https://github.com/nodejs/io.js/pull/2224","diff_url":"https://github.com/nodejs/io.js/pull/2224.diff","patch_url":"https://github.com/nodejs/io.js/pull/2224.patch","issue_url":"https://api.github.com/repos/nodejs/io.js/issues/2224","number":2224,"state":"open","locked":false,"title":"repl: persist in plain text, save to home tmp directory by default","user":{"login":"Fishrock123","id":1093990,"avatar_url":"https://avatars.githubusercontent.com/u/1093990?v=3","gravatar_id":"","url":"https://api.github.com/users/Fishrock123","html_url":"https://github.com/Fishrock123","followers_url":"https://api.github.com/users/Fishrock123/followers","following_url":"https://api.github.com/users/Fishrock123/following{/other_user}","gists_url":"https://api.github.com/users/Fishrock123/gists{/gist_id}","starred_url":"https://api.github.com/users/Fishrock123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fishrock123/subscriptions","organizations_url":"https://api.github.com/users/Fishrock123/orgs","repos_url":"https://api.github.com/users/Fishrock123/repos","events_url":"https://api.github.com/users/Fishrock123/events{/privacy}","received_events_url":"https://api.github.com/users/Fishrock123/received_events","type":"User","site_admin":false},"body":"I know @chrisdickinson said it would have been better to have the repl save in plain text, and that doing so would require a semver-major change.\r\n\r\nI'd like to get it into 3.0 if possible, and I'm willing to do whatever if it looks good to people.\r\n\r\nThis also effectively enables it by default, by using `os.homedir()` to get an appropriate location (I think?). Perhaps I should be handling more errors if it can't exist?\r\n\r\nThe first commit is the important one.\r\n\r\nR= @chrisdickinson or @rvagg since he's doing 3.0?","created_at":"2015-07-22T16:51:06Z","updated_at":"2015-07-23T18:18:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f734e2777f9870adb1292c28ac1563fc21db1be9","assignee":null,"milestone":{"url":"https://api.github.com/repos/nodejs/io.js/milestones/7","html_url":"https://github.com/nodejs/io.js/milestones/3.0.0","labels_url":"https://api.github.com/repos/nodejs/io.js/milestones/7/labels","id":1072486,"number":7,"title":"3.0.0","description":"","creator":{"login":"chrisdickinson","id":37303,"avatar_url":"https://avatars.githubusercontent.com/u/37303?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdickinson","html_url":"https://github.com/chrisdickinson","followers_url":"https://api.github.com/users/chrisdickinson/followers","following_url":"https://api.github.com/users/chrisdickinson/following{/other_user}","gists_url":"https://api.github.com/users/chrisdickinson/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdickinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdickinson/subscriptions","organizations_url":"https://api.github.com/users/chrisdickinson/orgs","repos_url":"https://api.github.com/users/chrisdickinson/repos","events_url":"https://api.github.com/users/chrisdickinson/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdickinson/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":7,"state":"open","created_at":"2015-04-17T16:49:06Z","updated_at":"2015-07-22T16:51:06Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/nodejs/io.js/pulls/2224/commits","review_comments_url":"https://api.github.com/repos/nodejs/io.js/pulls/2224/comments","review_comment_url":"https://api.github.com/repos/nodejs/io.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/io.js/issues/2224/comments","statuses_url":"https://api.github.com/repos/nodejs/io.js/statuses/e23566ff8703a14205412699d5fcf169081674f8","head":{"label":"Fishrock123:repl-history-nojson","ref":"repl-history-nojson","sha":"e23566ff8703a14205412699d5fcf169081674f8","user":{"login":"Fishrock123","id":1093990,"avatar_url":"https://avatars.githubusercontent.com/u/1093990?v=3","gravatar_id":"","url":"https://api.github.com/users/Fishrock123","html_url":"https://github.com/Fishrock123","followers_url":"https://api.github.com/users/Fishrock123/followers","following_url":"https://api.github.com/users/Fishrock123/following{/other_user}","gists_url":"https://api.github.com/users/Fishrock123/gists{/gist_id}","starred_url":"https://api.github.com/users/Fishrock123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fishrock123/subscriptions","organizations_url":"https://api.github.com/users/Fishrock123/orgs","repos_url":"https://api.github.com/users/Fishrock123/repos","events_url":"https://api.github.com/users/Fishrock123/events{/privacy}","received_events_url":"https://api.github.com/users/Fishrock123/received_events","type":"User","site_admin":false},"repo":{"id":29684638,"name":"io.js","full_name":"Fishrock123/io.js","owner":{"login":"Fishrock123","id":1093990,"avatar_url":"https://avatars.githubusercontent.com/u/1093990?v=3","gravatar_id":"","url":"https://api.github.com/users/Fishrock123","html_url":"https://github.com/Fishrock123","followers_url":"https://api.github.com/users/Fishrock123/followers","following_url":"https://api.github.com/users/Fishrock123/following{/other_user}","gists_url":"https://api.github.com/users/Fishrock123/gists{/gist_id}","starred_url":"https://api.github.com/users/Fishrock123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fishrock123/subscriptions","organizations_url":"https://api.github.com/users/Fishrock123/orgs","repos_url":"https://api.github.com/users/Fishrock123/repos","events_url":"https://api.github.com/users/Fishrock123/events{/privacy}","received_events_url":"https://api.github.com/users/Fishrock123/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Fishrock123/io.js","description":"A spork of Node.js with an open governance model","fork":true,"url":"https://api.github.com/repos/Fishrock123/io.js","forks_url":"https://api.github.com/repos/Fishrock123/io.js/forks","keys_url":"https://api.github.com/repos/Fishrock123/io.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Fishrock123/io.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Fishrock123/io.js/teams","hooks_url":"https://api.github.com/repos/Fishrock123/io.js/hooks","issue_events_url":"https://api.github.com/repos/Fishrock123/io.js/issues/events{/number}","events_url":"https://api.github.com/repos/Fishrock123/io.js/events","assignees_url":"https://api.github.com/repos/Fishrock123/io.js/assignees{/user}","branches_url":"https://api.github.com/repos/Fishrock123/io.js/branches{/branch}","tags_url":"https://api.github.com/repos/Fishrock123/io.js/tags","blobs_url":"https://api.github.com/repos/Fishrock123/io.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Fishrock123/io.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Fishrock123/io.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/Fishrock123/io.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Fishrock123/io.js/statuses/{sha}","languages_url":"https://api.github.com/repos/Fishrock123/io.js/languages","stargazers_url":"https://api.github.com/repos/Fishrock123/io.js/stargazers","contributors_url":"https://api.github.com/repos/Fishrock123/io.js/contributors","subscribers_url":"https://api.github.com/repos/Fishrock123/io.js/subscribers","subscription_url":"https://api.github.com/repos/Fishrock123/io.js/subscription","commits_url":"https://api.github.com/repos/Fishrock123/io.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/Fishrock123/io.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/Fishrock123/io.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/Fishrock123/io.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/Fishrock123/io.js/contents/{+path}","compare_url":"https://api.github.com/repos/Fishrock123/io.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Fishrock123/io.js/merges","archive_url":"https://api.github.com/repos/Fishrock123/io.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Fishrock123/io.js/downloads","issues_url":"https://api.github.com/repos/Fishrock123/io.js/issues{/number}","pulls_url":"https://api.github.com/repos/Fishrock123/io.js/pulls{/number}","milestones_url":"https://api.github.com/repos/Fishrock123/io.js/milestones{/number}","notifications_url":"https://api.github.com/repos/Fishrock123/io.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Fishrock123/io.js/labels{/name}","releases_url":"https://api.github.com/repos/Fishrock123/io.js/releases{/id}","created_at":"2015-01-22T15:15:17Z","updated_at":"2015-05-20T14:49:19Z","pushed_at":"2015-07-23T17:39:21Z","git_url":"git://github.com/Fishrock123/io.js.git","ssh_url":"git@github.com:Fishrock123/io.js.git","clone_url":"https://github.com/Fishrock123/io.js.git","svn_url":"https://github.com/Fishrock123/io.js","homepage":"https://iojs.org","size":134593,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"nodejs:master","ref":"master","sha":"eb35968de7a040d737f3280e9fed0b6edf566b2b","user":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"repo":{"id":27193779,"name":"io.js","full_name":"nodejs/io.js","owner":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nodejs/io.js","description":"Future Node.js releases will be based on io.js","fork":false,"url":"https://api.github.com/repos/nodejs/io.js","forks_url":"https://api.github.com/repos/nodejs/io.js/forks","keys_url":"https://api.github.com/repos/nodejs/io.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nodejs/io.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nodejs/io.js/teams","hooks_url":"https://api.github.com/repos/nodejs/io.js/hooks","issue_events_url":"https://api.github.com/repos/nodejs/io.js/issues/events{/number}","events_url":"https://api.github.com/repos/nodejs/io.js/events","assignees_url":"https://api.github.com/repos/nodejs/io.js/assignees{/user}","branches_url":"https://api.github.com/repos/nodejs/io.js/branches{/branch}","tags_url":"https://api.github.com/repos/nodejs/io.js/tags","blobs_url":"https://api.github.com/repos/nodejs/io.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nodejs/io.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nodejs/io.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/nodejs/io.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nodejs/io.js/statuses/{sha}","languages_url":"https://api.github.com/repos/nodejs/io.js/languages","stargazers_url":"https://api.github.com/repos/nodejs/io.js/stargazers","contributors_url":"https://api.github.com/repos/nodejs/io.js/contributors","subscribers_url":"https://api.github.com/repos/nodejs/io.js/subscribers","subscription_url":"https://api.github.com/repos/nodejs/io.js/subscription","commits_url":"https://api.github.com/repos/nodejs/io.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/nodejs/io.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/nodejs/io.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/nodejs/io.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/nodejs/io.js/contents/{+path}","compare_url":"https://api.github.com/repos/nodejs/io.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nodejs/io.js/merges","archive_url":"https://api.github.com/repos/nodejs/io.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nodejs/io.js/downloads","issues_url":"https://api.github.com/repos/nodejs/io.js/issues{/number}","pulls_url":"https://api.github.com/repos/nodejs/io.js/pulls{/number}","milestones_url":"https://api.github.com/repos/nodejs/io.js/milestones{/number}","notifications_url":"https://api.github.com/repos/nodejs/io.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nodejs/io.js/labels{/name}","releases_url":"https://api.github.com/repos/nodejs/io.js/releases{/id}","created_at":"2014-11-26T19:57:11Z","updated_at":"2015-07-23T15:58:15Z","pushed_at":"2015-07-23T18:13:46Z","git_url":"git://github.com/nodejs/io.js.git","ssh_url":"git@github.com:nodejs/io.js.git","clone_url":"https://github.com/nodejs/io.js.git","svn_url":"https://github.com/nodejs/io.js","homepage":"https://iojs.org","size":190496,"stargazers_count":12911,"watchers_count":12911,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1033,"mirror_url":null,"open_issues_count":289,"forks":1033,"open_issues":289,"watchers":12911,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/io.js/pulls/2224"},"html":{"href":"https://github.com/nodejs/io.js/pull/2224"},"issue":{"href":"https://api.github.com/repos/nodejs/io.js/issues/2224"},"comments":{"href":"https://api.github.com/repos/nodejs/io.js/issues/2224/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/io.js/pulls/2224/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/io.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/io.js/pulls/2224/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/io.js/statuses/e23566ff8703a14205412699d5fcf169081674f8"}}}}