Skip to content

Commit

Permalink
Caps+F12 can call msys2 with mingw64/mingw32, fix path error.
Browse files Browse the repository at this point in the history
  • Loading branch information
m2nlight committed Apr 13, 2018
1 parent 2cbf948 commit 1d18c2b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions machotkey.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ CapsLock & F12::
}
else if FileExist("C:\msys64\usr\bin\mintty.exe")
{
RunMSYS2("C:\msys64\usr\bin\mintty.exe")
RunMSYS2("C:\msys64\usr\bin\mintty.exe", "MINGW64")
}
else if FileExist("C:\msys32\usr\bin\mintty.exe")
{
RunMSYS2("C:\msys32\usr\bin\mintty.exe")
RunMSYS2("C:\msys32\usr\bin\mintty.exe", "MINGW32")
}
else
{
Expand Down Expand Up @@ -212,12 +212,11 @@ RunCmdAndClose(command)
Run %comspec% /C "cd /d "%curPath%" & %command%"
}

RunMSYS2(path)
RunMSYS2(mintty, mingw)
{
curPath := CurrentPath()
curPath := StrReplace(curPath,"\","/")
parameter = "/bin/bash -lc 'cd ""$(cygpath ""%curPath%"")""; export CHERE_INVOKING=1; exec bash --login -i'"
Run "%path%" "%parameter%"
parameter = "-i /msys2.ico --dir `"%curPath%`" /bin/env MSYSTEM=%mingw% CHERE_INVOKING=1 /usr/bin/bash -l"
Run "%mintty%" "%parameter%"
}

RunOrActivate(Program, isActivate=true, msg="")
Expand Down

0 comments on commit 1d18c2b

Please sign in to comment.