Merge branch 'ps1_prompt' of https://github.com/daxgames/cmder into ps1_prompt

This commit is contained in:
Dax T. Games 2019-03-31 16:48:10 -04:00
commit 345562dbd0
3 changed files with 17 additions and 12 deletions

View File

@ -44,6 +44,11 @@
(Be sure to also check “Closed” issues in the labels section!)
• If you have a request to provide auto-complete support for a new tool,
please post your request here:
https://github.com/vladimir-kotikov/clink-completions/issues
• If you are having an issue with any of the **upstream technologies**
that are used by Cmder, please make sure that the issue is reproducible
_only_ when used in combination with Cmder.
@ -52,9 +57,9 @@
- Clink, the default shell in Cmder
- ConEmu, the terminal emulator
- Git/MinGW, which also provide *NIX tools
- clink-completions, which provide autocomplete
- clink-completions, which provide autocompletion
The issues related to upstream technologies are marked as 👆 [name].
The issues related to upstream technologies are labeled as 👆 [name].
We'll try our best to help you -- but we recommend creating an issue
specifically at each of the corresponding repositories for the best
@ -78,7 +83,7 @@
<!--
Some tips on how to write a better report:
- Put an `x` into all the boxes [ ] relevant to your issue (correct example: [x] not like this: [ x] or [x ]).
- Put an `x` into all the boxes [ ] relevant to your issue (correct example: [x] -- not like this: [ x] or [x ]).
- Use the *Preview* tab to see how your issue will actually look like, before sending it.
- Make sure the description is worded well enough to be understood, and with as much context and examples as possible.
- Post a screenshot or the command the triggered the problem, if applicable.
@ -98,5 +103,7 @@
### Version Information
<!-- Please write your Cmder and ConEmu version here -->
<!-- If applicable, write down your Windows edition too (e.g. Windows 10 Pro 1809) -->
### Description of the issue
<!-- Provide a clear, simple description of your issue here -->

2
vendor/init.bat vendored
View File

@ -51,9 +51,7 @@ call "%cmder_root%\vendor\lib\lib_profile"
) else if /i "%1"=="/v" (
set verbose_output=1
) else if /i "%1"=="/d" (
if not defined VSCODE_CWD (
set debug_output=1
)
) else if /i "%1" == "/max_depth" (
if "%~2" geq "1" if "%~2" leq "5" (
set "max_depth=%~2"

12
vendor/profile.ps1 vendored
View File

@ -25,7 +25,7 @@ if (! $ENV:CMDER_ROOT ) {
# Remove trailing '\'
$ENV:CMDER_ROOT = (($ENV:CMDER_ROOT).trimend("\"))
# do not load bundled psget if a module installer is already available
# Do not load bundled psget if a module installer is already available
# -> recent PowerShell versions include PowerShellGet out of the box
$moduleInstallerAvailable = [bool](Get-Command -Name 'Install-Module' -ErrorAction SilentlyContinue)
@ -99,11 +99,6 @@ if (Get-Module PSReadline -ErrorAction "SilentlyContinue") {
# Enhance Path
$env:Path = "$Env:CMDER_ROOT\bin;$Env:CMDER_ROOT\vendor\bin;$env:Path;$Env:CMDER_ROOT"
#
# Prompt Section
# Users should modify their user_profile.ps1 as it will be safe from updates.
#
# Drop *.ps1 files into "$ENV:CMDER_ROOT\config\profile.d"
# to source them at startup.
if (-not (test-path "$ENV:CMDER_ROOT\config\profile.d")) {
@ -168,6 +163,11 @@ if (! (Test-Path $CmderUserProfilePath) ) {
Copy-Item "$env:CMDER_ROOT\vendor\user_profile.ps1.default" -Destination $CmderUserProfilePath
}
#
# Prompt Section
# Users should modify their user_profile.ps1 as it will be safe from updates.
#
# Only set the prompt if it is currently set to the default
# This allows users to configure the prompt in their user_profile.ps1 or config\profile.d\*.ps1
if ( $(get-command prompt).Definition -match 'PS \$\(\$executionContext.SessionState.Path.CurrentLocation\)\$\(' -and `