Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shell-session echos what I send? #40

Open
nicferrier opened this issue Oct 21, 2015 · 0 comments
Open

shell-session echos what I send? #40

nicferrier opened this issue Oct 21, 2015 · 0 comments

Comments

@nicferrier
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant