{"action":"created","issue":{"url":"https://api.github.com/repos/xonsh/xonsh/issues/1204","repository_url":"https://api.github.com/repos/xonsh/xonsh","labels_url":"https://api.github.com/repos/xonsh/xonsh/issues/1204/labels{/name}","comments_url":"https://api.github.com/repos/xonsh/xonsh/issues/1204/comments","events_url":"https://api.github.com/repos/xonsh/xonsh/issues/1204/events","html_url":"https://github.com/xonsh/xonsh/issues/1204","id":159721941,"number":1204,"title":"Xonsh needs a way to run startup scripts after load time","user":{"login":"eode","id":2475983,"avatar_url":"https://avatars.githubusercontent.com/u/2475983?v=3","gravatar_id":"","url":"https://api.github.com/users/eode","html_url":"https://github.com/eode","followers_url":"https://api.github.com/users/eode/followers","following_url":"https://api.github.com/users/eode/following{/other_user}","gists_url":"https://api.github.com/users/eode/gists{/gist_id}","starred_url":"https://api.github.com/users/eode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eode/subscriptions","organizations_url":"https://api.github.com/users/eode/orgs","repos_url":"https://api.github.com/users/eode/repos","events_url":"https://api.github.com/users/eode/events{/privacy}","received_events_url":"https://api.github.com/users/eode/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/xonsh/xonsh/labels/feature","name":"feature","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/xonsh/xonsh/milestones/4","html_url":"https://github.com/xonsh/xonsh/milestones/v0.4.0","labels_url":"https://api.github.com/repos/xonsh/xonsh/milestones/4/labels","id":1779851,"number":4,"title":"v0.4.0","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":182,"closed_issues":168,"state":"open","created_at":"2016-05-20T22:54:44Z","updated_at":"2016-06-22T16:47:12Z","due_on":"2016-06-30T04:00:00Z","closed_at":null},"comments":5,"created_at":"2016-06-10T20:56:18Z","updated_at":"2016-06-22T17:48:48Z","closed_at":null,"body":"Currently, .xonshrc and files in $XONSHRC are loaded before xonsh variables are present.  There was a discussion about this, the main takeaways being:\r\n\r\n* Implementing a $XONSHRC_POSTLOAD would be the preferred method\r\n  * this would be a list of files (and functions?)\r\n  * this would probably have a default or two, like ['~/.xonshrc_postload']\r\n  * missing files would be silently ignored, as with $XONSHRC\r\n\r\nOther Ideas tossed around:\r\n* Use a function or comment token to split the file into two sections.  Execute the first pre-load, and the second once the shell is loaded.  This doesn't really have any drawbacks that I see offhand.\r\n* cleaning up the startup process so perhaps this isn't necessary might work, but would take no small effort\r\n* Having a function or group of functions, like postload_foo() which would be called if created in .xonshrc\r\n* Having a second .xonshrc file without envvar"},"comment":{"url":"https://api.github.com/repos/xonsh/xonsh/issues/comments/227823036","html_url":"https://github.com/xonsh/xonsh/issues/1204#issuecomment-227823036","issue_url":"https://api.github.com/repos/xonsh/xonsh/issues/1204","id":227823036,"user":{"login":"melund","id":1038978,"avatar_url":"https://avatars.githubusercontent.com/u/1038978?v=3","gravatar_id":"","url":"https://api.github.com/users/melund","html_url":"https://github.com/melund","followers_url":"https://api.github.com/users/melund/followers","following_url":"https://api.github.com/users/melund/following{/other_user}","gists_url":"https://api.github.com/users/melund/gists{/gist_id}","starred_url":"https://api.github.com/users/melund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melund/subscriptions","organizations_url":"https://api.github.com/users/melund/orgs","repos_url":"https://api.github.com/users/melund/repos","events_url":"https://api.github.com/users/melund/events{/privacy}","received_events_url":"https://api.github.com/users/melund/received_events","type":"User","site_admin":false},"created_at":"2016-06-22T17:48:48Z","updated_at":"2016-06-22T17:48:48Z","body":"I also think an environment variable is the best and simpler option.\r\n\r\n Another possibility (maybe more suited for xontrib) is hook functions. Pytest has a cool system for that from which we may get inspired. https://pytest.org/latest/writing_plugins.html"}}
{"actor":{"display_login":"melund"}}