clj-commons / clj-commons/clj-ssh

shell-session echos what I send?

Open
#40 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Clojure
Stars
241
Forks
66
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.