Add Windows native SSH support
This commit is contained in:
@@ -78,7 +78,8 @@ class UI:
|
||||
def create_default_options_getter():
|
||||
"""Return current TTY and DISPLAY settings for GnuPG pinentry."""
|
||||
options = []
|
||||
if sys.stdin.isatty(): # short-circuit calling `tty`
|
||||
# Windows reports that it has a TTY but throws FileNotFoundError
|
||||
if sys.platform != 'win32' and sys.stdin.isatty(): # short-circuit calling `tty`
|
||||
try:
|
||||
ttyname = subprocess.check_output(args=['tty']).strip()
|
||||
options.append(b'ttyname=' + ttyname)
|
||||
@@ -88,7 +89,8 @@ def create_default_options_getter():
|
||||
display = os.environ.get('DISPLAY')
|
||||
if display is not None:
|
||||
options.append('display={}'.format(display).encode('ascii'))
|
||||
else:
|
||||
# Windows likely doesn't support this anyway
|
||||
elif sys.platform != 'win32':
|
||||
log.warning('DISPLAY not defined')
|
||||
|
||||
log.info('using %s for pinentry options', options)
|
||||
|
||||
Reference in New Issue
Block a user