clj-ssh icon indicating copy to clipboard operation
clj-ssh copied to clipboard

shell-session echos what I send?

Open nicferrier opened this issue 9 years ago • 0 comments

I don't want it to echo what I send.. I've got something like:

(ssh/with-connection nic-sesh
        (let [ch (doto (ssh/shell-channel nic-sesh)
                   (.setPty true))
              in (.getInputStream ch)
              out (.getOutputStream ch)]
          (ssh/with-channel-connection ch
            (thread  
              (loop [char (.read in)] ; from ssh to stdout
                (if (= -1 char)
                  (System/exit 1)
                  (do
                    (.write *out* char)
                    (.flush *out*)
                    (recur (.read in))))))
            (loop [char (.read *in*)] ; from stdin to ssh
              (if-not (= -1 char)
                (do
                  (.write out char)
                  (.flush out)
                  (recur (.read *in*))))))))

it seems weird that I'd get an echo. Anyone have an explanation?

nicferrier avatar Oct 21 '15 09:10 nicferrier