{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/15626","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/15626/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/15626/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/15626/events","html_url":"https://github.com/symfony/symfony/issues/15626","id":103343374,"number":15626,"title":"[Process] Output is cut by height","user":{"login":"aik099","id":1277526,"avatar_url":"https://avatars.githubusercontent.com/u/1277526?v=3","gravatar_id":"","url":"https://api.github.com/users/aik099","html_url":"https://github.com/aik099","followers_url":"https://api.github.com/users/aik099/followers","following_url":"https://api.github.com/users/aik099/following{/other_user}","gists_url":"https://api.github.com/users/aik099/gists{/gist_id}","starred_url":"https://api.github.com/users/aik099/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aik099/subscriptions","organizations_url":"https://api.github.com/users/aik099/orgs","repos_url":"https://api.github.com/users/aik099/repos","events_url":"https://api.github.com/users/aik099/events{/privacy}","received_events_url":"https://api.github.com/users/aik099/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/symfony/symfony/labels/Bug","name":"Bug","color":"e10c02"},{"url":"https://api.github.com/repos/symfony/symfony/labels/Process","name":"Process","color":"DDDDDD"},{"url":"https://api.github.com/repos/symfony/symfony/labels/Status:%20Needs%20Review","name":"Status: Needs Review","color":"ededed"},{"url":"https://api.github.com/repos/symfony/symfony/labels/Unconfirmed","name":"Unconfirmed","color":"444444"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-26T19:06:42Z","updated_at":"2016-04-12T12:10:26Z","closed_at":"2016-04-12T12:10:26Z","body":"I'm trying to run the `/usr/bin/mcedit` through the `Process` component by providing STDIN to it. Problem is, that opened editor window isn't at 100% for reasons unknown to me. If I try to use VIM instead it looks even worse.\r\n\r\nOpened via Process:\r\n![mcedit_via_process](https://cloud.githubusercontent.com/assets/1277526/9503271/942a3db0-4c3e-11e5-9280-8330b76e88f3.png)\r\n\r\nOpened directly:\r\n![mcedit_directly](https://cloud.githubusercontent.com/assets/1277526/9503297/b945710a-4c3e-11e5-93bf-4154e6fc5048.png)\r\n\r\nExample PHP code (works):\r\n\r\n```php\r\n$spec  = array(STDIN, STDOUT, STDERR);\r\n$pipes = array();\r\n$cwd = getcwd();\r\n$env = null;\r\n$options = array();\r\n\r\n$proc = proc_open(\r\n\t'/usr/bin/mcedit',\r\n\t$spec,\r\n\t$pipes,\r\n\t$cwd,\r\n\t$env,\r\n\t$options\r\n);\r\n$err = proc_close($proc);\r\n```\r\n\r\nExample PHP code (doesn't work):\r\n\r\n```php\r\n$process = new \\Symfony\\Component\\Process\\Process('/usr/bin/mcedit', null, null, STDIN, null);\r\n$process->run(function ($type, $buffer) {\r\n\tif ( $type == \\Symfony\\Component\\Process\\Process::OUT ) {\r\n\t\tfwrite(STDOUT, $buffer);\r\n\t}\r\n\telse {\r\n\t\tfwrite(STDERR, $buffer);\r\n\t}\r\n});\r\n```\r\n\r\nThe `proc_open` call done in both examples are identical, so this might be something happening in a way how pipes are being handled to allow for real-time output capturing of the process.\r\n\r\nMaybe mcedit is sending some coloring codes and somehow they are split across separate callback calls, that outputs them which makes them behave differently."},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/208873099","html_url":"https://github.com/symfony/symfony/issues/15626#issuecomment-208873099","issue_url":"https://api.github.com/repos/symfony/symfony/issues/15626","id":208873099,"user":{"login":"nicolas-grekas","id":243674,"avatar_url":"https://avatars.githubusercontent.com/u/243674?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolas-grekas","html_url":"https://github.com/nicolas-grekas","followers_url":"https://api.github.com/users/nicolas-grekas/followers","following_url":"https://api.github.com/users/nicolas-grekas/following{/other_user}","gists_url":"https://api.github.com/users/nicolas-grekas/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolas-grekas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolas-grekas/subscriptions","organizations_url":"https://api.github.com/users/nicolas-grekas/orgs","repos_url":"https://api.github.com/users/nicolas-grekas/repos","events_url":"https://api.github.com/users/nicolas-grekas/events{/privacy}","received_events_url":"https://api.github.com/users/nicolas-grekas/received_events","type":"User","site_admin":false},"created_at":"2016-04-12T12:10:26Z","updated_at":"2016-04-12T12:10:26Z","body":"this is \"normal\" behavior: the width/height of a terminal is something that doesn't mean anything unless you use a tty stream, which is exactly what this `setTty` function enables."}}