From 2b7bbcf2372671fb9b259e089945728c72bac23e Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 25 Jun 2018 16:43:18 -0400 Subject: [PATCH] Cleaner about tty --- libremanage | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.25.1