andyk / ht

headless terminal - wrap any binary with a terminal interface for easy programmatic access.
Apache License 2.0
743 stars 12 forks source link

ht ssh remote_host. show prompt and show us a way to feed input #7

Open jzkunlun opened 3 weeks ago

jzkunlun commented 3 weeks ago

raw terminal gave a lot of garbed characters. I wish this ht may make ssh interactive session cleaner.

ht ssh username@remote-host launching command "ssh username@remote-host" in terminal of size 120x40

it waited there forever, actually in normal terminal, it prompts to as ask password, how do I get prompt and feed my input?

ku1ik commented 5 days ago

When you run ssh username@remote-host, this command already runs inside a virtual terminal, so you need to input your password with ht's input API, e.g.:

{ "type": "sendKeys", "keys": ["my-secret-password", "Enter"] }

(sendKeys has been added in v0.2)