Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open-wsl.exe activates existing terminal window if terminal title not changed #92

Closed
cuihaoleo opened this issue Mar 31, 2018 · 1 comment

Comments

@cuihaoleo
Copy link

cuihaoleo commented Mar 31, 2018

When I called open-wsl.exe to open a new terminal, an existing mintty window (if any) would also get activated for a moment before new window showing up, which was really annoying. But the "bug" failed to be reproduced on another machine of my friend.

After investigation of the source code and my personal config, it turns out that my custom shell prompt (PS1 variable) didn't set terminal title so the default title in wsl-terminal.conf was inherited.

Last part of open-wsl.ahk finds new terminal window by its title and activate it, which causes the buggy behaviour I mentioned:

; Activate window {{{1
Loop, 5 {
    WinActivate, %title%
    if (WinActive(title)) {
        break
    }

    Sleep, 50
}

I know little about Windows and AutoHotkey programming, but window title doesn't seem to be a reliable way to identify window uniquely. Also, I wonder why open-wsl.exe have to activate new mintty window itself. Should not the new window get focused automatically?

@goreliu goreliu added the todo label Apr 21, 2018
@goreliu
Copy link
Collaborator

goreliu commented Apr 21, 2018

I think I fixed it here (a89ea7b), v0.8.11.

@goreliu goreliu added the solved label Apr 23, 2018
@goreliu goreliu closed this as completed May 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants