mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-09-22 20:17:45 +03:00
Only use the last line of ssh hostname -f output incase the user has configured ssh to print random junk on login
This commit is contained in:
parent
eced40a761
commit
f110a01ffe
@ -151,7 +151,7 @@ def check_hostname_matches(self) -> bool:
|
||||
cp = subprocess.run(self.batch_cmd_prefix + [self.conn_data.hostname, 'hostname', '-f'], stdout=subprocess.PIPE,
|
||||
stderr=subprocess.DEVNULL, stdin=subprocess.DEVNULL)
|
||||
if cp.returncode == 0:
|
||||
q = cp.stdout.decode('utf-8').strip()
|
||||
q = tuple(filter(None, cp.stdout.decode('utf-8').strip().splitlines()))[-1]
|
||||
if not hostname_matches(self.cli_opts.hostname or '', q):
|
||||
print(reset_terminal(), end='')
|
||||
print(f'The remote hostname {styled(q, fg="green")} does not match the')
|
||||
|
Loading…
Reference in New Issue
Block a user