{"action":"created","issue":{"url":"https://api.github.com/repos/scopatz/xonsh/issues/368","labels_url":"https://api.github.com/repos/scopatz/xonsh/issues/368/labels{/name}","comments_url":"https://api.github.com/repos/scopatz/xonsh/issues/368/comments","events_url":"https://api.github.com/repos/scopatz/xonsh/issues/368/events","html_url":"https://github.com/scopatz/xonsh/pull/368","id":102180925,"number":368,"title":"First attempt to make a hack for prompt-toolkit coloring","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},"labels":[{"url":"https://api.github.com/repos/scopatz/xonsh/labels/feature","name":"feature","color":"009800"}],"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":59,"closed_issues":285,"state":"open","created_at":"2015-03-09T18:29:10Z","updated_at":"2015-08-22T21:07:43Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-08-20T16:45:12Z","updated_at":"2015-08-22T21:46:10Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/scopatz/xonsh/pulls/368","html_url":"https://github.com/scopatz/xonsh/pull/368","diff_url":"https://github.com/scopatz/xonsh/pull/368.diff","patch_url":"https://github.com/scopatz/xonsh/pull/368.patch"},"body":"This may not be ready for merging yet.\r\n\r\nI made an attempt to implement the suggestions from @jonathanslenders to get coloring working with prompt toolkit. Some part of it is quite a hack, but it works without changing the current way prompt colors are set in xonsh. So it basically strips the color codes from the prompt string and converts them to pygments tokens. It makes a reversed lookup in the TERM_COLORS dictionary (that is the hack-ish part) \r\n\r\nThe good thing about this setup is that it only recomputes the prompt once for every input. That seems to speed things up quite a lot. \r\n\r\nI still haven't found out how to reserve the lower lines the terminal. So the prompt still jumps up/down when the completer list pops up (https://github.com/scopatz/xonsh/issues/362). \r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/scopatz/xonsh/issues/comments/133756983","html_url":"https://github.com/scopatz/xonsh/pull/368#issuecomment-133756983","issue_url":"https://api.github.com/repos/scopatz/xonsh/issues/368","id":133756983,"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":"2015-08-22T21:46:10Z","updated_at":"2015-08-22T21:46:10Z","body":"@scopatz . It is ready for a review :)"}}