Create a command to focus a specific window from anywhere in OS
You might do something like this with AppleScript:

tell application "Terminal"
    activate
    windows where name contains "bash"
    if result is not {} then set index of item 1 of result to 1
end tell


Or using System Events:

tell application "System Events" to tell process "Terminal"
    set frontmost to true
    windows where title contains "bash"
    if result is not {} then perform action "AXRaise" of item 1 of result
end tell