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
New cmder.exe args and shared install capability #1696
Conversation
…l user config location
… an init.bat launch
…nce the env is not shared.
|
@cmderdev/trusted-contributors @DRSDavidSoft - This is a new PR based on #1665 because I screwed that branch up somehow trying to rebase for @Stanzilla. Please test the Nightly build of this commit. |
4ad32c0
to
bf014df
Compare
|
Subscribed again! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot confirm that %userprofile%\cmder_config is created on first run in my test.
launcher/src/CmderLauncher.cpp
Outdated
| int argCount; | ||
|
|
||
| szArgList = CommandLineToArgvW(GetCommandLine(), &argCount); | ||
| /* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why these lines are left in commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
launcher/src/CmderLauncher.cpp
Outdated
| MessageBox(NULL, L"Unrecognized parameter.\n\nValid options:\n\n /c [CMDER User Root Path]\n\n /task [ConEmu Task Name]\n\n [/start [Start in Path] | [Start in Path]]\n\n /single\n\nor\n\n /register [USER | ALL]\n\nor\n\n /unregister [USER | ALL]\n", MB_TITLE, MB_OK); | ||
| cmderOptions.error = true; | ||
| } | ||
| //} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented out brace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unintentional whitespace here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
|
@daxgames Ignore me, I didn't specify |
|
@MartiUK I could clean those comments and whitespace up and add a default for. |
|
Yeah a default is needed, bit confusing otherwise, could also make it error if nothing gets specified? |
|
@Stanzilla @daxgames Well, at the moment cmder does not start at all when running with /C but without an argument. |
|
yeah, that should throw an error, imo. I hate it when stuff silently dies and I have no idea why (Hint UWP apps HINT) |
Comments and whites pace cleaned up and default for /c is %userprofile%\cmder_cfg if the next arg is NULL or not an arg beginning in /
|
@cmderdev/trusted-contributors, @DRSDavidSoft It's done. Comments and whites space is cleaned up and default for There may be a better way to do it but this works. I also found that the handling and backup of the The following now work in this order: If
|
… arg is not another arg
60dd70a
to
a221702
Compare
|
Really happy with this so far |
|
Yeah this looks good to me, is there nothing else to add @daxgames? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
|
Grats on shipping! Also have fun with closing all the issues that are now fixed :) |
@MartiUK: Squashing to avoid adding multiple "fixed" commits * add args to init.bat * adding args to cmder launcher * reworked command line parsing and added a /C [path] arg for individual user config location * removed unnecessary includes * make shell init scripts work with CMDER_USER_CONFIG * update tasks and readme.md * fix git version check * readme updates * add register/unregister back in * fixed git version again * removed error if user defines user-aliases store file was not present an init.bat launch * added enhance_path method to only update path if required * added enhance_path method to only update path if required * fixed a path prepend issue in enhance path * init.bat with args is executed outside cmder/conemu sets cmder_root properly. Thanks @DRSDavidSoft * fixed enhance path append issue * implements recursive `/bin` path enhancing. cmderdev#1624 * added max depth * changes command line arg to max_depth * set max_depth default * readme.md updates * add back cmder /c [path] arg so it can be used with admin sessions since the env is not shared. * readme.md updates * fix /c setting of cmder_user_config * changelog and readme * remove bad arg * fixed command line parsing and updated command line help on error * Fixed ConEmu.xml file handling so it works again * Added default user config root location if '/c' is specified and next arg is not another arg
|
For users that need to run *PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression 'Import-Module ''%ConEmuDir%\..\profile.ps1'''"and Instead, on the Environment panel, set these two variables to match your configuration: set CMDER_USER_BIN=C:\full\path\to\your\cmder\bin
set CMDER_USER_CONFIG=C:\full\path\to\your\cmder\configand new Powershell as Admin sessions will use your |
1.3.6-pre1 (2018-03-01)
The is a redo of #1665 - See the conversation there if you have questions.
Fixed bugs:
Updates:
cmder.execommand line argument handling to make it more flexible and easily added to.Implemented enhancements:
%GIT_INSTALL_ROOT%\mingw32|64folder to the path if it exists. Thanks: @gucong3000cmder.execommand line args documenttion toREADME.md:enhance_pathmethod to vendor\init.bat that modifies the path only if required.call :enhance_path "%cmder_root%"call :enhance_path "%cmder_root%" append:enhance_path_recursivemethod to vendor\init.bat that adds a path and all its sub directories to the path if required.init.bat /max_depth [1-5]. 6+ results in error.call :enhance_path "%cmder_root%" 3call :enhance_path "%cmder_root%" 2 append%HOME%environment variable.%cmder_root%\binand%cmder_user_bin%cmder.exe /C \<path\>argumentTo use run Cmder.exe with "/C" command line argument. Example:
cmder.exe /C %userprofile%\cmder_configTo use run with
Cmder as Adminsessions you must specify "/c" command line argument toinit.batin tasks. See README.md for details.Enables shared Cmder install with Non-Portable Individual User Config
Supported by all supported shells (cmder, powershell, git bash, and external bash)
This will create the following directory structure if it is missing.
Shell init scripts run in the following order