From 8bbc78a48a6c8ca99fecede6449ee8cf81623928 Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Wed, 15 May 2019 10:35:12 -0400 Subject: [PATCH] Add clarifying comments for negating `-i` or `-t` --- command/alloc_exec.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/command/alloc_exec.go b/command/alloc_exec.go index 7417e61ec..a2c1cbead 100644 --- a/command/alloc_exec.go +++ b/command/alloc_exec.go @@ -44,10 +44,11 @@ Exec Specific Options: Use a random allocation from the specified job ID. -i - Pass stdin to the container, defaults to true + Pass stdin to the container, defaults to true. Pass -i=false to disable. -t - Allocate a pseudo-tty, defaults to true if stdin is detected to be a tty session + Allocate a pseudo-tty, defaults to true if stdin is detected to be a tty session. + Pass -t=false to disable explicitly. ` return strings.TrimSpace(helpText) } @@ -215,6 +216,9 @@ func isStdinTty() bool { return isTerminal } +// setRawTerminal sets the stream terminal in raw mode, so process captures +// Ctrl+C and other commands to forward to remote process. +// It returns a cleanup function that restores terminal to original mode. func setRawTerminal(stream interface{}) (cleanup func(), err error) { fd, isTerminal := term.GetFdInfo(stream) if !isTerminal {