-
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
Add a user startup file which can be modified #612
Conversation
This is an alternative version to #520 |
Ok, this is now involved in a merge conflict. Before trying to resolve the conflict, it would be nice if this solution or the one in #520 is chosen. I can rebase either one :-) |
I like your approach but I don't think we need the loading messages etc, we don't have them for any other kind of config file that we load. |
Yo mean the I intended that for the user to "find" the new config file (otherwise after the first time, there is no indication that this config file is there) and then let the user remove the line. Removing it is no problem... |
2606c74
to
5e431ea
Compare
Yes, exactly. Instead of creating the new file inside the script we could just ship it (empty) by default, always call it and add a paragraph to the Readme that tells users how to use it. That's just my idea on how to do it.. |
5e431ea
to
48259b8
Compare
Up to now, init.bat would be overwritten when a user updated Cmder. The new mechanism will create a new (mostly empty) file for the user to enter commands which will then be executed on each following startup.
The problem is that a shipped file is overwritten on the next update (at least if I copy the files over the current installation path). That was my motivation for this PR: init.bat has changes which result in a newer version and I have to redo my integration the next time I update. The "create the new file, if it doesn't exist" pattern prevents that.. |
Updated the created script to not print a message to the user. Also updated the readme (how to enable the ssh agent). |
Oh indeed, totally forgot about that |
It would probably be also good to do something similar for the PS init, but I don't know any PS :-( |
PowerShell wise, this is relevant to "separate user startup file" - #633 |
@pavelkouril Yep, the PS version is more in line of #520: you need to add a env variable to point to you startup file. Not sure if that's more "normal" for PS? |
It's not an ENV variable - it's a standard PS variable. :) PS profile is a file that is automatically launched when you launch "classic" PowerShell. However, when using PS from cmder, the PS profile is skipped (and the profile.ps1 is used instead); that PR checks if user has his $PROFILE set, and if he does, it is launched after cmder's profile loads). |
Add a user startup file which can be modified
Up to now, init.bat would be overwritten when a user updated
Cmder. The new mechanism will create a new (mostly empty) file
for the user to enter commands which will then be executed on
each following startup.
Closes: #608