{"action":"created","issue":{"url":"https://api.github.com/repos/primefaces/primefaces/issues/1287","repository_url":"https://api.github.com/repos/primefaces/primefaces","labels_url":"https://api.github.com/repos/primefaces/primefaces/issues/1287/labels{/name}","comments_url":"https://api.github.com/repos/primefaces/primefaces/issues/1287/comments","events_url":"https://api.github.com/repos/primefaces/primefaces/issues/1287/events","html_url":"https://github.com/primefaces/primefaces/issues/1287","id":144908979,"number":1287,"title":"Terminal - add async support","user":{"login":"spauny","id":6390470,"avatar_url":"https://avatars.githubusercontent.com/u/6390470?v=3","gravatar_id":"","url":"https://api.github.com/users/spauny","html_url":"https://github.com/spauny","followers_url":"https://api.github.com/users/spauny/followers","following_url":"https://api.github.com/users/spauny/following{/other_user}","gists_url":"https://api.github.com/users/spauny/gists{/gist_id}","starred_url":"https://api.github.com/users/spauny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spauny/subscriptions","organizations_url":"https://api.github.com/users/spauny/orgs","repos_url":"https://api.github.com/users/spauny/repos","events_url":"https://api.github.com/users/spauny/events{/privacy}","received_events_url":"https://api.github.com/users/spauny/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-31T13:53:36Z","updated_at":"2016-03-31T14:25:52Z","closed_at":null,"body":"As a quick fix we can enable async by default for Terminal... \r\nCan't really think of an example where this is a bad idea. \r\n\r\nI will try to create a pull request these days if you guys think it's a welcomed improvement. \r\n"},"comment":{"url":"https://api.github.com/repos/primefaces/primefaces/issues/comments/203963306","html_url":"https://github.com/primefaces/primefaces/issues/1287#issuecomment-203963306","issue_url":"https://api.github.com/repos/primefaces/primefaces/issues/1287","id":203963306,"user":{"login":"spauny","id":6390470,"avatar_url":"https://avatars.githubusercontent.com/u/6390470?v=3","gravatar_id":"","url":"https://api.github.com/users/spauny","html_url":"https://github.com/spauny","followers_url":"https://api.github.com/users/spauny/followers","following_url":"https://api.github.com/users/spauny/following{/other_user}","gists_url":"https://api.github.com/users/spauny/gists{/gist_id}","starred_url":"https://api.github.com/users/spauny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spauny/subscriptions","organizations_url":"https://api.github.com/users/spauny/orgs","repos_url":"https://api.github.com/users/spauny/repos","events_url":"https://api.github.com/users/spauny/events{/privacy}","received_events_url":"https://api.github.com/users/spauny/received_events","type":"User","site_admin":false},"created_at":"2016-03-31T14:25:52Z","updated_at":"2016-03-31T14:25:52Z","body":"Enable ajax async request.\r\nAt the moment, the terminal's processCommand javascript function calls PrimeFaces.ajax.Request.handle: \r\n\r\n`processCommand: function() {\r\n        ...\r\n        var $this = this,\r\n        options = {\r\n            source : this.id,\r\n            update: this.id,\r\n            process: this.id,\r\n            params: [\r\n                {name: this.id + '_command', value: true}\r\n            ],\r\n            onsuccess: function(responseXML, status, xhr) {\r\n                PrimeFaces.ajax.Response.handle(responseXML, status, xhr, {\r\n                        widget: $this,\r\n                        handle: function(content) {\r\n                            ...\r\n                        }\r\n                    });\r\n\r\n                return true;\r\n            }\r\n        };\r\n        \r\n        PrimeFaces.ajax.Request.handle(options);\r\n    }`\r\n\r\nThe Request.handle function checks if the options(cfg) object has async set to true and fires an ajax request if it does. Otherwise it will just add the request into Queue. \r\n\r\nAll we need to do is add the async attribute to the Terminal's options. And set this to true when we want the Terminal's command to be processed right away instead of waiting in the queue until the other ajax requests are done. "}}