capistrano/sshkit — pull request #40 by miry (2013-11-29 23:00:05+00:00)
Title: Interactive Execute command 

Hi @leehambley

To add ability to run interactive rails console before for capistrano 2 we could do:

```
desc "Remote console on the production appserver"
task :console, :roles => :app do
input = ''
run "cd #{current_path} && ./script/console production" do |channel, stream, data|
next if data.chomp == input.chomp || data.chomp == ''
print data
channel.send_data(input = $stdin.gets) if data =~ /^(>|\?)>/
end
end
```

this solution does not work for v3, and I could not find similar.
I have patched a SSHKit to execute interactive rails console:

https://gist.github.com/miry/7196069.

Can you advice me another solution?

Also I think to store the channel and then we can redefine `on_data` or another callback method, or add block to `execute` method with same functionality like old `run`.