groovysettingsgroovyshellconemugroovy-console

Remap keys for groovysh when opened in ConEmu


Previous Title: Groovy shell settings/config file location on windows and an example

Where can I find/create a groovysh/groovy shell settings/config file in Microsoft Windows 7?

Groovysh currently has an issue GROOVY-6453 where certain keys don't work correctly on windows for my version of groovy. I'd previously used AutoHotkey to remap the keys but I've started to use ConEMU and haven't figured out how to differentiate the tabs so far with AutoHotkey.

I'm hoping I'll be able to remap the keys in the config file so it works globally for my user and not need the AutoHotkey script anymore.

Just to clarify there is nothing wrong with ConEmu just the specific version of groovysh I'm using.


Solution

  • If you set the title of a cmd window then start the groovysh the title will stick and AutoHotkey can check the window title.

    In the ConEmu Commands input box enter -new_console:t:Groovy"cmd.exe /c title Groovy&&groovysh" The t:Groovy sets the title for the tab from ConEmu's viewpoint and the cmd.exe /c title Groovy sets the title from the cmd's viewpoint. The additional &&groovysh starts the groovy console. AutoHotkey sees the title as 'Groovy (Admin)'

    I use AutoHotkey to 'fix' several of the keys mentioned in the GROOVY-6453.

    i.e.:

    #If (WinActive("Groovy (Admin)") || WinActive("Administrator: C:\Windows\system32\cmd.exe - groovysh"))
    Up::^p
    Down::^n
    Left::^b
    Right::^f
    Home::^a
    End::^e
    Del::^d
    #If
    

    Update: the 'Right' arrow no longer works for me in Windows 10, it opens the find now.