1
0
mirror of https://github.com/mintty/wsltty.git synced 2025-01-18 20:10:58 +00:00

tweak registry key names to avoid collision with existing keys and enable context menu invocation of default WSL (#141)

This commit is contained in:
mintty 2019-01-06 12:08:25 +01:00
parent 20075c6378
commit e5c67ecc7c

View File

@ -178,17 +178,18 @@ do
# context menu entries # context menu entries
#cmd /C mkcontext "$name" #cmd /C mkcontext "$name"
direckey='HKEY_CURRENT_USER\Software\Classes\Directory' direckey='HKEY_CURRENT_USER\Software\Classes\Directory'
keyname="${name}_Terminal"
if $remove if $remove
then then
reg delete "$direckey\\shell\\$name" /f reg delete "$direckey\\shell\\$keyname" /f
reg delete "$direckey\\Background\\shell\\$name" /f reg delete "$direckey\\Background\\shell\\$keyname" /f
else else
reg add "$direckey\\shell\\$name" /d "$name Terminal" /f reg add "$direckey\\shell\\$keyname" /d "$name Terminal" /f
reg add "$direckey\\shell\\$name" /v Icon /d "$icon" /f reg add "$direckey\\shell\\$keyname" /v Icon /d "$icon" /f
cmd /C reg add "$direckey\\shell\\$name\\command" /d "\"$target\" -i \"$icon\" --dir \"%1\" $minttyargs $bridgeargs" /f cmd /C reg add "$direckey\\shell\\$keyname\\command" /d "\"$target\" -i \"$icon\" --dir \"%1\" $minttyargs $bridgeargs" /f
reg add "$direckey\\Background\\shell\\$name" /d "$name Terminal" /f reg add "$direckey\\Background\\shell\\$keyname" /d "$name Terminal" /f
reg add "$direckey\\Background\\shell\\$name" /v Icon /d "$icon" /f reg add "$direckey\\Background\\shell\\$keyname" /v Icon /d "$icon" /f
cmd /C reg add "$direckey\\Background\\shell\\$name\\command" /d "\"$target\" -i \"$icon\" $minttyargs $bridgeargs" /f cmd /C reg add "$direckey\\Background\\shell\\$keyname\\command" /d "\"$target\" -i \"$icon\" $minttyargs $bridgeargs" /f
fi fi
else else
# invocation shortcuts and scripts # invocation shortcuts and scripts