File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -40,22 +40,22 @@ interface CredentialsJson {
4040 token_type ? : string ;
4141}
4242
43+ const TTY_PATH = os . platform ( ) === 'win32' ? '\\\\.\\CON' : '/dev/tty' ;
44+
4345/**
4446 * Opens a readable stream from /dev/tty (Unix) or CON (Windows).
4547 * This bypasses process stdin entirely so credentials can't be intercepted
4648 * by a parent process.
4749 */
4850function openTtyRead ( ) : fs . ReadStream {
49- const ttyPath = os . platform ( ) === 'win32' ? 'CON' : '/dev/tty' ;
50- return fs . createReadStream ( ttyPath , { encoding : 'utf8' } ) ;
51+ return fs . createReadStream ( TTY_PATH , { encoding : 'utf8' } ) ;
5152}
5253
5354/**
5455 * Opens a writable stream to /dev/tty (Unix) or CON (Windows).
5556 */
5657function openTtyWrite ( ) : fs . WriteStream {
57- const ttyPath = os . platform ( ) === 'win32' ? 'CON' : '/dev/tty' ;
58- return fs . createWriteStream ( ttyPath ) ;
58+ return fs . createWriteStream ( TTY_PATH ) ;
5959}
6060
6161/**
You can’t perform that action at this time.
0 commit comments