@@ -183,7 +183,6 @@ type DockerLoginSpec = {
183183 readonly containerPath : string
184184 readonly env : ReadonlyArray < string >
185185 readonly args : ReadonlyArray < string >
186- readonly tty : boolean
187186}
188187
189188const buildDockerLoginSpec = (
@@ -197,16 +196,13 @@ const buildDockerLoginSpec = (
197196 hostPath : accountPath ,
198197 containerPath,
199198 env : [ `CLAUDE_CONFIG_DIR=${ containerPath } ` , "BROWSER=echo" ] ,
200- args : [ "auth" , "login" ] ,
201- tty : process . stdin . isTTY && process . stdout . isTTY
199+ args : [ "auth" , "login" ]
202200} )
203201
204202const buildDockerLoginArgs = ( spec : DockerLoginSpec ) : ReadonlyArray < string > => {
205- const base : Array < string > = [ "run" , "--rm" , "-i" ]
206- if ( spec . tty ) {
207- base . push ( "-t" )
208- }
209- base . push ( "-v" , `${ spec . hostPath } :${ spec . containerPath } ` )
203+ // NOTE: We intentionally avoid `-t` here.
204+ // We need stdin as a pipe (to feed the OAuth code), and `docker run -t` errors when stdin isn't a real TTY.
205+ const base : Array < string > = [ "run" , "--rm" , "-i" , "-v" , `${ spec . hostPath } :${ spec . containerPath } ` ]
210206 for ( const entry of spec . env ) {
211207 const trimmed = entry . trim ( )
212208 if ( trimmed . length === 0 ) {
0 commit comments