{"action":"created","issue":{"url":"https://api.github.com/repos/scopatz/xonsh/issues/108","labels_url":"https://api.github.com/repos/scopatz/xonsh/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/scopatz/xonsh/issues/108/comments","events_url":"https://api.github.com/repos/scopatz/xonsh/issues/108/events","html_url":"https://github.com/scopatz/xonsh/issues/108","id":63093588,"number":108,"title":"How to enable a pyvenv/venv in xonsh ?","user":{"login":"GMLudo","id":243823,"avatar_url":"https://avatars.githubusercontent.com/u/243823?v=3","gravatar_id":"","url":"https://api.github.com/users/GMLudo","html_url":"https://github.com/GMLudo","followers_url":"https://api.github.com/users/GMLudo/followers","following_url":"https://api.github.com/users/GMLudo/following{/other_user}","gists_url":"https://api.github.com/users/GMLudo/gists{/gist_id}","starred_url":"https://api.github.com/users/GMLudo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GMLudo/subscriptions","organizations_url":"https://api.github.com/users/GMLudo/orgs","repos_url":"https://api.github.com/users/GMLudo/repos","events_url":"https://api.github.com/users/GMLudo/events{/privacy}","received_events_url":"https://api.github.com/users/GMLudo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/scopatz/xonsh/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/scopatz/xonsh/milestones/1","html_url":"https://github.com/scopatz/xonsh/milestones/v0.2","labels_url":"https://api.github.com/repos/scopatz/xonsh/milestones/1/labels","id":1013181,"number":1,"title":"v0.2","description":"","creator":{"login":"scopatz","id":320553,"avatar_url":"https://avatars.githubusercontent.com/u/320553?v=3","gravatar_id":"","url":"https://api.github.com/users/scopatz","html_url":"https://github.com/scopatz","followers_url":"https://api.github.com/users/scopatz/followers","following_url":"https://api.github.com/users/scopatz/following{/other_user}","gists_url":"https://api.github.com/users/scopatz/gists{/gist_id}","starred_url":"https://api.github.com/users/scopatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scopatz/subscriptions","organizations_url":"https://api.github.com/users/scopatz/orgs","repos_url":"https://api.github.com/users/scopatz/repos","events_url":"https://api.github.com/users/scopatz/events{/privacy}","received_events_url":"https://api.github.com/users/scopatz/received_events","type":"User","site_admin":false},"open_issues":26,"closed_issues":171,"state":"open","created_at":"2015-03-09T18:29:10Z","updated_at":"2015-04-14T14:05:43Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-03-19T21:24:40Z","updated_at":"2015-04-15T02:00:21Z","closed_at":null,"body":"Hi,\r\n\r\nAs you understand, I'm trying to replace bash by xonsh.\r\nI've an issue when I try to enable a pyvenv in xonsh:\r\n\r\n    $ . pyvenv/bin/activate\r\n    Traceback (most recent call last):\r\n    File \"/usr/local/lib/python3.4/dist-packages/xonsh/shell.py\", line 109, in default\r\n        self.execer.exec(code, mode='single', glbs=None, locs=self.ctx)\r\n    File \"/usr/local/lib/python3.4/dist-packages/xonsh/execer.py\", line 110, in exec\r\n        return exec(code, glbs, locs)\r\n    File \"<xonsh-code>\", line 1, in <module>\r\n    File \"/usr/local/lib/python3.4/dist-packages/xonsh/built_ins.py\", line 383, in subproc_uncaptured\r\n        return run_subproc(cmds, captured=False)\r\n    File \"/usr/local/lib/python3.4/dist-packages/xonsh/built_ins.py\", line 355, in run_subproc\r\n        stdin=stdin, stdout=stdout)\r\n    File \"/usr/lib/python3.4/subprocess.py\", line 848, in __init__\r\n        restore_signals, start_new_session)\r\n    File \"/usr/lib/python3.4/subprocess.py\", line 1446, in _execute_child\r\n        raise child_exception_type(errno_num, err_msg)\r\n    PermissionError: [Errno 13] Permission denied\r\n\r\nI understand the stacktrace, but, how I could enable a pyvenv in xonsh ?\r\n\r\nBTW, thanks a lot for xonsh, I like it a lot.\r\nAt least for me, it was the missing piece I'm waiting to replace bash by a more Pythonic console, and keep in the same time some facilities of bash."},"comment":{"url":"https://api.github.com/repos/scopatz/xonsh/issues/comments/93146858","html_url":"https://github.com/scopatz/xonsh/issues/108#issuecomment-93146858","issue_url":"https://api.github.com/repos/scopatz/xonsh/issues/108","id":93146858,"user":{"login":"wrywerytwreywery","id":549404,"avatar_url":"https://avatars.githubusercontent.com/u/549404?v=3","gravatar_id":"","url":"https://api.github.com/users/wrywerytwreywery","html_url":"https://github.com/wrywerytwreywery","followers_url":"https://api.github.com/users/wrywerytwreywery/followers","following_url":"https://api.github.com/users/wrywerytwreywery/following{/other_user}","gists_url":"https://api.github.com/users/wrywerytwreywery/gists{/gist_id}","starred_url":"https://api.github.com/users/wrywerytwreywery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wrywerytwreywery/subscriptions","organizations_url":"https://api.github.com/users/wrywerytwreywery/orgs","repos_url":"https://api.github.com/users/wrywerytwreywery/repos","events_url":"https://api.github.com/users/wrywerytwreywery/events{/privacy}","received_events_url":"https://api.github.com/users/wrywerytwreywery/received_events","type":"User","site_admin":false},"created_at":"2015-04-15T02:00:21Z","updated_at":"2015-04-15T02:00:21Z","body":"I am not sure about the virtualenv stuff, but customizing the prompt in a general sense is possible (see [this section](http://xonsh.org/tutorial#customizing-the-prompt) of the xonsh tutorial).\r\n\r\nI haven't tested, but if virtualenv is setting `$PS1` to try to make that change, it seems like you could set your xonsh prompt always to read that value from the environment:\r\n`$PROMPT = lambda: $PS1`\r\n\r\n...though though that would require doing some transformation on the bash prompt as well to translate it to xonsh's format (could be just replacing the bash prompt's escaped characters with relevant `{variable}` strings, and adding those variables to `FORMATTER_DICT`).  It could be the case that we want to have something equivalent to `bash_aliases`, but for prompts, to facilitate this kind of change..."}}