* use "PS" instead of no-width "$([char]0x200B)" character in prompt (credit @skycommand)
* fixes additional space after the lambada and before the path
* display "PS" before path to distinguish between PowerShell and CMD
* Fix start errors in path with ()
* Fix start errors in path with ()
* Fix start errors in path with ()
* Fix start errors in path with ()
* remove quotes from debug_output messages
* remove quotes from debug_output messages
* remove quotes from debug_output messages
* discovery newer git version
* new git path config for powershell
* xxx
* add isGitShim
* fix no git found in path
* debug
* revert not ps1 changes
* cleanup
* final
* spacing
* fixes
* cleanup
* cleanup
* timer for Powershell
* fixes
* fixes for git path settings
* grab vendor/bin/alias.cmd from master
Co-authored-by: Dax T. Games <dtgaes@kinggeek.org>
Co-authored-by: dgames <dgames@dtg.local>
## Rename user-profile.* user_profile.* to resolve#1806, #1675
* This is a backward compatible fix and will automatically and silently rename users '%cmder_root%/config/user-profile.\*' to '%cmder_root%/config/user_profile.\*' and '[user_specified_config_root]/user-profile.\*' to '[user_specified_config_root]/user_profile.\*' if the sources exist.
* Cmder.exe does this for cmd.exe sessions.
* The init scripts for bash and Powershell handles it for these shells
Fixes Powershell 5.1 error when Windows Software Restriction Policy is enabled:
bin\vendor\profile.ps1 : Cannot dot-source this command because it was defined in a different language mode. To invoke this command without importing its contents, omit the '.' operator.
At line:1 char:1
+ . 'bin\vendor\conemu-maximus5\..\profi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [profile.ps1], NotSupportedException
+ FullyQualifiedErrorId : DotSourceNotSupported,profile.ps1
@MartiUK: Squashing to avoid adding multiple "fixed" commits
* add args to init.bat
* adding args to cmder launcher
* reworked command line parsing and added a /C [path] arg for individual user config location
* removed unnecessary includes
* make shell init scripts work with CMDER_USER_CONFIG
* update tasks and readme.md
* fix git version check
* readme updates
* add register/unregister back in
* fixed git version again
* removed error if user defines user-aliases store file was not present an init.bat launch
* added enhance_path method to only update path if required
* added enhance_path method to only update path if required
* fixed a path prepend issue in enhance path
* init.bat with args is executed outside cmder/conemu sets cmder_root properly. Thanks @DRSDavidSoft
* fixed enhance path append issue
* implements recursive `/bin` path enhancing.
https://github.com/cmderdev/cmder/issues/1624
* added max depth
* changes command line arg to max_depth
* set max_depth default
* readme.md updates
* add back cmder /c [path] arg so it can be used with admin sessions since the env is not shared.
* readme.md updates
* fix /c setting of cmder_user_config
* changelog and readme
* remove bad arg
* fixed command line parsing and updated command line help on error
* Fixed ConEmu.xml file handling so it works again
* Added default user config root location if '/c' is specified and next arg is not another arg
Aliases such as `ls` may have been overridden in the user's profile script and the resulting behavior may be different from `Get-ChildItem`. For example binding `ls` to GNU `ls.exe` generates an error if there are no matching files.
If the Install-Module command is available, do not include the bundled
module path containing a deprecated version of PSGet. Recent powershell
versions include PowerShellGet as standard module installer.
Resolve#1318.
This defines the default prompt variables ($PrePrompt, $PostPrompt,
$CmderPrompt, and $Prompt) before running the custom scripts (user-profile.ps1
and profile.d/*.ps1), and then saves those prompt values after running the
custom scripts. This gives the custom scripts and opportunity to override the
prompt code blocks.
This now opens the possibility for profile.d/*.ps1 scripts to affect the
prompt, and also allows both user-profile.ps1 and profile.d/*.ps1 scripts to
overwrite the $Prompt script block and overwrite the prompt behavior entirely.
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.
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.