Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command line length issue #249

Closed
ggets opened this issue May 3, 2016 · 0 comments
Closed

Command line length issue #249

ggets opened this issue May 3, 2016 · 0 comments

Comments

@ggets
Copy link

ggets commented May 3, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants