Skip to content
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

Merged
merged 1 commit into from
Oct 13, 2015

Conversation

jankatins
Copy link
Contributor

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

@jankatins
Copy link
Contributor Author

This is an alternative version to #520

@jankatins
Copy link
Contributor Author

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 :-)

@Stanzilla
Copy link
Member

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.

@jankatins
Copy link
Contributor Author

Yo mean the @echo @echo Executing user startup file: "%%CMDER_ROOT%%\config\user-startup.cmd" which is written to the user startup file?

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...

@Stanzilla
Copy link
Member

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..

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.
@jankatins
Copy link
Contributor Author

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..

@jankatins
Copy link
Contributor Author

Updated the created script to not print a message to the user. Also updated the readme (how to enable the ssh agent).

@Stanzilla
Copy link
Member

Oh indeed, totally forgot about that

@jankatins
Copy link
Contributor Author

It would probably be also good to do something similar for the PS init, but I don't know any PS :-(

@pavelkouril
Copy link

PowerShell wise, this is relevant to "separate user startup file" - #633

@jankatins
Copy link
Contributor Author

@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?

@pavelkouril
Copy link

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).

Stanzilla added a commit that referenced this pull request Oct 13, 2015
Add a user startup file which can be modified
@Stanzilla Stanzilla merged commit d6b54ee into cmderdev:development Oct 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants