-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Use user_conemu.xml or conemu-%computername%.xml directly if '-c [path]' is used to start cmder. #1949
Conversation
…h]' is used to start cmder.
Adding one more thing:
This allows all new users to have a shared starting point for ConEmu config that they can then modify without access to modify the shared config. |
Awesome direction Dax! I am anxious to test but I want to verify I'm testing it correctly for the scenarios you envision and not just my workflow. In the scenario of multiple machines for instance all having shared access to a mapped D:\Programs\cmder as the cmder root which has the default cmder distribution structure including cmder\config folder, would you envision each machine still running using this new switch as Sorry but as I previously indicated I currently run shared without any use of the |
@CollinChaffin if you want each user to have their own init scripts, aliases, and history you would create a shortcut like:
If a user wants computer specific config they can copy their |
@CollinChaffin users will have total control of their personal config, history, and conemu settings with no conflicts. |
Just added |
Running the below inside Cmder:
Creates this shell extension:
|
Ok excellent thanks for explanation testing now but one more question that I think I know the (probably unhappy) answer but I'll verify anyway. So, in the above scenario did you consider what happens in the case where The whole fallback to "-machine.xml" is clear was a different approach to avoid collision in multi-use but it is also not unreasonable to say if you are running a switch asking for a profile specific to a user or computer already, that you should be expected to know which you want hence the switch you used should only support one or the other. So,
The above naming convensions for actual XML config files remains unchanged, only path is being added for profiles. This common "profile" "pick one or the other" approach would in essence ensure that underlying Conemu remains totally ignorant to any of this, as you then in your code are simply passing the end path to Conemu's launch params and ensure that you could literally now log on to three different machines, all as local machine user TESTUSER, with CMDer installed on a mapped NAS drive U:, and it looks like this:
This way, straight, simple, never any need to even code additional new fallbacks to %computername% config from user_conemu.xml because the user must decide when using either /c or /m if they want the config to be user or computer specific and it is much cleaner they no longer collide, and Conemu now can store all data history/etc. per user but can still easily fallback to prior behavior, if desired. The big missing piece here causing collisions has always been the FOLDER used for all the different components, and this is a great chance to implement a true front-end of overall "PROFILES" that is missing today in Conemu/Clink but that will support a true shared NAS or similar single instance CMDer/Conemu install, while at the same time greatly enhancing the usability. Thoughts? |
EDIT: You asked for thoughts and I had so many I could not type them all on my phone last night before heading to bed. So here they are!Your use case is VERY specific and I can't see changing/breaking features that are already in the wild, and have been for some time, so drastically to suit it. Specific features I am speaking of are:
First an explanation of the original features:
Feature Enhancements in this PR
How this affects your use caseA user can create a shortcut with whatever The exception being the BONUS SCENARIO. If Usage as designed
So you could have a shortcut that is both Computer and User specific as shown below:
If using scenarios similar to above would produce:
Responses to your statements:
|
Hey @daxgames so sorry I didn't reply sooner. I totally misunderstood and do want to reconfirm (and in process of testing myself too) that your new So, I think we were actually thinking pretty identically on this and perhaps you misread my scenario as I think it not only is exactly what the new
And, since it appears that the new |
@CollinChaffin Cool, I too thought it was a pretty complete solution after reworking it. Working with you and your use case helped me to see where the previous Its funny, it has taken more time and text to explain hw what it can do works than it took to make the actual modifications to the code! Please just let us know if you run into any issues so we can get this peer reviewed and merged. I will release 1.3.9 shortly after. |
Okay @daxgames so I've run this through it's paces pretty good now on a number of scenarios, ultimately with great success! There is only one thing that if not now hopefully you can see the value in (although always easier said than done with coding it) which is the initial profile creation. I think you agree since you've nicely added some decent initialization already that now this introduces a whole new level of not only scalability, but support/maintenance overhead. Namely, this same abbreviated scenario we already discussed: TestingShortcut command-line:
Profile does not exist, post 1st run folder structure and config files looks like:
Observations / Issues / Questions
So, this might be intended but for strictly 1st run initialization of these new profiles I want you to consider setting the behavior to automatically copy the legacy shared config files, obviously only if the target profile does not already exist. This also ensures that as a shared installtion scales, the adminsitrator has a supported (and friendly) method of simply staging the entire legacy %cmderroot%\config one time - be it for a shared UNC install of 5000 users or a home user who wants to set up CMDer one time in a cloud sync folder and either way once the single config folder (which BTW the beauty is that it is still fully usable for initial setup and testing) and know that ANY newly created profiles with Also, as a secondary, I have not gone through all of the new code so I'll just ask to verify that all those profile.d files (and ANYTHING else in the PROFILE\config*) under the And lastly, does this open up any caveats where even paths relative to %cmderroot% are being written into any config files that either 1. now break functions in general if running from this new profile location, and 2. prevent other means (scripting, etc.) of maintaining profile config files based off a single master copy? Just a thought I believe the answer is no and I know you already thought about it once, but now that it's moving forward wanted to bounce it off of you before large implementations begin cropping up. :) Otherwise, overall this looks awesome! Some of this could just be a matter of having to have solid documentation so any legacy users moving to profiles knows exactly what does NOT come over by default, and exactly what they are responsible for moving where (assuming you don't whip up the magic code to do it for them) :). One of the nicest things was to see the separate history (clink) working properly for the first time ever! That itself will excite many. Again, nice work! Let me know what you think about the above and I'll be happy to continue any further testing! LOL and per your comment it is admittedly nice to interact with someone that is as detailed in their explanations as I am because I don't know about you but for me there is nothing worse than taking a bunch of time to write-up a ton of detail, even if in the form of a question, to then have the responder with whom you are interacting reply with all of a few words! |
@CollinChaffin - Answers/Responses
I noticed in the Powershell
This is wrong and was done 3 months ago via a PR. The code that I know worked because I wrote it used to be:
I will be fixing it. Its already written and will be added to this PR: Note: you can un-comment the write-host line to confirm these are being sourced. Fixed code:
If you want to copy them down you have a
|
@CollinChaffin - Fixed Tested as follows: Created
Created
Launched new sessions with and without |
Ahh got it! I did not realize that both the shared and user profiles were both executing. I am testing more now but things are looking great we will just have to script some initial user profile setup but since the shared still does execute, it may not wind up being as necessary. |
Sorry one quick question the only thing still not clear to me is that despite this message that mirrors what you said above:
Above you said be careful that BOTH shared then the new profile user profiles would be loaded so don't duplicate, so I am unclear then as to why it is copying/creating what are duplicates to what is in shared? I do init things usually in my tasks via separate scripts anyway so perhaps I'm premature in asking prior to just testing but is it that these appear as duplicates to my shared defaults simply because they ARE always vanilla defaults? And just to re-confirm for testing, ALL lua and user profile/alias' first execute the shared and then also execute ALL of the same via profiles so for instance a ENV variable named "TESTVAR" set in both user_profile.cmd in shared to "ONE" and then the same var set to "TWO" in profiles winds up after init being set to "TWO", correct? |
The files created in the user config folder are initial vanilla defaults that do very little. Above I recommended if you want every user to have the same profile.d scripts to not duplicate them in both profile.d folders. Users still need their own user_profile.* and user_aliases.* so they can add their own config customization after the shared profile runs. EDIT: Lua does indeed run first from shared config folder then the profiles config folder. Your env var assumption is correct. Profile config overrides shared config. |
@CollinChaffin We good to go on this one? I know all has been positive so far but wanted to check since you have used this more than anyone. |
Hey sorry absolutely testing looks great on this! In fact I missed your message above and just checked hoping to find this enhancement merged into master seeing these last few commits. Nobody knows about it but I guarantee once they do that I won't be the only one using this feature especially if they see how it can be combined with cloud storage as a careful fully portable install which is what I've been testing and this is the piece that's been missing. Commit away! EDIT: And FYI when introduced your recommendation of using: |
@Stanzilla you want to look at this before it's merged? I was going to merge it and release 1.3.9. I'd like to start releasing more frequently rather than waiting months. |
I'm completely out of the loop, I trust your judgement :) |
@CollinChaffin - Merged and Released. |
@CollinChaffin Can you test this? Related to #695
Cmder Shared Install Multi User Enhancement
This PR enhances the way Cmder.exe launches ConEmu when
/c [path]
is used on the command line to enable using a shared install of Cmder.Sorry for the long explanation but I felt it was necessary.
Current Behavior
Cmder.exe
does someConEmu.xml
configuration magic to retain user settings modifications done in the ConEmu GUI. WhenCmder.exe
is started it does the following logic:%CMDER_ROOT%\config\ConEmu-%COMPUTERNAME%.xml
file exists%CMDER_ROOT%\vendor\conemu-maximus5\ConEmu.xml
file exists%CMDER_ROOT%\vendor\conemu-maximus5\ConEmu.xml
to%CMDER_ROOT%config/ConEmu-%COMPUTERNAME%.xml
to save any ConEmu GUI settings changes from previous sessions so they can be used in future sessions.%CMDER_ROOT%\config\ConEmu-%COMPUTERNAME%.xml
to%CMDER_ROOT%\vendor\conemu-maximus5\ConEmu.xml
. This is usually done following an upgrade of Cmder to reapply previously backed up configuration.%CMDER_ROOT%\config\user_conemu.xml
exists%CMDER_ROOT%\vendor\conemu-maximus5\ConEmu.xml
to%CMDER_ROOT%\config\user_conemu.xml
to save any ConEmu GUI settings changes from previous sessions so they can be used in future sessions.%CMDER_ROOT%\config\user-conemu.xml to
%CMDER_ROOT%\vendor\conemu-maximus5\ConEmu.xml`. This is usually done following an upgrade of Cmder to reapply previously backed up configuration.%CMDER_ROOT%\vendor\ConEmu.xml.default
to%CMDER_ROOT%\vendor\conemu-maximus5\ConEmu.xml
. This happens on a brand new Cmder install whaere no previously backed up config exists.This is done because the maintainer of ConEmu recommends leaving the ConEmu.xml file in the program folder. This results in all user init scripts and config are stored in a single place, the
%CMDER_ROOT%\config
folder.The Problem when you use
/c [path]
command line argument.The current behavior works great for a single user because all config is stored in
%CMDER_ROOT%\config
ConEmu runs using the%CMDER_ROOT%\vendor\conemu-maximus5\ConEmu.xml
file that is backed up on launch to%CMDER_ROOT%\config
.This is not so great for a use case where a shared install of Cmder would be beneficial. Different users WILL want different settings based on personal preference. The default behavior does not allow this but the
/c [path]
currently partially enabled using a shared install.The storage of user init scripts and config changes using this command line switch. Init scripts and conemu.xml backups are stored in the
[user specified path]\config
instead of%CMDER_ROOT%\config
. This allows the following:Cmder.exe
can now use the%CMDER_ROOT%\config
init scripts to allow a shared set of binaries and some shared configuration. It can now also apply user specific configuration after the shared configuration allowing users to have their own settings - ALMOST.The problem is that Cmder still applies the same logic detailed above or handling ConEmu.xml config so SOME user unique config is possible but not all. It requires that all users have write access to the
%CMDER_ROOT%\vendor\conemu-maximus5\ConEmu.xml
. This can result in user settings change contention in ConEmu.This PR fixes the last issue and enables true shared install with complete user customization.
The Difference in this PR.
When
-c [path]
is used to launch Cmder it does everything mentioned above but the logic handling ConEmu.xml backups changes:/c [path]
is used[path]\config\ConEmu-%COMPUTERNAME%.xml
file exists[path]\config\ConEmu-%COMPUTERNAME%.xml
to launchConEmu.exe
[path]\config\user_conemu.xml
exists[path]\config\user_conemu.xml
to launchConEmu.exe
%CMDER_ROOT%\vendor\ConEmu.xml.default
to[path]\config\user_conemu.xml
[path]\config\user_conemu.xml
to launchConEmu.exe
This way no backup is required because changes in the GUI are written directly to the file in
[path]\config