clj-ssh
clj-ssh copied to clipboard
shell-session echos what I send?
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?