Add :dir option
Implement sending output as messages