From: Alyssa Rosenzweig Date: Mon, 25 Jun 2018 20:43:18 +0000 (-0400) Subject: Cleaner about tty X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2b7bbcf2372671fb9b259e089945728c72bac23e;p=libremanage.git Cleaner about tty --- diff --git a/libremanage b/libremanage index 315da3a..280d1df 100755 --- a/libremanage +++ b/libremanage @@ -41,9 +41,9 @@ import json import functools import subprocess -def open_ssh(server, command): +def open_ssh(server, command, force_tty=False): config = server["ssh"] - subprocess.run(["ssh", "-t", config["username"] + "@" + config["host"], "-p", str(config["port"]), command]) + subprocess.run(["ssh", "-t" if force_tty else "", config["username"] + "@" + config["host"], "-p", str(config["port"]), command]) def die_with_usage(message): print(message) @@ -86,7 +86,7 @@ COMMANDS = { # TTY access (or keyboard if wired as such) - "tty": lambda s: open_ssh(s, "screen " + s["tty"]["file"] + " " + str(s["tty"]["baud"])), + "tty": lambda s: open_ssh(s, "screen " + s["tty"]["file"] + " " + str(s["tty"]["baud"]), force_tty=True), # SSH sanity tests