cmder: installation fails if PATH is too long

Purpose of the issue

  • Bug report (encountered problems/errors)
  • Feature request (request for new functionality)
  • Question

Version Information

1.3.17 (2020-12-23)
191012
Edition	Windows 10 Home Single Language
Version	20H2
Installed on	‎8/‎7/‎2020
OS build	19042.804
Experience	Windows Feature Experience Pack 120.2212.551.0

Description of the issue

When installing for the first time if PATH is too long it fails to run somewhere in the middle with Input like is too long, the syntax is incorrect error before it reaches the git-for-windows initial setup

My PATH has this
C:\Users\Rithvij\scoop\apps\python27\current\scripts;C:\Users\Rithvij\scoop\apps\adoptopenjdk-hotspot-jre\current\bin;C:\Users\Rithvij\scoop\shims;D:\Software\mpv-x86_64-20200315-git-281f5c6;C:\Users\Rithvij\AppData\Local\Programs\Python\Python38\Scripts\;C:\Users\Rithvij\AppData\Local\Programs\Python\Python38\;C:\Users\Rithvij\.cargo\bin;C:\Users\Rithvij\AppData\Local\Microsoft\WindowsApps;D:\Software\flutter\flutter\bin;D:\Software\cmder;D:\Software\flutter\flutterm\bin;C:\Program Files (x86)\Microsoft Visual Studio\Installer;D:\Software\ZIPS and Installers\weebp-0.6.1-windows-x64;D:\Software\mpv-x86_64-20181002;C:\Program Files\Docker Toolbox;C:\Users\Rithvij\AppData\Roaming\Pub\Cache\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build;D:\Software\ZIPS and Installers\nim-1.0.0\bin;C:\Users\Rithvij\.nimble\bin;D:\Software\node;D:\Software\micro-1.4.1;C:\xampp\php;D:\Software\scrcpy-win64;C:\Users\Rithvij\AppData\Local\Programs\Microsoft VS Code\bin;D:\Software\LOVE;C:\Program Files\Mercurial\;C:\Users\Rithvij\AppData\Roaming\Python\Python38\Scripts;C:\Users\Rithvij\AppData\Local\bin\NASM;C:\libjpeg-turbo-gcc\bin;C:\msys64\mingw64\bin;D:\Projects\golang;C:\tools\dart-sdk\bin;D:\Software\depot_tools;D:\Software\sqlite\sqlite-tools-win32-x86-3300100;D:\Software\processing-3.5.4;D:\Software\flutter\flutterm\.pub-cache\bin;D:\Software\apktool;C:\Users\Rithvij\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Rithvij\AppData\Roaming\npm;C:\Users\Rithvij\.local\bin;C:\Users\Rithvij\go\bin;C:\Users\Rithvij\.dotnet\tools;D:\Software\ZIPS and Installers\upx-3.96-win64;D:\Software\LOVE2D;D:\Software\vips-dev-w64-all-8.10.2\vips-dev-8.10\bin;C:\msys64\usr\bin;D:\Software\PostgreSQL\13\bin;D:\Software\navidrome_0.38.0;D:\Downloads\prometheus-2.23.0.windows-amd64;D:\Software\bin;C:\Program Files\VMD;D:\Software\Fiddler;%USERPROFILE%\.dotnet\tools;D:\Downloads\memcached-1.6.9\cygwin\x64;D:\Games\MineKraft;D:\Downloads\gohls-windows-amd64-snapshot.tar;D:\Software\ffmpeg-1\ffmpeg\bin;D:\Software\Google\Cloud SDK\google-cloud-sdk\bin
Also my system PATH is long as well but not sure if this causes any issues
D:\Software\ImageMagick-7.0.9-Q16;C:\Program Files\Microsoft MPI\Bin\;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\libnvvp;C:\Program Files\AdoptOpenJDK\jdk-11.0.5.10-hotspot\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ProgramData\chocolatey\bin;D:\Software\Lua\5.1;D:\Software\Lua\5.1\clibs;C:\tools\dart-sdk\dart-sdk\bin;C:\Program Files\Calibre2\;C:\Program Files\NVIDIA Corporation\Nsight Compute 2019.4.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\TDM-GCC-64\bin;D:\Projects\fun\lua\lua-5.3.5\src;D:\Software\Erlang\bin;D:\Software\Elixr\bin;C:\Users\Rithvij\.mix\escripts;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;D:\Software\node14\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;D:\Software\vcpkg\installed\x64-windows\bin;D:\Software\vips-dev-w64-all-8.10.2\vips-dev-8.10\bin;D:\Software\vcpkg;C:\Users\Rithvij\go\src\github.com\tidbyt\go-libwebp\libwebp-1.1.0-windows-x64\bin;C:\Users\Rithvij\go\src\github.com\tidbyt\go-libwebp\libwebp-1.1.0\output\release-dynamic\x64\bin;C:\Program Files\filebrowser;D:\Software\Heroku\bin;C:\Program Files\MongoDB\Server\4.2\bin;D:\Downloads\PSTools;C:\Program Files\dotnet\;D:\Software\Oracle\VirtualBox;

Additional Notes:

  1. I’m not sure where the issue occurs I tried debugging with @echo on in init.bat and following files and found it failed when it printed a lot of PATH variables like if NOT <PATH…>``
  2. I’m not sure how long PATH should be for it to occur but I’ve added my PATH when it occurred
  3. My workaround was to remove users PATH then run cmder, close, then fill the user’s PATH back, then subsequent runs worked normally

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 24 (20 by maintainers)

Most upvoted comments

I retested again and somehow got different results, I don’t know why. Initially I was even getting the error when leaving just the debug statements.

I implemented the code from @chrisant996 above and it seems to have resolved the error.

New build here.

Initial launch example and current path length:

image

This build is good.

I have doubts that this is the cause though because if it were it would probably happen on every launch after the users path were added back in following the initial launch.

Yeah, weirdly I didn’t get it after I added the path back for the very first time. ~I remember rebooting before testing it, does it change things? I’ll try rebooting again and edit this.~ rebooting does nothing issue still occurs

I got it again after I ran cmder subsequently as you said.

When Cmder full first starts after extraction it runs a script included with git for windows exactly one time that deletes itself. I wonder if the error is coming from the %cmder_root%\vendor\git for windows\post-install.bat script.

You could prove this by downloading cmder_mini, extracting and launching cmder.exe without removing your user path as it does not contain nor run this script.

I did as you said and it error does occur with cmder_mini

Generating clink initial settings in "D:\Downloads\cmder_mini\config\settings"
        1 file(s) copied.
Additional *.lua files in "D:\Downloads\cmder_mini\config" are loaded on startup.
The input line is too long.
The syntax of the command is incorrect.

D:\Downloads\cmder_mini
λ

Sorry for responding late, after you’ve possibly fixed it 😢 .

This build is good.

~I’m gonna test it and let you know if it works in my system.~

Works!!

Generating clink initial settings in "D:\Downloads\cmder\config\clink_settings"
        1 file(s) copied.
Additional *.lua files in "D:\Downloads\cmder\config" are loaded on startup.
Creating initial user_aliases store in "D:\Downloads\cmder\config\user_aliases.cmd"...
        1 file(s) copied.
Running Git for Windows one time Post Install....
"running post-install"
'C:\WINDOWS\system32\drivers\etc\hosts' -> '/etc/hosts'
'C:\WINDOWS\system32\drivers\etc\protocol' -> '/etc/protocols'
'C:\WINDOWS\system32\drivers\etc\services' -> '/etc/services'
'C:\WINDOWS\system32\drivers\etc\networks' -> '/etc/networks'
The batch file cannot be found.
Creating user startup file: "D:\Downloads\cmder\config\user_profile.cmd"
        1 file(s) copied.

D:\Downloads\cmder
λ