pass_typer: Improve matching of destination (still doesn't handle command)

This commit is contained in:
Adam Goldsmith 2024-03-16 19:01:01 -04:00
parent 6c66988950
commit 2330bde957

View File

@ -129,7 +129,9 @@ def select_and_type(server_match: ServerMatch) -> None:
window_name = cmd(["xdotool", "getactivewindow", "getwindowname"]).stdout.strip() window_name = cmd(["xdotool", "getactivewindow", "getwindowname"]).stdout.strip()
ssh_match = re.search(":([^ ]+=[^ ]* )*(mosh|ssh) (?P<destination>.*)", window_name) ssh_match = re.search(
":([^ ]+=[^ ]* )*(mosh|ssh) .* (?P<destination>[^ ]*)$", window_name
)
if ssh_match: if ssh_match:
server_match = ServerMatch.from_destination(ssh_match.group("destination")) server_match = ServerMatch.from_destination(ssh_match.group("destination"))