diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py
--- a/mercurial/sshpeer.py
+++ b/mercurial/sshpeer.py
@@ -160,6 +160,7 @@ class sshpeer(wireproto.wirepeer):
         self.pipeo, self.pipei, self.pipee, self.subprocess = sub
 
         self.pipei = util.bufferedinputpipe(self.pipei)
+        self.pipei = doublepipe(self.ui, self.pipei, self.pipee)
 
         # skip any noise generated by remote shell
         self._callstream("hello")
diff --git a/tests/test-ssh.t b/tests/test-ssh.t
--- a/tests/test-ssh.t
+++ b/tests/test-ssh.t
@@ -396,8 +396,8 @@ Test hg-ssh in read-only mode:
   $ hg push --ssh "sh ../ssh.sh"
   pushing to ssh://user@dummy/*/remote (glob)
   searching for changes
+  remote: Permission denied
   abort: pretxnopen.hg-ssh hook failed
-  remote: Permission denied
   [255]
 
   $ cd ..