Skip to content

Commit

Permalink
Updated README and CHANGELOG with details about output colors
Browse files Browse the repository at this point in the history
  • Loading branch information
robd committed May 8, 2015
1 parent 7fc16c6 commit cc6fe03
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ appear at the top.

* Add your entries below here, remember to credit yourself however you want
to be credited!
* Now only color the output if the output IO is associated with a tty or the `SSHKIT_COLOR` environment variable is set. (See [README](README.md#output-colors)) @robd
* Removed broken support for assigning an `IO` to the `output` config option (See [#243](https://github.com/capistrano/sshkit/issues/243)). @robd
* Use `SSHKit.config.output = SSHKit::Formatter::SimpleText.new($stdin)` instead
* Added support for :interaction_handler option on commands. @robd
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,22 @@ SSHKit.config.output = SSHKit::Formatter::Pretty.new(out)
SSHKit.config.output = SSHKit::Formatter::SimpleText.new(File.open('log/deploy.log', 'wb'))
```

#### Output Colors

By default, SSHKit will color the output using ANSI color escape sequences
if the output IO you are using is associated with a terminal device (tty).
This means that you should see colors if you are writing output to the terminal (the default),
but you shouldn't see ANSI color escape sequences if you are writing to a file.

Colors are supported for the `Pretty` and `Dot` formatters, but for historical reasons
the `SimpleText` formatter never shows colors.

If you want to force SSHKit to show colors, you can set the `SSHKIT_COLOR` environment variable:

```ruby
ENV['SSHKIT_COLOR'] = 'TRUE'
```

#### Custom formatters

Want custom output formatting? Here's what you have to do:
Expand Down

0 comments on commit cc6fe03

Please sign in to comment.