{"action":"closed","number":1200,"pull_request":{"url":"https://api.github.com/repos/pypa/virtualenv/pulls/1200","id":212512572,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEyNTEyNTcy","html_url":"https://github.com/pypa/virtualenv/pull/1200","diff_url":"https://github.com/pypa/virtualenv/pull/1200.diff","patch_url":"https://github.com/pypa/virtualenv/pull/1200.patch","issue_url":"https://api.github.com/repos/pypa/virtualenv/issues/1200","number":1200,"state":"closed","locked":false,"title":"activate.csh handle newlines & don't use basename","user":{"login":"gregory-nisbet","id":4076227,"node_id":"MDQ6VXNlcjQwNzYyMjc=","avatar_url":"https://avatars1.githubusercontent.com/u/4076227?v=4","gravatar_id":"","url":"https://api.github.com/users/gregory-nisbet","html_url":"https://github.com/gregory-nisbet","followers_url":"https://api.github.com/users/gregory-nisbet/followers","following_url":"https://api.github.com/users/gregory-nisbet/following{/other_user}","gists_url":"https://api.github.com/users/gregory-nisbet/gists{/gist_id}","starred_url":"https://api.github.com/users/gregory-nisbet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregory-nisbet/subscriptions","organizations_url":"https://api.github.com/users/gregory-nisbet/orgs","repos_url":"https://api.github.com/users/gregory-nisbet/repos","events_url":"https://api.github.com/users/gregory-nisbet/events{/privacy}","received_events_url":"https://api.github.com/users/gregory-nisbet/received_events","type":"User","site_admin":false},"body":"Current `activate.csh` script is not robust against newlines in the prompt and uses `basename` unnecessarily.\r\n\r\nFor example, this `.tcshrc` file contains a prompt that breaks the script\r\n\r\n```\r\nonintr -\r\n\r\nset tcshrc_nl = '\\\r\n'\r\n\r\n if ($?prompt) then\r\n    set ellipsis = \"...\"\r\n    set prompt = \"$tcshrc_nl:q\"\"%B[%.03]%b %# \"\r\n endif\r\n\r\nonintr\r\n```\r\n\r\nI modified the script to detect the presence of newlines and avoid changing the prompt at all in those cases.\r\n\r\nThe correct thing to do would probably be to add '[...]' to the beginning of the last line of the prompt, but I don't know of any easy way to accomplish that with csh. I briefly looked into `s///`-type substitution and using a temporary array variable to split the string into lines, but couldn't get it to work.\r\n\r\n`tcsh` and `csh` also have the `:t` modifier for returning the last `/`-delimited component from a path, e.g.\r\n\r\n```\r\n[~] > set a = /a/b/c/d\r\n[~] > echo $a:t\r\nd\r\n```\r\n\r\nAlso, I replaced added `:q` to every variable expansion (except for the `$?varname` ones) to guard against characters like newlines.","created_at":"2018-08-31T23:18:13Z","updated_at":"2018-10-30T09:03:52Z","closed_at":"2018-10-30T09:03:52Z","merged_at":"2018-10-30T09:03:52Z","merge_commit_sha":"bb0c88f21d9ee815f31f0c1e1093beff426e24dc","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pypa/virtualenv/pulls/1200/commits","review_comments_url":"https://api.github.com/repos/pypa/virtualenv/pulls/1200/comments","review_comment_url":"https://api.github.com/repos/pypa/virtualenv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pypa/virtualenv/issues/1200/comments","statuses_url":"https://api.github.com/repos/pypa/virtualenv/statuses/81c74ed483656bf8529ebfbe10c5314b7c985947","head":{"label":"gregory-nisbet:master","ref":"master","sha":"81c74ed483656bf8529ebfbe10c5314b7c985947","user":{"login":"gregory-nisbet","id":4076227,"node_id":"MDQ6VXNlcjQwNzYyMjc=","avatar_url":"https://avatars1.githubusercontent.com/u/4076227?v=4","gravatar_id":"","url":"https://api.github.com/users/gregory-nisbet","html_url":"https://github.com/gregory-nisbet","followers_url":"https://api.github.com/users/gregory-nisbet/followers","following_url":"https://api.github.com/users/gregory-nisbet/following{/other_user}","gists_url":"https://api.github.com/users/gregory-nisbet/gists{/gist_id}","starred_url":"https://api.github.com/users/gregory-nisbet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregory-nisbet/subscriptions","organizations_url":"https://api.github.com/users/gregory-nisbet/orgs","repos_url":"https://api.github.com/users/gregory-nisbet/repos","events_url":"https://api.github.com/users/gregory-nisbet/events{/privacy}","received_events_url":"https://api.github.com/users/gregory-nisbet/received_events","type":"User","site_admin":false},"repo":{"id":146948753,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY5NDg3NTM=","name":"virtualenv","full_name":"gregory-nisbet/virtualenv","private":false,"owner":{"login":"gregory-nisbet","id":4076227,"node_id":"MDQ6VXNlcjQwNzYyMjc=","avatar_url":"https://avatars1.githubusercontent.com/u/4076227?v=4","gravatar_id":"","url":"https://api.github.com/users/gregory-nisbet","html_url":"https://github.com/gregory-nisbet","followers_url":"https://api.github.com/users/gregory-nisbet/followers","following_url":"https://api.github.com/users/gregory-nisbet/following{/other_user}","gists_url":"https://api.github.com/users/gregory-nisbet/gists{/gist_id}","starred_url":"https://api.github.com/users/gregory-nisbet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregory-nisbet/subscriptions","organizations_url":"https://api.github.com/users/gregory-nisbet/orgs","repos_url":"https://api.github.com/users/gregory-nisbet/repos","events_url":"https://api.github.com/users/gregory-nisbet/events{/privacy}","received_events_url":"https://api.github.com/users/gregory-nisbet/received_events","type":"User","site_admin":false},"html_url":"https://github.com/gregory-nisbet/virtualenv","description":"Virtual Python Environment builder","fork":true,"url":"https://api.github.com/repos/gregory-nisbet/virtualenv","forks_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/forks","keys_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/teams","hooks_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/hooks","issue_events_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/issues/events{/number}","events_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/events","assignees_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/assignees{/user}","branches_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/branches{/branch}","tags_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/tags","blobs_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/git/refs{/sha}","trees_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/statuses/{sha}","languages_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/languages","stargazers_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/stargazers","contributors_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/contributors","subscribers_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/subscribers","subscription_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/subscription","commits_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/commits{/sha}","git_commits_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/git/commits{/sha}","comments_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/comments{/number}","issue_comment_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/issues/comments{/number}","contents_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/contents/{+path}","compare_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/merges","archive_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/downloads","issues_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/issues{/number}","pulls_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/pulls{/number}","milestones_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/milestones{/number}","notifications_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/labels{/name}","releases_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/releases{/id}","deployments_url":"https://api.github.com/repos/gregory-nisbet/virtualenv/deployments","created_at":"2018-08-31T22:47:34Z","updated_at":"2018-10-30T09:03:20Z","pushed_at":"2018-10-30T09:03:18Z","git_url":"git://github.com/gregory-nisbet/virtualenv.git","ssh_url":"git@github.com:gregory-nisbet/virtualenv.git","clone_url":"https://github.com/gregory-nisbet/virtualenv.git","svn_url":"https://github.com/gregory-nisbet/virtualenv","homepage":"virtualenv.pypa.io","size":61952,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pypa:master","ref":"master","sha":"5d560144432642a91f6e1661bed22e637226c8fe","user":{"login":"pypa","id":647025,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NzAyNQ==","avatar_url":"https://avatars2.githubusercontent.com/u/647025?v=4","gravatar_id":"","url":"https://api.github.com/users/pypa","html_url":"https://github.com/pypa","followers_url":"https://api.github.com/users/pypa/followers","following_url":"https://api.github.com/users/pypa/following{/other_user}","gists_url":"https://api.github.com/users/pypa/gists{/gist_id}","starred_url":"https://api.github.com/users/pypa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pypa/subscriptions","organizations_url":"https://api.github.com/users/pypa/orgs","repos_url":"https://api.github.com/users/pypa/repos","events_url":"https://api.github.com/users/pypa/events{/privacy}","received_events_url":"https://api.github.com/users/pypa/received_events","type":"Organization","site_admin":false},"repo":{"id":1446474,"node_id":"MDEwOlJlcG9zaXRvcnkxNDQ2NDc0","name":"virtualenv","full_name":"pypa/virtualenv","private":false,"owner":{"login":"pypa","id":647025,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NzAyNQ==","avatar_url":"https://avatars2.githubusercontent.com/u/647025?v=4","gravatar_id":"","url":"https://api.github.com/users/pypa","html_url":"https://github.com/pypa","followers_url":"https://api.github.com/users/pypa/followers","following_url":"https://api.github.com/users/pypa/following{/other_user}","gists_url":"https://api.github.com/users/pypa/gists{/gist_id}","starred_url":"https://api.github.com/users/pypa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pypa/subscriptions","organizations_url":"https://api.github.com/users/pypa/orgs","repos_url":"https://api.github.com/users/pypa/repos","events_url":"https://api.github.com/users/pypa/events{/privacy}","received_events_url":"https://api.github.com/users/pypa/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/pypa/virtualenv","description":"Virtual Python Environment builder","fork":false,"url":"https://api.github.com/repos/pypa/virtualenv","forks_url":"https://api.github.com/repos/pypa/virtualenv/forks","keys_url":"https://api.github.com/repos/pypa/virtualenv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pypa/virtualenv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pypa/virtualenv/teams","hooks_url":"https://api.github.com/repos/pypa/virtualenv/hooks","issue_events_url":"https://api.github.com/repos/pypa/virtualenv/issues/events{/number}","events_url":"https://api.github.com/repos/pypa/virtualenv/events","assignees_url":"https://api.github.com/repos/pypa/virtualenv/assignees{/user}","branches_url":"https://api.github.com/repos/pypa/virtualenv/branches{/branch}","tags_url":"https://api.github.com/repos/pypa/virtualenv/tags","blobs_url":"https://api.github.com/repos/pypa/virtualenv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pypa/virtualenv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pypa/virtualenv/git/refs{/sha}","trees_url":"https://api.github.com/repos/pypa/virtualenv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pypa/virtualenv/statuses/{sha}","languages_url":"https://api.github.com/repos/pypa/virtualenv/languages","stargazers_url":"https://api.github.com/repos/pypa/virtualenv/stargazers","contributors_url":"https://api.github.com/repos/pypa/virtualenv/contributors","subscribers_url":"https://api.github.com/repos/pypa/virtualenv/subscribers","subscription_url":"https://api.github.com/repos/pypa/virtualenv/subscription","commits_url":"https://api.github.com/repos/pypa/virtualenv/commits{/sha}","git_commits_url":"https://api.github.com/repos/pypa/virtualenv/git/commits{/sha}","comments_url":"https://api.github.com/repos/pypa/virtualenv/comments{/number}","issue_comment_url":"https://api.github.com/repos/pypa/virtualenv/issues/comments{/number}","contents_url":"https://api.github.com/repos/pypa/virtualenv/contents/{+path}","compare_url":"https://api.github.com/repos/pypa/virtualenv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pypa/virtualenv/merges","archive_url":"https://api.github.com/repos/pypa/virtualenv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pypa/virtualenv/downloads","issues_url":"https://api.github.com/repos/pypa/virtualenv/issues{/number}","pulls_url":"https://api.github.com/repos/pypa/virtualenv/pulls{/number}","milestones_url":"https://api.github.com/repos/pypa/virtualenv/milestones{/number}","notifications_url":"https://api.github.com/repos/pypa/virtualenv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pypa/virtualenv/labels{/name}","releases_url":"https://api.github.com/repos/pypa/virtualenv/releases{/id}","deployments_url":"https://api.github.com/repos/pypa/virtualenv/deployments","created_at":"2011-03-06T14:33:27Z","updated_at":"2018-10-30T09:02:44Z","pushed_at":"2018-10-30T09:03:52Z","git_url":"git://github.com/pypa/virtualenv.git","ssh_url":"git@github.com:pypa/virtualenv.git","clone_url":"https://github.com/pypa/virtualenv.git","svn_url":"https://github.com/pypa/virtualenv","homepage":"virtualenv.pypa.io","size":63046,"stargazers_count":2824,"watchers_count":2824,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":685,"mirror_url":null,"archived":false,"open_issues_count":443,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":685,"open_issues":443,"watchers":2824,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pypa/virtualenv/pulls/1200"},"html":{"href":"https://github.com/pypa/virtualenv/pull/1200"},"issue":{"href":"https://api.github.com/repos/pypa/virtualenv/issues/1200"},"comments":{"href":"https://api.github.com/repos/pypa/virtualenv/issues/1200/comments"},"review_comments":{"href":"https://api.github.com/repos/pypa/virtualenv/pulls/1200/comments"},"review_comment":{"href":"https://api.github.com/repos/pypa/virtualenv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pypa/virtualenv/pulls/1200/commits"},"statuses":{"href":"https://api.github.com/repos/pypa/virtualenv/statuses/81c74ed483656bf8529ebfbe10c5314b7c985947"}},"author_association":"NONE","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"gaborbernat","id":690238,"node_id":"MDQ6VXNlcjY5MDIzOA==","avatar_url":"https://avatars1.githubusercontent.com/u/690238?v=4","gravatar_id":"","url":"https://api.github.com/users/gaborbernat","html_url":"https://github.com/gaborbernat","followers_url":"https://api.github.com/users/gaborbernat/followers","following_url":"https://api.github.com/users/gaborbernat/following{/other_user}","gists_url":"https://api.github.com/users/gaborbernat/gists{/gist_id}","starred_url":"https://api.github.com/users/gaborbernat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gaborbernat/subscriptions","organizations_url":"https://api.github.com/users/gaborbernat/orgs","repos_url":"https://api.github.com/users/gaborbernat/repos","events_url":"https://api.github.com/users/gaborbernat/events{/privacy}","received_events_url":"https://api.github.com/users/gaborbernat/received_events","type":"User","site_admin":false},"comments":5,"review_comments":0,"maintainer_can_modify":false,"commits":3,"additions":24,"deletions":17,"changed_files":3}}
{"actor":{"display_login":"gaborbernat"}}