capistrano/capistrano — pull request #791 by jage (2013-11-19 21:27:42+00:00)
Title: Improve console (EOF and empty commands)

Avoid exceptions when sending EOF in console. Don't send execute empty commands on server.

See examples below:

### EOF (`Ctrl+d`)

Before:

```
$ bundle exec cap production console
capistrano console - enter command to execute on production
production> cap aborted!
undefined method `chomp' for nil:NilClass
/Users/jage/Source/capistrano/lib/capistrano/tasks/console.rake:7:in `block (2 levels) in '
/Users/jage/Source/capistrano/lib/capistrano/tasks/console.rake:5:in `loop'
/Users/jage/Source/capistrano/lib/capistrano/tasks/console.rake:5:in `block in '
/Users/jage/Source/capistrano/lib/capistrano/application.rb:12:in `run'
/Users/jage/Source/capistrano/bin/cap:3:in `'
/Users/jage/.gem/ruby/2.0.0/bin/cap:23:in `load'
/Users/jage/.gem/ruby/2.0.0/bin/cap:23:in `

'
Tasks: TOP => console
(See full trace by running task with --trace)
```

After:

```
$ bundle exec cap production console
capistrano console - enter command to execute on production
production> bye
```

### Newline (`Enter`)

Before:

```
$ bundle exec cap production console
capistrano console - enter command to execute on production
production>
INFO [3aea4c1c] Running /usr/bin/env on XXX
DEBUG [3aea4c1c] Command: /usr/bin/env
...
INFO [3aea4c1c] Finished in 0.376 seconds with exit status 0 (successful).
production>
```

After:

```
$ bundle exec cap production console
capistrano console - enter command to execute on production
production>
production>
```