cygwin - AutoHotKey: unexpected mintty behavior -


i'm using autohotkey show/hide mintty terminal window. here's autohotkey.ahk:

showhide_(title, commandline) {     outputdebug, showhide called      detecthiddenwindows, on     ; matchmode = 2 : title contains expression     settitlematchmode, 2      outputdebug, looking window named "%title%"     ifwinexist %title%     {         outputdebug, "%title%" found, active?         ifwinnotactive %title%         {             winshow             winwait, %title%             winrestore             winactivate             outputdebug, window not active, activating...         }         else         {             winminimize             winhide             outputdebug, window active, hiding...         }     }     else     {         outputdebug, "%title%" doesn't exist, starting...         run, %commandline%     } }  #^:: f1::showhide_("ahk_class mintty", "c:\cygwin\bin\mintty.exe -t cygterm") 

as notice, made generic function able same other applications. besides i've assigned 2 keyboard combinations f1 , win+^. both combinations work fine launch program or show pre-existing window, fails hide it, 2 reasons:

  1. when using f1, key press not recognized (no trace in dbgview);
  2. when using win+^ (or other shortcut not using fn keys), event traced in dbgview, nothing happens.

with other programs (such notepad++, calc, ...) works expected. idea why? , how can make work?

i find if i'm using cygwin terminal shortcut that's automatically created in start menu, mintty doesn't respond ahk scripts.

however, if make shortcut directly mintty.exe file (c:\cygwin\bin\mintty.exe) work.

note: in order make custom mintty shortcut work properly, you'll need add hyphen "-" launch option. thus, in shorcut, target field should this:

c:\cygwin\bin\mintty.exe -


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -