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

Development #1169

Merged
merged 10 commits into from
Nov 19, 2016
Merged

Development #1169

merged 10 commits into from
Nov 19, 2016

Conversation

Stanzilla
Copy link
Member

No description provided.

Jackbennett and others added 10 commits May 12, 2016 13:59
Add a pre and post function hook around the Cmder prompt.
Specify the cmder prompt as a function that could be replaced by a user.
Write a friendly message when the user profile template is created.
Create the user profile with cmder prompt hooks ready to use.

It was concerning to run any function with a specific name every prompt
with no guarantee it remains what it was initally created as.

Core functions have been explicitly called from their
namespace like Microsoft.PowerShell.Utility\Write-Host to try and prevent
clobbering.

User supplied functions are passed in as script blocks, created as the
session runs the profile script. By creating them as constants these
function names cannot be declared again for the duration of the process.

Since the prompt function already exists by this time, set the readOnly
flag so to re-declare the prompt requires the use of -force.

It is hoped these changes limit what could be the risk of any script
redefining functions that are called automatically without user intent or
input.
Import-Git now finds if the module isn't installed at all and alerts the
user. But only when in a git folder.
Unfortunately doesn't apply to conEmu's tab name.
As the prompt function is called all the time, specifically namespace the
cmldets it uses to avoid them being hijacked in the user session.
Posh-Git before this release does not export `Write-VcsStatus` thus
powershell's autoloading cannot find the reqired module for the function.

note that `get-module -listAvailable` can return an array of multiple
versions.
Custom prompt hooks protected from later overwriting
@Stanzilla Stanzilla merged commit 8420272 into master Nov 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants