-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
client/client.go: change interactive to hasTTY
The issue is not whether the program is run interactively, but whether fd 0 is a tty or not. The way to tell is to see if GetWinSize of fd 0 returns an error. If it succeeds, use the returned size. If it fails, mark the command as not having a TTY. If there is no TTY, do not attach a remote PTY, and use io.Copy, not TTYIn, to transfer the data. These commands worked before: cpu host cpu host ls These commands now work correctly and did not before: cpu host bash echo ls | host Signed-off-by: Ronald G. Minnich <[email protected]>
- Loading branch information
Showing
1 changed file
with
23 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters