-
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
files in config get overwritten #694
Comments
I think at least two things should be moved out of the config dir: For the latter it's I think the easiest to move it to Not sure what to do about the |
Is it possible for the config/aliases file to stay where it is so the cmder team can include 'default' aliases and also the use of a user-aliases file in the config folder that is loaded after the config/aliases if it exists not overwritten on update. The alias.bat file would need to be modified to add user aliases to config/user-aliases instead of config/aliases. Not even sure if it is possible, I'm not a doskey guru, but this provides the best of both worlds. |
I currently use IMO: move the current |
If #736 gets merged, only But on the other hand, I've actually no idea how the |
What do you guys think of my suggestion of having a cmder team controlled aliases file that is loaded first then a config\user-aliases file that is loaded second? This would require making the bin\alias.bat manage config\user-aliases. I have verified this would work and it is an easy change. I have about a lot of aliases, mostly Git related, that make most Git commands 1-5 characters for both cmd and bash. I could also look at making these work Powershell. It would be nice to add these to Cmder. A user could override any included macro with his own by adding it to the config/user-aliases, config/user-profile.ps1, or config/user-profile.sh. Edit: Unfortunately Powershell's new-alias and set-alias are lame and cannot make aliases that have command line arguments. So really useful Powershell aliases are not likely to happen. |
I'm against a cmder controlled alias file if you couldn't "unalias" any alias in it. |
ConEmu.xml could be handled I a similar way I am handling cmder.sh and similarly to the way you handled aliases. There could be a default vendor/conemu.xml.default file that is copied to the config dir by Cmder.exe if it does not already exist before it launches ConEmu.exe. This requires changes to cmder.exe that I cannot do or I would and create a PR. Somebody? :-) This plus your cmder.lua suggestion just leaves the settings file to deal with. Not even sure what it does but it could be handled in a similar way as well leaving the config/ dir a create on demand and purely for user config that is never overwritten. I like it. |
@daxgames Sorry to hijack the thread, but how do you manage aliases for both cmd and bash on Windows? I currently switch between both frequently (from within cmder of course) and up until now have been duplicating aliases; once in config/aliases and once in a .aliases file in my home directory (which I source in .bashrc). I'd love to find a cleaner way of doing this! |
Same for PowerShell as well really, should we keep the doskey syntax and write something to parse it for bash and Ps? Or have something completely different? |
@rmorrin I am right there with you. I currently have two files. One for bash and one for cmd. Powershell aliases suck so they will never be as functional as cmd/sh. |
@MartiUK - I think coding some bash to parse the config/aliases file and convert it to bash aliases would not be too tough as long and that file did not contain any Doskey special characters like $B, $G, $L, The problems I see are not all macros will work in bash and cmd and if you want to save macros in bash you would have to manually edit the config/aliases files in doskey format. Just seems clunky and error prone. Powershell aliases can only alias a single command with no arguments to a single probably shorter command so it is pointless to worry about converting doskey/sh aliases to Powershell. They just do not work right. |
Correct and I agree but there's nothing to stop you just making a function in the PS profile that does the alias you require. You can even make a nice descriptive named function and alias that to type in. i.e I have: function get-list{
get-childitem @args | format-wide -autosize
}
Set-Alias lsa get-list
#...other things
# CD to my projects folder at startup
lsa -Directory more examples, albeit an old file now noteworthy: |
Current status (for cmd): Only the conemu.xml file is overwritten, everything else is generated on first start. |
@JanSchulz PR#1109 - Addresses the above by backing up the If neither exists the backup will default to |
I my case it's problematic foraliases
but the other files might also be problematic. IMOconfig
should be empty apart form a readme.md file and either be populated byvendor\init.bat
orcmder
itself.Only the conemu.xml file is overwritten, everything else is generated on first start.
The text was updated successfully, but these errors were encountered: