I'm using pygetwindow
to bring a window to the foreground, via it's title. And it works flawlessly if I run my python script from cmd(and PowerShell). But if I run it from any other terminal, say Alacritty, instead of coming to the foreground, the mentioned window just starts flashing in the taskbar.
Why would this be so? I've configured Alacritty to use cmd.
Following is the relevant part of my code:
import pygetwindow
try:
window = pygetwindow.getWindowsWithTitle('foobar')[0]
window.activate()
except Exception as e:
#raise e
print("open foobar please")
exit(1)
And following is the relevant part of my alacritty config
# Shell
# You can set `shell.program` to the path of your favorite shell, e.g. `/bin/fish`.
# Entries in `shell.args` are passed unmodified as arguments to the shell.
# Default:
# - (macOS) /bin/bash --login
# - (Linux/BSD) user login shell
# - (Windows) powershell
shell:
program: cmd.exe
args:
- /s /k pushd C:\Users\interesting\bug\hunt\Repos
Thank You