{"action":"opened","issue":{"url":"https://api.github.com/repos/chalk/chalk/issues/274","repository_url":"https://api.github.com/repos/chalk/chalk","labels_url":"https://api.github.com/repos/chalk/chalk/issues/274/labels{/name}","comments_url":"https://api.github.com/repos/chalk/chalk/issues/274/comments","events_url":"https://api.github.com/repos/chalk/chalk/issues/274/events","html_url":"https://github.com/chalk/chalk/issues/274","id":324125016,"number":274,"title":"Color is not preserved when stdout is redirected ","user":{"login":"aicioara","id":3248682,"avatar_url":"https://avatars1.githubusercontent.com/u/3248682?v=4","gravatar_id":"","url":"https://api.github.com/users/aicioara","html_url":"https://github.com/aicioara","followers_url":"https://api.github.com/users/aicioara/followers","following_url":"https://api.github.com/users/aicioara/following{/other_user}","gists_url":"https://api.github.com/users/aicioara/gists{/gist_id}","starred_url":"https://api.github.com/users/aicioara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aicioara/subscriptions","organizations_url":"https://api.github.com/users/aicioara/orgs","repos_url":"https://api.github.com/users/aicioara/repos","events_url":"https://api.github.com/users/aicioara/events{/privacy}","received_events_url":"https://api.github.com/users/aicioara/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-17T17:55:07Z","updated_at":"2018-05-17T17:55:07Z","closed_at":null,"author_association":"NONE","body":"Hey, thank you for this package, it is really great. In one of my projects, I took a dependency on ink-quicksearch, which took a dependency on ink, which took a dependency on chalk, which brought me here. \r\n\r\nThe issue I am facing is when I combine a npm script with pipes and redirrects, as that removes the color.\r\n\r\nI have a repro below. To make it easier, I am printing to stderr and I am redirecting the stdout.\r\n\r\n```jsx\r\n#!/usr/bin/env node\r\n\r\nconst chalk = require('chalk');\r\nconsole.error('\\x1b[36m%s\\x1b[0m', 'This text will be printed colorful');\r\nconsole.error(chalk.blue('This text is white :('));\r\n```\r\n\r\n\r\nThen run as \r\n\r\n```bash\r\nnode main.jsx # This works as expected\r\nnode main.jsx > tmp.txt # Bug here \r\n```\r\n\r\nIs this something easy to fix? If not, do you find this to be an issue or a feature? If it is an issue, I can invest time and fix it, just wanted to make sure it is not like this by design.\r\n\r\nThanks!\r\n"}}
{"actor":{"display_login":"aicioara"}}