FauxFaux/PuTTYTray

Command line length issue

ggets opened this issue · 0 comments

ggets commented

I have been using this regedit shell snippet to open a cygterm prompt in a drive/directory:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\cygterm_hkr]
@="Open &in Cygterm"
"MUIVerb"="Open &in Cygterm"
[HKEY_CLASSES_ROOT\Directory\shell\cygterm_hkr\command]
@=hex(2):22,00,45,00,3a,00,5c,00,54,00,6f,00,6f,00,6c,00,73,00,5c,00,4e,00,65,\
  00,74,00,77,00,6f,00,72,00,6b,00,20,00,26,00,20,00,49,00,6e,00,74,00,65,00,\
  72,00,6e,00,65,00,74,00,5c,00,70,00,75,00,74,00,74,00,79,00,2e,00,65,00,78,\
  00,65,00,22,00,20,00,2d,00,6c,00,6f,00,61,00,64,00,20,00,22,00,43,00,79,00,\
  67,00,74,00,65,00,72,00,6d,00,22,00,20,00,2f,00,62,00,69,00,6e,00,2f,00,78,\
  00,68,00,65,00,72,00,65,00,20,00,2f,00,62,00,69,00,6e,00,2f,00,62,00,61,00,\
  73,00,68,00,2e,00,65,00,78,00,65,00,20,00,5c,00,22,00,25,00,4c,00,5c,00,22,\
  00,00,00

just for a bit of sanity, the command actually translates to:

"E:\Tools\Network & Internet\putty.exe" -load "Cygterm" /bin/xhere /bin/bash.exe "%L"

with the following session (the important part only, no clutter):

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\SimonTatham\PuTTY\Sessions\Cygterm]
"CygtermAutoPath"=dword:00000001
"CygtermCommand"="                                                                                                                                                            "
"Protocol"="cygterm"

So the CygtermCommand has to be filled with spaces so the whole shell command is executed, otherwise, for example, if you truncate CygtermCommand as follows "CygtermCommand"=" " you will get the following output:

/bin/xh: No such file or directory"

which is exactly this part of the shell command:

"E:\Tools\Network & Internet\putty.exe" -load "Cygterm" /bin/xhere /bin/bash.exe "%L"

Bottom line is as many characters you input in the command box that many you'll get parsed from the shell command.
BTW I am using version p0.66-t027