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
1 changed files with 3 additions and 1 deletions

View File

@ -129,7 +129,9 @@ def select_and_type(server_match: ServerMatch) -> None:
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:
server_match = ServerMatch.from_destination(ssh_match.group("destination"))