{"action":"created","comment":{"url":"https://api.github.com/repos/awslabs/aws-shell/pulls/comments/48092111","id":48092111,"diff_hunk":"@@ -65,6 +67,16 @@ def create_default_layout(app, message='',\n \n     get_prompt_tokens_1, get_prompt_tokens_2 = _split_multiline_prompt(\n         get_prompt_tokens)\n+\n+    # `lexer` is supposed to be a `Lexer` instance. But if a Pygments lexer\n+    # class is given, turn it into a PygmentsLexer. (Important for\n+    # backwards-compatibility.)\n+    try:\n+        if issubclass(lexer, Lexer):\n+            lexer = PygmentsLexer(lexer)\n+    except TypeError: # Happens when lexer is `None` or an instance of something else.\n+        pass","path":"awsshell/ui.py","position":22,"original_position":22,"commit_id":"6de0aaac19f5079823ce065b7535ad7ecf2ae8ba","original_commit_id":"6de0aaac19f5079823ce065b7535ad7ecf2ae8ba","user":{"login":"donnemartin","id":5458997,"avatar_url":"https://avatars.githubusercontent.com/u/5458997?v=3","gravatar_id":"","url":"https://api.github.com/users/donnemartin","html_url":"https://github.com/donnemartin","followers_url":"https://api.github.com/users/donnemartin/followers","following_url":"https://api.github.com/users/donnemartin/following{/other_user}","gists_url":"https://api.github.com/users/donnemartin/gists{/gist_id}","starred_url":"https://api.github.com/users/donnemartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donnemartin/subscriptions","organizations_url":"https://api.github.com/users/donnemartin/orgs","repos_url":"https://api.github.com/users/donnemartin/repos","events_url":"https://api.github.com/users/donnemartin/events{/privacy}","received_events_url":"https://api.github.com/users/donnemartin/received_events","type":"User","site_admin":false},"body":"This block is straight from `prompt_toolkit==0.52`.","created_at":"2015-12-19T12:48:52Z","updated_at":"2015-12-19T12:48:52Z","html_url":"https://github.com/awslabs/aws-shell/pull/81#discussion_r48092111","pull_request_url":"https://api.github.com/repos/awslabs/aws-shell/pulls/81","_links":{"self":{"href":"https://api.github.com/repos/awslabs/aws-shell/pulls/comments/48092111"},"html":{"href":"https://github.com/awslabs/aws-shell/pull/81#discussion_r48092111"},"pull_request":{"href":"https://api.github.com/repos/awslabs/aws-shell/pulls/81"}}},"pull_request":{"url":"https://api.github.com/repos/awslabs/aws-shell/pulls/81","id":54178098,"html_url":"https://github.com/awslabs/aws-shell/pull/81","diff_url":"https://github.com/awslabs/aws-shell/pull/81.diff","patch_url":"https://github.com/awslabs/aws-shell/pull/81.patch","issue_url":"https://api.github.com/repos/awslabs/aws-shell/issues/81","number":81,"state":"open","locked":false,"title":"Implements #27: Add lexer/syntax highlighting.","user":{"login":"donnemartin","id":5458997,"avatar_url":"https://avatars.githubusercontent.com/u/5458997?v=3","gravatar_id":"","url":"https://api.github.com/users/donnemartin","html_url":"https://github.com/donnemartin","followers_url":"https://api.github.com/users/donnemartin/followers","following_url":"https://api.github.com/users/donnemartin/following{/other_user}","gists_url":"https://api.github.com/users/donnemartin/gists{/gist_id}","starred_url":"https://api.github.com/users/donnemartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/donnemartin/subscriptions","organizations_url":"https://api.github.com/users/donnemartin/orgs","repos_url":"https://api.github.com/users/donnemartin/repos","events_url":"https://api.github.com/users/donnemartin/events{/privacy}","received_events_url":"https://api.github.com/users/donnemartin/received_events","type":"User","site_admin":false},"body":"Updated https://github.com/awslabs/aws-shell/issues/27 with the following proposal:\r\n\r\n---\r\n\r\nA lexer would make it easier to visually distinguish the different components of a command:\r\n\r\n     aws [options] <command> <subcommand> [parameters]\r\n\r\n## Config File\r\n\r\nDefault theme: vim\r\n\r\n```\r\n# visual theme. possible values: manni, igor, xcode, vim,\r\n# autumn,vs, rrt, native, perldoc, borland, tango, emacs,\r\n# friendly, monokai, paraiso-dark, colorful, murphy, bw,\r\n# pastie, paraiso-light, trac, default, fruity.\r\n# to disable themes, set theme = none\r\ntheme = vim\r\n\r\n```\r\n\r\n## Disable Syntax Highlighting\r\n\r\n     theme = none\r\n\r\n## Samples: Dark Background\r\n\r\n     theme = vim\r\n![Imgur](http://i.imgur.com/SUcBeDr.png)\r\n\r\n## Samples: Light Background\r\n\r\n     theme = vim\r\n\r\n*Note: My terminal colors are customized which might be why we see light gray for `aws>`.*\r\n\r\n![Imgur](http://i.imgur.com/8ZiQ332.png)\r\n\r\n     theme = xcode\r\n\r\n![Imgur](http://i.imgur.com/LpzLDBL.png)","created_at":"2015-12-19T12:47:49Z","updated_at":"2015-12-19T12:48:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"711bd6f92c72b22b494a06b5973a6b135f51c53d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/awslabs/aws-shell/pulls/81/commits","review_comments_url":"https://api.github.com/repos/awslabs/aws-shell/pulls/81/comments","review_comment_url":"https://api.github.com/repos/awslabs/aws-shell/pulls/comments{/number}","comments_url":"https://api.github.com/repos/awslabs/aws-shell/issues/81/comments","statuses_url":"https://api.github.com/repos/awslabs/aws-shell/statuses/6de0aaac19f5079823ce065b7535ad7ecf2ae8ba","head":{"label":"awslabs:lexer","ref":"lexer","sha":"6de0aaac19f5079823ce065b7535ad7ecf2ae8ba","user":{"login":"awslabs","id":3299148,"avatar_url":"https://avatars.githubusercontent.com/u/3299148?v=3","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"repo":{"id":43388350,"name":"aws-shell","full_name":"awslabs/aws-shell","owner":{"login":"awslabs","id":3299148,"avatar_url":"https://avatars.githubusercontent.com/u/3299148?v=3","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/awslabs/aws-shell","description":"An integrated shell for working with the AWS CLI.","fork":false,"url":"https://api.github.com/repos/awslabs/aws-shell","forks_url":"https://api.github.com/repos/awslabs/aws-shell/forks","keys_url":"https://api.github.com/repos/awslabs/aws-shell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/awslabs/aws-shell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/awslabs/aws-shell/teams","hooks_url":"https://api.github.com/repos/awslabs/aws-shell/hooks","issue_events_url":"https://api.github.com/repos/awslabs/aws-shell/issues/events{/number}","events_url":"https://api.github.com/repos/awslabs/aws-shell/events","assignees_url":"https://api.github.com/repos/awslabs/aws-shell/assignees{/user}","branches_url":"https://api.github.com/repos/awslabs/aws-shell/branches{/branch}","tags_url":"https://api.github.com/repos/awslabs/aws-shell/tags","blobs_url":"https://api.github.com/repos/awslabs/aws-shell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/awslabs/aws-shell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/awslabs/aws-shell/git/refs{/sha}","trees_url":"https://api.github.com/repos/awslabs/aws-shell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/awslabs/aws-shell/statuses/{sha}","languages_url":"https://api.github.com/repos/awslabs/aws-shell/languages","stargazers_url":"https://api.github.com/repos/awslabs/aws-shell/stargazers","contributors_url":"https://api.github.com/repos/awslabs/aws-shell/contributors","subscribers_url":"https://api.github.com/repos/awslabs/aws-shell/subscribers","subscription_url":"https://api.github.com/repos/awslabs/aws-shell/subscription","commits_url":"https://api.github.com/repos/awslabs/aws-shell/commits{/sha}","git_commits_url":"https://api.github.com/repos/awslabs/aws-shell/git/commits{/sha}","comments_url":"https://api.github.com/repos/awslabs/aws-shell/comments{/number}","issue_comment_url":"https://api.github.com/repos/awslabs/aws-shell/issues/comments{/number}","contents_url":"https://api.github.com/repos/awslabs/aws-shell/contents/{+path}","compare_url":"https://api.github.com/repos/awslabs/aws-shell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/awslabs/aws-shell/merges","archive_url":"https://api.github.com/repos/awslabs/aws-shell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/awslabs/aws-shell/downloads","issues_url":"https://api.github.com/repos/awslabs/aws-shell/issues{/number}","pulls_url":"https://api.github.com/repos/awslabs/aws-shell/pulls{/number}","milestones_url":"https://api.github.com/repos/awslabs/aws-shell/milestones{/number}","notifications_url":"https://api.github.com/repos/awslabs/aws-shell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/awslabs/aws-shell/labels{/name}","releases_url":"https://api.github.com/repos/awslabs/aws-shell/releases{/id}","created_at":"2015-09-29T19:04:16Z","updated_at":"2015-12-19T12:32:15Z","pushed_at":"2015-12-19T12:47:49Z","git_url":"git://github.com/awslabs/aws-shell.git","ssh_url":"git@github.com:awslabs/aws-shell.git","clone_url":"https://github.com/awslabs/aws-shell.git","svn_url":"https://github.com/awslabs/aws-shell","homepage":null,"size":207,"stargazers_count":533,"watchers_count":533,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":32,"forks":12,"open_issues":32,"watchers":533,"default_branch":"master"}},"base":{"label":"awslabs:master","ref":"master","sha":"a16a80d1ad63988f4db37c7504dbb1bc8265bf76","user":{"login":"awslabs","id":3299148,"avatar_url":"https://avatars.githubusercontent.com/u/3299148?v=3","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"repo":{"id":43388350,"name":"aws-shell","full_name":"awslabs/aws-shell","owner":{"login":"awslabs","id":3299148,"avatar_url":"https://avatars.githubusercontent.com/u/3299148?v=3","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/awslabs/aws-shell","description":"An integrated shell for working with the AWS CLI.","fork":false,"url":"https://api.github.com/repos/awslabs/aws-shell","forks_url":"https://api.github.com/repos/awslabs/aws-shell/forks","keys_url":"https://api.github.com/repos/awslabs/aws-shell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/awslabs/aws-shell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/awslabs/aws-shell/teams","hooks_url":"https://api.github.com/repos/awslabs/aws-shell/hooks","issue_events_url":"https://api.github.com/repos/awslabs/aws-shell/issues/events{/number}","events_url":"https://api.github.com/repos/awslabs/aws-shell/events","assignees_url":"https://api.github.com/repos/awslabs/aws-shell/assignees{/user}","branches_url":"https://api.github.com/repos/awslabs/aws-shell/branches{/branch}","tags_url":"https://api.github.com/repos/awslabs/aws-shell/tags","blobs_url":"https://api.github.com/repos/awslabs/aws-shell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/awslabs/aws-shell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/awslabs/aws-shell/git/refs{/sha}","trees_url":"https://api.github.com/repos/awslabs/aws-shell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/awslabs/aws-shell/statuses/{sha}","languages_url":"https://api.github.com/repos/awslabs/aws-shell/languages","stargazers_url":"https://api.github.com/repos/awslabs/aws-shell/stargazers","contributors_url":"https://api.github.com/repos/awslabs/aws-shell/contributors","subscribers_url":"https://api.github.com/repos/awslabs/aws-shell/subscribers","subscription_url":"https://api.github.com/repos/awslabs/aws-shell/subscription","commits_url":"https://api.github.com/repos/awslabs/aws-shell/commits{/sha}","git_commits_url":"https://api.github.com/repos/awslabs/aws-shell/git/commits{/sha}","comments_url":"https://api.github.com/repos/awslabs/aws-shell/comments{/number}","issue_comment_url":"https://api.github.com/repos/awslabs/aws-shell/issues/comments{/number}","contents_url":"https://api.github.com/repos/awslabs/aws-shell/contents/{+path}","compare_url":"https://api.github.com/repos/awslabs/aws-shell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/awslabs/aws-shell/merges","archive_url":"https://api.github.com/repos/awslabs/aws-shell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/awslabs/aws-shell/downloads","issues_url":"https://api.github.com/repos/awslabs/aws-shell/issues{/number}","pulls_url":"https://api.github.com/repos/awslabs/aws-shell/pulls{/number}","milestones_url":"https://api.github.com/repos/awslabs/aws-shell/milestones{/number}","notifications_url":"https://api.github.com/repos/awslabs/aws-shell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/awslabs/aws-shell/labels{/name}","releases_url":"https://api.github.com/repos/awslabs/aws-shell/releases{/id}","created_at":"2015-09-29T19:04:16Z","updated_at":"2015-12-19T12:32:15Z","pushed_at":"2015-12-19T12:47:49Z","git_url":"git://github.com/awslabs/aws-shell.git","ssh_url":"git@github.com:awslabs/aws-shell.git","clone_url":"https://github.com/awslabs/aws-shell.git","svn_url":"https://github.com/awslabs/aws-shell","homepage":null,"size":207,"stargazers_count":533,"watchers_count":533,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":32,"forks":12,"open_issues":32,"watchers":533,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/awslabs/aws-shell/pulls/81"},"html":{"href":"https://github.com/awslabs/aws-shell/pull/81"},"issue":{"href":"https://api.github.com/repos/awslabs/aws-shell/issues/81"},"comments":{"href":"https://api.github.com/repos/awslabs/aws-shell/issues/81/comments"},"review_comments":{"href":"https://api.github.com/repos/awslabs/aws-shell/pulls/81/comments"},"review_comment":{"href":"https://api.github.com/repos/awslabs/aws-shell/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/awslabs/aws-shell/pulls/81/commits"},"statuses":{"href":"https://api.github.com/repos/awslabs/aws-shell/statuses/6de0aaac19f5079823ce065b7535ad7ecf2ae8ba"}}}}