From 1662678ebf99b4f862b2f57a55fccfedf76393f4 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Wed, 28 Mar 2018 18:16:14 +0430 Subject: [PATCH 01/62] fixed line endings --- launcher/src/Resource.rc | Bin 3226 -> 1612 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/launcher/src/Resource.rc b/launcher/src/Resource.rc index 9d4ec33b65e2c0b97ed422a28fc9fc9ffad731e0..7f0b9067ebea6bd65c077946118a489e6ba96965 100644 GIT binary patch literal 1612 zcmcIkQE!_t5PnDEKiud`qgJrBzkq~UfogD{OtP-8<8U@cx_GJs+-5tD9PDQC`4T8$97Zn9r3AR_ZX*iB)+%R6X zeNDmoh}&DsG%!%phH(n+_jHr_VN$G#>nCyaTBNV5WfG-2f5vqx$8jJSDsDu#1GS~F zAupRS_M*%u@Gvy;M+XPSv59m2GnRJ5spkmD-_W=M9zgh8%j6brGtM-JsX{8{Vt_y% znPLrmIb4h|QHjR;P^UtVU5@SuK@o;(bZ@F88 zTC7~;95bzP{^RBROIvR!uaN>=Sobh413uS6D6BgE0S#WPO*k;Mg|<6TsUY;>N7?oi z_H9|Ab{Zzot2&@u_JTsW-?ywP6~jDsJ`07lD;bx7wq#OKt^mVj+k*Uw=1$_!g??Cg zE1#@&%cB)~Njx%#U(2@hTz~o&ndjB6rou)8F`r=fA8Ma@s*kds4)(y?%vb40F=ELs$zV~ej8NmI`Kd$AEcAN3Zi zkJdSEHzEJ#+*C>oID5#QC(L3V_85h%OzkWu3evrtnt6XcxRqNIG@jcFqAKK6kNg>s zU3GRI5nXMX^nRteqmq4ebcx{+QXS;a{H|@N9jF8PrjOG|34Bd-x5(9(_88qg_-ass z%pu2!)sWR80(6$+5up6I;v}!wweinkL4KCUm{70pDLy;SS>xnQj}zj}$J?Pj*c499 zddIs#(s}Rd?Vx(%;9Sv!TVsz;GjEOa^L@KQ-CDq-H$sYJusdZgOH>tQk7T5EPSacC z%Wic+A1a+JZh=5`UID6#UHDG57MyxLoZ{JEE3r?7m>u5qI-BfDJ#|c_79y=#4=W+g zkH_8L!S?+)DAqW}oDgD)pZ-_8{yF2GLWU@Rv#+!)#{K}T C28J2{ From a85cd81f00f684ac358f9e3b6ea6327c706265bd Mon Sep 17 00:00:00 2001 From: David Refoua Date: Wed, 28 Mar 2018 18:37:46 +0430 Subject: [PATCH 02/62] added version resources and manifest. --- launcher/src/Resource.rc | 51 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/launcher/src/Resource.rc b/launcher/src/Resource.rc index 7f0b906..ccbdeab 100644 --- a/launcher/src/Resource.rc +++ b/launcher/src/Resource.rc @@ -1,6 +1,14 @@ -// Microsoft Visual C++ generated resource script. -// +/* _ + ___ _ __ ___ __| | ___ _ __ + / __| '_ ` _ \ / _` |/ _ \ '__| +| (__| | | | | | (_| | __/ | + \___|_| |_| |_|\__,_|\___|_| +============================================================================= + The Cmder Console Emulator Project +*/ + #include "resource.h" +#include "version.rc2" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// @@ -54,6 +62,45 @@ IDI_CMDER ICON "..\\..\\icons\\cmder.ico" #endif // English (United States) resources ///////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION CMDER_MAJOR_VERSION,CMDER_MINOR_VERSION,CMDER_REVISION_VERSION + PRODUCTVERSION CMDER_MAJOR_VERSION,CMDER_MINOR_VERSION,CMDER_REVISION_VERSION + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS (CMDER_DEBUGFLAG | CMDER_BUILDFLAGS) + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "100904b0" + BEGIN + VALUE "CompanyName", CMDER_COMPANY_NAME_STR "\0" + VALUE "FileDescription", CMDER_FILE_DESCRIPTION_STR "\0" + VALUE "FileVersion", CMDER_VERSION_STR "\0" + VALUE "InternalName", CMDER_INTERNAL_NAME_STR "\0" + VALUE "LegalCopyright", "Copyright (C) " CMDER_COPYRIGHT_YEAR_STR " " CMDER_COMPANY_NAME_STR "\0" + VALUE "OriginalFilename", CMDER_ORIGINAL_FILENAME_STR "\0" + VALUE "ProductName", CMDER_PRODUCT_NAME_STR "\0" + VALUE "ProductVersion", CMDER_VERSION_STR "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x1009, 1200 + END +END + +///////////////////////////////////////////////////////////////////////////// + +// Manifest +1 24 DISCARDABLE "Cmder.manifest" + #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // From dc9e385365bf60a80de3742f1fd022ac7529c1a9 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Wed, 28 Mar 2018 18:43:41 +0430 Subject: [PATCH 03/62] add cmder manifest file --- launcher/src/Cmder.manifest | 54 +++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 launcher/src/Cmder.manifest diff --git a/launcher/src/Cmder.manifest b/launcher/src/Cmder.manifest new file mode 100644 index 0000000..3352a4b --- /dev/null +++ b/launcher/src/Cmder.manifest @@ -0,0 +1,54 @@ + + + + + + Cmder Console Emulator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true/pm + + + + From 96736feecc288e577dc4d101bc0d41f0b4c1106f Mon Sep 17 00:00:00 2001 From: David Refoua Date: Wed, 28 Mar 2018 20:38:12 +0430 Subject: [PATCH 04/62] added version.rc2.sample this file controls how the version strings appears in the final compiled .exe file --- launcher/src/version.rc2.sample | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 launcher/src/version.rc2.sample diff --git a/launcher/src/version.rc2.sample b/launcher/src/version.rc2.sample new file mode 100644 index 0000000..cc6637d --- /dev/null +++ b/launcher/src/version.rc2.sample @@ -0,0 +1,22 @@ + +/** + * WARNING: do NOT modify this file! the content of this file should be + * automatically genereted before AppVeyor builds using the + * respective .ps1 Powershell scripts. + * + */ + +///////////////////////////////////////////////////////////////////////////// +// Define the version numbers and build information manually here: + +#define CMDER_MAJOR_VERSION {Cmder-Major-Version} +#define CMDER_MINOR_VERSION {Cmder-Minor-Version} +#define CMDER_REVISION_VERSION {Cmder-Revision-Version} + +#define CMDER_PRODUCT_NAME_STR "Cmder" +#define CMDER_FILE_DESCRIPTION_STR "Cmder: Lovely Console Emulator." +#define CMDER_INTERNAL_NAME_STR "Cmder" +#define CMDER_ORIGINAL_FILENAME_STR "Cmder.exe" +#define CMDER_COMPANY_NAME_STR "Samuel Vasko" +#define CMDER_COPYRIGHT_YEAR_STR "2016" +///////////////////////////////////////////////////////////////////////////// From f4321bbc33026e80df4228efce8ab4b8a66c3e89 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Wed, 28 Mar 2018 20:41:18 +0430 Subject: [PATCH 05/62] add functions to get version and generate rc these functions can be used to a) extract the version from `CHANGELOG.md` and b) create a .rc2 file from the `sample` template by replacing its content --- scripts/utils.ps1 | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/scripts/utils.ps1 b/scripts/utils.ps1 index e3a47fc..7474a58 100644 --- a/scripts/utils.ps1 +++ b/scripts/utils.ps1 @@ -62,6 +62,43 @@ function Digest-Hash($path) { return Invoke-Expression "md5sum $path" } +function Get-Version-Str($file) { + + # Define the regular expression to match the version string from changelog + [regex]$regex = '^## \[(?[\w\-\.]+)\]\([^\n()]+\)\s+\([^\n()]+\)$'; + + # Find the first match of the version string which means the latest version + $version = Select-String -Path $file -Pattern $regex | Select-Object -First 1 | % { $_.Matches.Groups[1].Value } + + return $version +} + +function Create-RC($version, $path) { + + if ( !(Test-Path "$path.sample") ) { + Write-Error "Invalid path provided for resources file." + return + } + + $resource = Get-Content -Path "$path.sample" + $pattern = @( "Cmder-Major-Version", "Cmder-Minor-Version", "Cmder-Revision-Version" ) + $index = 0 + + # Replace all non-numeric characters to dots and split to array + $version = $version -replace '[^0-9]+','.' -split '\.' + + foreach ($fragment in $version) { + if ( !$fragment ) { break } + elseif ($index -lt $pattern.length) { + $resource = $resource.Replace( "{" + $pattern[$index++] + "}", $fragment ) + } + } + + # Write the results + Set-Content -Path $path -Value $resource + +} + function Register-Cmder() { [CmdletBinding()] Param From eaf7048ed7ccc2dc3d25047679241ec095a1100f Mon Sep 17 00:00:00 2001 From: David Refoua Date: Wed, 28 Mar 2018 20:48:57 +0430 Subject: [PATCH 06/62] add automatic version creation with this commit, the build script extracts the latest version string found in `CHANGELOG.md`, and then creates appropriate resource files for the executable compilation --- scripts/build.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 62eb4e5..7a0cb07 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -64,6 +64,9 @@ $ErrorActionPreference = "Stop" Push-Location -Path $saveTo $sources = Get-Content $sourcesPath | Out-String | Convertfrom-Json +# Get the version string +$Version = Get-Version-Str ($PSScriptRoot + '\..\' + 'CHANGELOG.md') + # Check for requirements Ensure-Exists $sourcesPath Ensure-Executable "7z" @@ -116,6 +119,7 @@ Pop-Location if($Compile) { Push-Location -Path $launcher + Create-RC $Version ($launcher + '\src\version.rc2'); msbuild CmderLauncher.vcxproj /p:configuration=Release if ($LastExitCode -ne 0) { throw "msbuild failed to build the executable." From 249f7b9baf816945d0c3f0bb2133ee5293a2c975 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Wed, 28 Mar 2018 21:07:14 +0430 Subject: [PATCH 07/62] add build flags; use spaces --- launcher/src/version.rc2.sample | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/launcher/src/version.rc2.sample b/launcher/src/version.rc2.sample index cc6637d..4d32c9b 100644 --- a/launcher/src/version.rc2.sample +++ b/launcher/src/version.rc2.sample @@ -9,14 +9,17 @@ ///////////////////////////////////////////////////////////////////////////// // Define the version numbers and build information manually here: -#define CMDER_MAJOR_VERSION {Cmder-Major-Version} -#define CMDER_MINOR_VERSION {Cmder-Minor-Version} -#define CMDER_REVISION_VERSION {Cmder-Revision-Version} +#define CMDER_MAJOR_VERSION {Cmder-Major-Version} +#define CMDER_MINOR_VERSION {Cmder-Minor-Version} +#define CMDER_REVISION_VERSION {Cmder-Revision-Version} -#define CMDER_PRODUCT_NAME_STR "Cmder" -#define CMDER_FILE_DESCRIPTION_STR "Cmder: Lovely Console Emulator." -#define CMDER_INTERNAL_NAME_STR "Cmder" -#define CMDER_ORIGINAL_FILENAME_STR "Cmder.exe" -#define CMDER_COMPANY_NAME_STR "Samuel Vasko" -#define CMDER_COPYRIGHT_YEAR_STR "2016" +#define CMDER_PRODUCT_NAME_STR "Cmder" +#define CMDER_FILE_DESCRIPTION_STR "Cmder: Lovely Console Emulator." +#define CMDER_INTERNAL_NAME_STR "Cmder" +#define CMDER_ORIGINAL_FILENAME_STR "Cmder.exe" +#define CMDER_COMPANY_NAME_STR "Samuel Vasko" +#define CMDER_COPYRIGHT_YEAR_STR "2016" + +#define CMDER_DEBUGFLAG 0x0L // set to 0x1L to enable debug mode +#define CMDER_BUILDFLAGS 0x0L ///////////////////////////////////////////////////////////////////////////// From f8359fc3f78dc6221ae0122f3b6aa740dc282208 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Wed, 28 Mar 2018 21:11:31 +0430 Subject: [PATCH 08/62] add verbose version info --- scripts/build.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 7a0cb07..47f8626 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -124,6 +124,7 @@ if($Compile) { if ($LastExitCode -ne 0) { throw "msbuild failed to build the executable." } + else Write-Verbose "successfully built Cmder $Version!" Pop-Location } else { Write-Warning "You are not building a launcher, Use -Compile" From 018bf45df462f4ecc2d68309d5e3425acb3abd78 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Wed, 28 Mar 2018 21:13:55 +0430 Subject: [PATCH 09/62] add version string handler --- scripts/utils.ps1 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/utils.ps1 b/scripts/utils.ps1 index 7474a58..5cc6035 100644 --- a/scripts/utils.ps1 +++ b/scripts/utils.ps1 @@ -75,9 +75,10 @@ function Get-Version-Str($file) { function Create-RC($version, $path) { + $string = $version + if ( !(Test-Path "$path.sample") ) { - Write-Error "Invalid path provided for resources file." - return + throw "Invalid path provided for resources file." } $resource = Get-Content -Path "$path.sample" @@ -93,6 +94,9 @@ function Create-RC($version, $path) { $resource = $resource.Replace( "{" + $pattern[$index++] + "}", $fragment ) } } + + # Add the version string + $resource = $resource.Replace( "{Cmder-Version-Str}", $string ) # Write the results Set-Content -Path $path -Value $resource From 57a28f118d0bdb197d9272d8f723252039d26d93 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Wed, 28 Mar 2018 21:14:15 +0430 Subject: [PATCH 10/62] add template for version string --- launcher/src/version.rc2.sample | 1 + 1 file changed, 1 insertion(+) diff --git a/launcher/src/version.rc2.sample b/launcher/src/version.rc2.sample index 4d32c9b..e8eeefd 100644 --- a/launcher/src/version.rc2.sample +++ b/launcher/src/version.rc2.sample @@ -12,6 +12,7 @@ #define CMDER_MAJOR_VERSION {Cmder-Major-Version} #define CMDER_MINOR_VERSION {Cmder-Minor-Version} #define CMDER_REVISION_VERSION {Cmder-Revision-Version} +#define CMDER_VERSION_STR {Cmder-Version-Str} #define CMDER_PRODUCT_NAME_STR "Cmder" #define CMDER_FILE_DESCRIPTION_STR "Cmder: Lovely Console Emulator." From 3aeca3c97217cce5ce1657ba21ae8449dd0ed39e Mon Sep 17 00:00:00 2001 From: David Refoua Date: Wed, 28 Mar 2018 21:16:27 +0430 Subject: [PATCH 11/62] add required block to else statement --- scripts/build.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 47f8626..1c32bb0 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -124,7 +124,9 @@ if($Compile) { if ($LastExitCode -ne 0) { throw "msbuild failed to build the executable." } - else Write-Verbose "successfully built Cmder $Version!" + else { + Write-Verbose "successfully built Cmder $Version!" + } Pop-Location } else { Write-Warning "You are not building a launcher, Use -Compile" From ae473ecea699e11a690d799390c49c69e13ebea0 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Wed, 28 Mar 2018 21:24:02 +0430 Subject: [PATCH 12/62] add escaped quotes handling --- scripts/utils.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/utils.ps1 b/scripts/utils.ps1 index 5cc6035..c1d2400 100644 --- a/scripts/utils.ps1 +++ b/scripts/utils.ps1 @@ -91,7 +91,7 @@ function Create-RC($version, $path) { foreach ($fragment in $version) { if ( !$fragment ) { break } elseif ($index -lt $pattern.length) { - $resource = $resource.Replace( "{" + $pattern[$index++] + "}", $fragment ) + $resource = $resource.Replace( "{" + $pattern[$index++] + "}", '"' + $fragment + '"' ) } } From 2bc17c4ff2b13eb48e3184f7b8b2ef264b2a2cb2 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Wed, 28 Mar 2018 22:22:56 +0430 Subject: [PATCH 13/62] renamed app.manifest --- launcher/src/{Cmder.manifest => app.manifest} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename launcher/src/{Cmder.manifest => app.manifest} (100%) diff --git a/launcher/src/Cmder.manifest b/launcher/src/app.manifest similarity index 100% rename from launcher/src/Cmder.manifest rename to launcher/src/app.manifest From 1dadade661d72b2438dfbe1d9cb225d654878a12 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Wed, 28 Mar 2018 22:24:26 +0430 Subject: [PATCH 14/62] replaces spaces to tabs --- launcher/src/app.manifest | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/launcher/src/app.manifest b/launcher/src/app.manifest index 3352a4b..bf133f7 100644 --- a/launcher/src/app.manifest +++ b/launcher/src/app.manifest @@ -2,33 +2,33 @@ - + Cmder Console Emulator - - + + - - + + + level="asInvoker" + uiAccess="false" /> - - + + @@ -43,12 +43,12 @@ - - + + true/pm - + From cb4d95e7a3d59d515ec913d221fc23667208a3cd Mon Sep 17 00:00:00 2001 From: David Refoua Date: Wed, 28 Mar 2018 22:26:17 +0430 Subject: [PATCH 15/62] added build number, removed duplicated manifest --- launcher/src/Resource.rc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/launcher/src/Resource.rc b/launcher/src/Resource.rc index ccbdeab..fa9a64f 100644 --- a/launcher/src/Resource.rc +++ b/launcher/src/Resource.rc @@ -68,8 +68,8 @@ IDI_CMDER ICON "..\\..\\icons\\cmder.ico" // VS_VERSION_INFO VERSIONINFO - FILEVERSION CMDER_MAJOR_VERSION,CMDER_MINOR_VERSION,CMDER_REVISION_VERSION - PRODUCTVERSION CMDER_MAJOR_VERSION,CMDER_MINOR_VERSION,CMDER_REVISION_VERSION + FILEVERSION CMDER_MAJOR_VERSION,CMDER_MINOR_VERSION,CMDER_REVISION_VERSION,CMDER_BUILD_VERSION + PRODUCTVERSION CMDER_MAJOR_VERSION,CMDER_MINOR_VERSION,CMDER_REVISION_VERSION,CMDER_BUILD_VERSION FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS (CMDER_DEBUGFLAG | CMDER_BUILDFLAGS) FILEOS VOS_NT_WINDOWS32 @@ -98,9 +98,6 @@ END ///////////////////////////////////////////////////////////////////////////// -// Manifest -1 24 DISCARDABLE "Cmder.manifest" - #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // From 2f3f1d474a3d11a83ece1f78fc8164bde70d8bfa Mon Sep 17 00:00:00 2001 From: David Refoua Date: Wed, 28 Mar 2018 22:28:01 +0430 Subject: [PATCH 16/62] specified custom manifest file --- launcher/CmderLauncher.vcxproj | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/launcher/CmderLauncher.vcxproj b/launcher/CmderLauncher.vcxproj index 879bb5a..08deaeb 100644 --- a/launcher/CmderLauncher.vcxproj +++ b/launcher/CmderLauncher.vcxproj @@ -1,4 +1,4 @@ - + @@ -61,6 +61,9 @@ Windows true + + src/app.manifest %(AdditionalManifestFiles) + _USING_V110_SDK71_;%(PreprocessorDefinitions) @@ -84,6 +87,9 @@ true true + + src/app.manifest %(AdditionalManifestFiles) + copy $(TargetPath) $(SolutionDir)..\$(TargetFileName) From 236aefe8c6b9bd09ecac17ed6baa825fd25c5a2d Mon Sep 17 00:00:00 2001 From: David Refoua Date: Wed, 28 Mar 2018 22:28:33 +0430 Subject: [PATCH 17/62] add build version string --- launcher/src/version.rc2.sample | 1 + 1 file changed, 1 insertion(+) diff --git a/launcher/src/version.rc2.sample b/launcher/src/version.rc2.sample index e8eeefd..003621d 100644 --- a/launcher/src/version.rc2.sample +++ b/launcher/src/version.rc2.sample @@ -12,6 +12,7 @@ #define CMDER_MAJOR_VERSION {Cmder-Major-Version} #define CMDER_MINOR_VERSION {Cmder-Minor-Version} #define CMDER_REVISION_VERSION {Cmder-Revision-Version} +#define CMDER_BUILD_VERSION {Cmder-Build-Version} #define CMDER_VERSION_STR {Cmder-Version-Str} #define CMDER_PRODUCT_NAME_STR "Cmder" From c817df2032db7813a966627ab728710b563ed0b3 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Wed, 28 Mar 2018 22:30:09 +0430 Subject: [PATCH 18/62] add build version str; fix padding --- scripts/utils.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/utils.ps1 b/scripts/utils.ps1 index c1d2400..e98e83e 100644 --- a/scripts/utils.ps1 +++ b/scripts/utils.ps1 @@ -73,16 +73,16 @@ function Get-Version-Str($file) { return $version } -function Create-RC($version, $path) { +function Create-RC($string, $path) { - $string = $version + $version = $string + '.0.0.0.0' # padding for version string if ( !(Test-Path "$path.sample") ) { throw "Invalid path provided for resources file." } $resource = Get-Content -Path "$path.sample" - $pattern = @( "Cmder-Major-Version", "Cmder-Minor-Version", "Cmder-Revision-Version" ) + $pattern = @( "Cmder-Major-Version", "Cmder-Minor-Version", "Cmder-Revision-Version", "Cmder-Build-Version" ) $index = 0 # Replace all non-numeric characters to dots and split to array @@ -90,13 +90,13 @@ function Create-RC($version, $path) { foreach ($fragment in $version) { if ( !$fragment ) { break } - elseif ($index -lt $pattern.length) { - $resource = $resource.Replace( "{" + $pattern[$index++] + "}", '"' + $fragment + '"' ) + elseif ($index -le $pattern.length) { + $resource = $resource.Replace( "{" + $pattern[$index++] + "}", $fragment ) } } # Add the version string - $resource = $resource.Replace( "{Cmder-Version-Str}", $string ) + $resource = $resource.Replace( "{Cmder-Version-Str}", '"' + $string + '"' ) # Write the results Set-Content -Path $path -Value $resource From 624deec2f0f76c96301580b535c58ef949466cb6 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Wed, 28 Mar 2018 22:34:28 +0430 Subject: [PATCH 19/62] =?UTF-8?q?minor=20edit=20=E2=80=93=20added=20a=20ch?= =?UTF-8?q?aracter=20to=20the=20verbose=20output?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 1c32bb0..d4c201c 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -125,7 +125,7 @@ if($Compile) { throw "msbuild failed to build the executable." } else { - Write-Verbose "successfully built Cmder $Version!" + Write-Verbose "successfully built Cmder v$Version!" } Pop-Location } else { From 93d2c427ad4cda8ded2c0895b36bd8e32e3b0154 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Thu, 29 Mar 2018 01:18:57 +0430 Subject: [PATCH 20/62] respect powershell naming convention --- scripts/build.ps1 | 2 +- scripts/utils.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index d4c201c..099f857 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -65,7 +65,7 @@ Push-Location -Path $saveTo $sources = Get-Content $sourcesPath | Out-String | Convertfrom-Json # Get the version string -$Version = Get-Version-Str ($PSScriptRoot + '\..\' + 'CHANGELOG.md') +$Version = Get-VersionStr ($PSScriptRoot + '\..\' + 'CHANGELOG.md') # Check for requirements Ensure-Exists $sourcesPath diff --git a/scripts/utils.ps1 b/scripts/utils.ps1 index e98e83e..fc43d0e 100644 --- a/scripts/utils.ps1 +++ b/scripts/utils.ps1 @@ -62,7 +62,7 @@ function Digest-Hash($path) { return Invoke-Expression "md5sum $path" } -function Get-Version-Str($file) { +function Get-VersionStr($file) { # Define the regular expression to match the version string from changelog [regex]$regex = '^## \[(?[\w\-\.]+)\]\([^\n()]+\)\s+\([^\n()]+\)$'; From 3965852c262c8dd9e7f790fedad9229089884706 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Thu, 29 Mar 2018 03:23:18 +0430 Subject: [PATCH 21/62] clean before build --- scripts/build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 099f857..aa6eacd 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -120,7 +120,7 @@ Pop-Location if($Compile) { Push-Location -Path $launcher Create-RC $Version ($launcher + '\src\version.rc2'); - msbuild CmderLauncher.vcxproj /p:configuration=Release + msbuild CmderLauncher.vcxproj /t:Clean,Build /p:configuration=Release if ($LastExitCode -ne 0) { throw "msbuild failed to build the executable." } From b36b8a4cb379efc7d093f11ba0816978b5c145a3 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Fri, 30 Mar 2018 23:23:44 +0430 Subject: [PATCH 22/62] new version handle logic --- scripts/build.ps1 | 8 ++++---- scripts/pack.ps1 | 2 +- scripts/utils.ps1 | 42 ++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 45 insertions(+), 7 deletions(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index aa6eacd..a3b9580 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -58,14 +58,14 @@ $ScriptRoot = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition $cmder_root = $ScriptRoot.replace("\scripts","") # Dot source util functions into this scope -. ".\utils.ps1" +. "$PSScriptRoot\utils.ps1" $ErrorActionPreference = "Stop" Push-Location -Path $saveTo $sources = Get-Content $sourcesPath | Out-String | Convertfrom-Json # Get the version string -$Version = Get-VersionStr ($PSScriptRoot + '\..\' + 'CHANGELOG.md') +$version = Get-VersionStr # Check for requirements Ensure-Exists $sourcesPath @@ -119,13 +119,13 @@ Pop-Location if($Compile) { Push-Location -Path $launcher - Create-RC $Version ($launcher + '\src\version.rc2'); + Create-RC $version ($launcher + '\src\version.rc2'); msbuild CmderLauncher.vcxproj /t:Clean,Build /p:configuration=Release if ($LastExitCode -ne 0) { throw "msbuild failed to build the executable." } else { - Write-Verbose "successfully built Cmder v$Version!" + Write-Verbose "successfully built Cmder v$version!" } Pop-Location } else { diff --git a/scripts/pack.ps1 b/scripts/pack.ps1 index 1b76a67..8382d5f 100644 --- a/scripts/pack.ps1 +++ b/scripts/pack.ps1 @@ -48,7 +48,7 @@ $targets = @{ Delete-Existing "..\Version*" Delete-Existing "..\build\*" -$version = Invoke-Expression "git describe --abbrev=0 --tags" +$version = Get-VersionStr (New-Item -ItemType file "$cmderRoot\Version $version") | Out-Null foreach ($t in $targets.GetEnumerator()) { diff --git a/scripts/utils.ps1 b/scripts/utils.ps1 index fc43d0e..ab7fec5 100644 --- a/scripts/utils.ps1 +++ b/scripts/utils.ps1 @@ -62,7 +62,45 @@ function Digest-Hash($path) { return Invoke-Expression "md5sum $path" } -function Get-VersionStr($file) { +function Get-VersionStr() { + + # Clear existing variable + Clear-Variable -name string + + # Determine if git is available + if (Get-Command "git.exe" -ErrorAction SilentlyContinue) + { + + # Determine if the current diesctory is a git repository + $GitPresent = Invoke-Expression "git rev-parse --is-inside-work-tree" -erroraction SilentlyContinue 2>$null + + if ( $GitPresent -eq 'true' ) + { + $string = Invoke-Expression "git describe --abbrev=0 --tags" + } + + } + + # Fallback used when Git is not available + if ( -not($string) ) + { + $string = Parse-Changelog ($PSScriptRoot + '\..\' + 'CHANGELOG.md') + } + + # Add build number, if AppVeyor is present + if ( $Env:APPVEYOR -eq 'True' ) + { + $string = $string + '.' + $Env:APPVEYOR_BUILD_NUMBER + } + + # Remove starting 'v' characters + $string = $string -replace '^v+','' # normalize version string + + return $string + +} + +function Parse-Changelog($file) { # Define the regular expression to match the version string from changelog [regex]$regex = '^## \[(?[\w\-\.]+)\]\([^\n()]+\)\s+\([^\n()]+\)$'; @@ -75,7 +113,7 @@ function Get-VersionStr($file) { function Create-RC($string, $path) { - $version = $string + '.0.0.0.0' # padding for version string + $version = $string + '.0.0.0.0' # padding for version string if ( !(Test-Path "$path.sample") ) { throw "Invalid path provided for resources file." From 502129d4f943d92e93465209038b486d83671a7d Mon Sep 17 00:00:00 2001 From: David Refoua Date: Fri, 30 Mar 2018 23:31:51 +0430 Subject: [PATCH 23/62] minor fix --- scripts/utils.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/utils.ps1 b/scripts/utils.ps1 index ab7fec5..c5a62cd 100644 --- a/scripts/utils.ps1 +++ b/scripts/utils.ps1 @@ -65,7 +65,7 @@ function Digest-Hash($path) { function Get-VersionStr() { # Clear existing variable - Clear-Variable -name string + if ($string) { Clear-Variable -name string } # Determine if git is available if (Get-Command "git.exe" -ErrorAction SilentlyContinue) From 5c3f46fd885ca5a2ac53f22521c7de9aa0baaf85 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Fri, 30 Mar 2018 23:46:48 +0430 Subject: [PATCH 24/62] fix git detection statement --- scripts/utils.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/utils.ps1 b/scripts/utils.ps1 index c5a62cd..a01f7dd 100644 --- a/scripts/utils.ps1 +++ b/scripts/utils.ps1 @@ -72,7 +72,7 @@ function Get-VersionStr() { { # Determine if the current diesctory is a git repository - $GitPresent = Invoke-Expression "git rev-parse --is-inside-work-tree" -erroraction SilentlyContinue 2>$null + $GitPresent = Invoke-Expression "git rev-parse --is-inside-work-tree" -erroraction SilentlyContinue if ( $GitPresent -eq 'true' ) { From 7d04ded1c278e3bbafc24d650b92940728a4b375 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Fri, 30 Mar 2018 23:52:32 +0430 Subject: [PATCH 25/62] add appveyor message --- scripts/build.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index a3b9580..07409a5 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -126,6 +126,9 @@ if($Compile) { } else { Write-Verbose "successfully built Cmder v$version!" + if ( $Env:APPVEYOR -eq 'True' ) { + Add-AppveyorMessage -Message "Building Cmder v$version was successfull." -Category Information + } } Pop-Location } else { From d6569192fc91167f555c3eff58402ff01f1197ea Mon Sep 17 00:00:00 2001 From: David Refoua Date: Fri, 30 Mar 2018 23:57:21 +0430 Subject: [PATCH 26/62] replace tabs to spaces --- scripts/utils.ps1 | 48 +++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/scripts/utils.ps1 b/scripts/utils.ps1 index a01f7dd..08d40d0 100644 --- a/scripts/utils.ps1 +++ b/scripts/utils.ps1 @@ -102,42 +102,42 @@ function Get-VersionStr() { function Parse-Changelog($file) { - # Define the regular expression to match the version string from changelog - [regex]$regex = '^## \[(?[\w\-\.]+)\]\([^\n()]+\)\s+\([^\n()]+\)$'; + # Define the regular expression to match the version string from changelog + [regex]$regex = '^## \[(?[\w\-\.]+)\]\([^\n()]+\)\s+\([^\n()]+\)$'; - # Find the first match of the version string which means the latest version - $version = Select-String -Path $file -Pattern $regex | Select-Object -First 1 | % { $_.Matches.Groups[1].Value } + # Find the first match of the version string which means the latest version + $version = Select-String -Path $file -Pattern $regex | Select-Object -First 1 | % { $_.Matches.Groups[1].Value } - return $version + return $version } function Create-RC($string, $path) { $version = $string + '.0.0.0.0' # padding for version string - if ( !(Test-Path "$path.sample") ) { - throw "Invalid path provided for resources file." - } + if ( !(Test-Path "$path.sample") ) { + throw "Invalid path provided for resources file." + } - $resource = Get-Content -Path "$path.sample" - $pattern = @( "Cmder-Major-Version", "Cmder-Minor-Version", "Cmder-Revision-Version", "Cmder-Build-Version" ) - $index = 0 + $resource = Get-Content -Path "$path.sample" + $pattern = @( "Cmder-Major-Version", "Cmder-Minor-Version", "Cmder-Revision-Version", "Cmder-Build-Version" ) + $index = 0 - # Replace all non-numeric characters to dots and split to array - $version = $version -replace '[^0-9]+','.' -split '\.' + # Replace all non-numeric characters to dots and split to array + $version = $version -replace '[^0-9]+','.' -split '\.' - foreach ($fragment in $version) { - if ( !$fragment ) { break } - elseif ($index -le $pattern.length) { - $resource = $resource.Replace( "{" + $pattern[$index++] + "}", $fragment ) - } - } - - # Add the version string - $resource = $resource.Replace( "{Cmder-Version-Str}", '"' + $string + '"' ) + foreach ($fragment in $version) { + if ( !$fragment ) { break } + elseif ($index -le $pattern.length) { + $resource = $resource.Replace( "{" + $pattern[$index++] + "}", $fragment ) + } + } + + # Add the version string + $resource = $resource.Replace( "{Cmder-Version-Str}", '"' + $string + '"' ) - # Write the results - Set-Content -Path $path -Value $resource + # Write the results + Set-Content -Path $path -Value $resource } From 94e7c24b72818c02d15c542f35b98f0d00041b01 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Sat, 31 Mar 2018 00:03:39 +0430 Subject: [PATCH 27/62] minor typo fix --- scripts/build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 07409a5..7a78a85 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -127,7 +127,7 @@ if($Compile) { else { Write-Verbose "successfully built Cmder v$version!" if ( $Env:APPVEYOR -eq 'True' ) { - Add-AppveyorMessage -Message "Building Cmder v$version was successfull." -Category Information + Add-AppveyorMessage -Message "Building Cmder v$version was successful." -Category Information } } Pop-Location From 65bf25f1d0acc3254f16f80e038a1f2acc2aaa1f Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Tue, 3 Apr 2018 13:20:49 -0400 Subject: [PATCH 28/62] fix bash and powershell init scripts --- vendor/cmder.sh | 20 ++++++++++---------- vendor/init.bat | 45 +++++++++++++++++++++++---------------------- vendor/profile.ps1 | 2 +- 3 files changed, 34 insertions(+), 33 deletions(-) diff --git a/vendor/cmder.sh b/vendor/cmder.sh index fc4d009..a89164f 100644 --- a/vendor/cmder.sh +++ b/vendor/cmder.sh @@ -14,7 +14,7 @@ function runProfiled { if [ ! "x${profile_d_scripts}" = "x" ] ; then for x in ${profile_d_scripts} ; do - echo Sourcing "${1}/${x}"... + # echo Sourcing "${1}/${x}"... . "${1}/${x}" done fi @@ -63,21 +63,21 @@ if [ -d "${CMDER_USER_CONFIG}/profile.d" ] ; then runProfiled "${CMDER_USER_CONFIG}/profile.d" fi +initialConfig="${CMDER_ROOT}/config/user-profile.sh" if [ -f "${CMDER_ROOT}/config/user-profile.sh" ] ; then . "${CMDER_ROOT}/config/user-profile.sh" fi -if [ -f "${CMDER_USER_CONFIG}/user-profile.sh" ] ; then +if [ "${CMDER_USER_CONFIG}" != "" ] ; then + initialConfig="${CMDER_USER_CONFIG}/user-profile.sh" + if [ -f "${CMDER_USER_CONFIG}/user-profile.sh" ] ; then . "${CMDER_USER_CONFIG}/user-profile.sh" -else - if [ "${CMDER_USER_CONFIG}" != "" ] ; then - initialProfile="${CMDER_USER_CONFIG}/user-profile.sh" - else - initialProfile="${CMDER_ROOT}/config/user-profile.sh" - fi + fi +fi - echo Creating user startup file: "${initialProfile}" - cat <<-eof >"${initialProfile}" +if [ ! -f "${initialConfig}" ] ; then + echo Creating user startup file: "${initialConfig}" + cat <<-eof >"${initialCodfig}" # use this file to run your own startup commands for msys2 bash' # To add a new vendor to the path, do something like: diff --git a/vendor/init.bat b/vendor/init.bat index a4d9e09..0db4741 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -36,11 +36,11 @@ call "%cmder_root%\vendor\lib\lib_profile" :var_loop if "%~1" == "" ( goto :start - ) else if "%1"=="/v" ( + ) else if /i "%1"=="/v" ( set verbose-output=1 - ) else if "%1"=="/d" ( + ) else if /i "%1"=="/d" ( set debug-output=1 - ) else if "%1" == "/max_depth" ( + ) else if /i "%1" == "/max_depth" ( if "%~2" geq "1" if "%~2" leq "5" ( set "max_depth=%~2" shift @@ -48,7 +48,7 @@ call "%cmder_root%\vendor\lib\lib_profile" %lib_console% show_error "'/max_depth' requires a number between 1 and 5!" exit /b ) - ) else if "%1" == "/c" ( + ) else if /i "%1" == "/c" ( if exist "%~2" ( if not exist "%~2\bin" mkdir "%~2\bin" set "cmder_user_bin=%~2\bin" @@ -56,12 +56,12 @@ call "%cmder_root%\vendor\lib\lib_profile" set "cmder_user_config=%~2\config" shift ) - ) else if "%1" == "/user_aliases" ( + ) else if /i "%1" == "/user_aliases" ( if exist "%~2" ( set "user-aliases=%~2" shift ) - ) else if "%1" == "/git_install_root" ( + ) else if /i "%1" == "/git_install_root" ( if exist "%~2" ( set "GIT_INSTALL_ROOT=%~2" shift @@ -69,7 +69,7 @@ call "%cmder_root%\vendor\lib\lib_profile" %lib_console% show_error "The Git install root folder "%~2", you specified does not exist!" exit /b ) - ) else if "%1" == "/home" ( + ) else if /i "%1" == "/home" ( if exist "%~2" ( set "HOME=%~2" shift @@ -77,7 +77,7 @@ call "%cmder_root%\vendor\lib\lib_profile" %lib_console% show_error The home folder "%2", you specified does not exist! exit /b ) - ) else if "%1" == "/svn_ssh" ( + ) else if /i "%1" == "/svn_ssh" ( set SVN_SSH=%2 shift ) @@ -182,7 +182,7 @@ for /F "delims=" %%F in ('where git.exe 2^>nul') do ( :VENDORED_GIT if exist "%CMDER_ROOT%\vendor\git-for-windows" ( set "GIT_INSTALL_ROOT=%CMDER_ROOT%\vendor\git-for-windows" - %lib_path% enhance_path "!GIT_INSTALL_ROOT!\cmd" + %lib_path% enhance_path "!GIT_INSTALL_ROOT!\cmd" ) else ( goto :NO_GIT ) @@ -208,7 +208,7 @@ endlocal & set "PATH=%PATH%" & set "SVN_SSH=%SVN_SSH%" & set "GIT_INSTALL_ROOT=% %lib_console% debug-output init.bat "Env Var - GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%" :: Enhance Path -%lib_path% enhance_path_recursive "%CMDER_ROOT%\bin" %max_depth% +%lib_path% enhance_path_recursive "%CMDER_ROOT%\bin" %max_depth% if defined CMDER_USER_BIN ( %lib_path% enhance_path_recursive "%CMDER_USER_BIN%" %max_depth% ) @@ -287,17 +287,23 @@ if exist "%GIT_INSTALL_ROOT%\post-install.bat" ( if not defined HOME set "HOME=%USERPROFILE%" %lib_console% debug-output init.bat "Env Var - HOME=%HOME%" +set "initialConfig=%CMDER_ROOT%\config\user-profile.cmd" if exist "%CMDER_ROOT%\config\user-profile.cmd" ( REM Create this file and place your own command in there call "%CMDER_ROOT%\config\user-profile.cmd" ) -if defined CMDER_USER_CONFIG if exist "%CMDER_USER_CONFIG%\user-profile.cmd" ( - REM Create this file and place your own command in there - call "%CMDER_USER_CONFIG%\user-profile.cmd" -) else ( - echo Creating user startup file: "%CMDER_ROOT%\config\user-profile.cmd" +if defined CMDER_USER_CONFIG ( + set "initialConfig=%CMDER_USER_CONFIG%\user-profile.cmd" + if exist "%CMDER_USER_CONFIG%\user-profile.cmd" ( + REM Create this file and place your own command in there + call "%CMDER_USER_CONFIG%\user-profile.cmd" + ) +) + +if not exist "%initialConfig%" ( ( + echo Creating user startup file: "%initialConfig%" echo :: use this file to run your own startup commands echo :: use in front of the command to prevent printing the command echo. @@ -312,13 +318,8 @@ echo :: you can add your plugins to the cmder path like so echo :: set "PATH=%%CMDER_ROOT%%\vendor\whatever;%%PATH%%" echo. echo @echo off -) >"%temp%\user-profile.tmp" - - if defined CMDER_USER_CONFIG ( - copy "%temp%\user-profile.tmp" "%CMDER_USER_CONFIG%\user-profile.cmd" - ) else ( - copy "%temp%\user-profile.tmp" "%CMDER_ROOT%\config\user-profile.cmd" - ) +) >"%initialConfig%" ) +set initialConfig= exit /b diff --git a/vendor/profile.ps1 b/vendor/profile.ps1 index f8360a2..20f81c7 100644 --- a/vendor/profile.ps1 +++ b/vendor/profile.ps1 @@ -140,7 +140,7 @@ popd # Drop *.ps1 files into "$ENV:CMDER_USER_CONFIG\config\profile.d" # to source them at startup. Requires using cmder.exe /C [cmder_user_root_path] argument -if ($ENV:CMDER_USER_CONFIG -ne "" -and -not (test-path "$ENV:CMDER_USER_CONFIG\profile.d")) { +if ($ENV:CMDER_USER_CONFIG -ne "" -and (test-path "$ENV:CMDER_USER_CONFIG\profile.d")) { pushd $ENV:CMDER_USER_CONFIG\profile.d foreach ($x in Get-ChildItem *.ps1) { # write-host write-host Sourcing $x From 7294092618b62b46add33f98591565d10c2e0a50 Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Fri, 6 Apr 2018 00:00:11 +0200 Subject: [PATCH 29/62] fix a typo --- vendor/cmder.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/cmder.sh b/vendor/cmder.sh index a89164f..90bca50 100644 --- a/vendor/cmder.sh +++ b/vendor/cmder.sh @@ -4,7 +4,7 @@ # these customizations will follow Cmder if $CMDER_ROOT is copied # to another machine. # -# Add system specific users customizations to $HOME/.bashrc, these +# Add system specific users customizations to $HOME/.bashrc, these # customizations will not follow Cmder to another machine. function runProfiled { @@ -77,7 +77,7 @@ fi if [ ! -f "${initialConfig}" ] ; then echo Creating user startup file: "${initialConfig}" - cat <<-eof >"${initialCodfig}" + cat <<-eof >"${initialConfig}" # use this file to run your own startup commands for msys2 bash' # To add a new vendor to the path, do something like: From 55d9b25f57e577a834407c9e5313fc3ab0a5dfcb Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Fri, 6 Apr 2018 18:08:28 +0200 Subject: [PATCH 30/62] double quote more paths fixes #1681 --- config/ConEmu.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/ConEmu.xml b/config/ConEmu.xml index ef62ad0..0a62f5e 100644 --- a/config/ConEmu.xml +++ b/config/ConEmu.xml @@ -517,7 +517,7 @@ - + @@ -527,7 +527,7 @@ - + @@ -536,10 +536,10 @@ - + - + @@ -548,14 +548,14 @@ - + - + From 78a9711447c1d3db0168bd4a8e6161754690a084 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Thu, 12 Apr 2018 21:05:38 -0400 Subject: [PATCH 31/62] fix unreg cleanup --- launcher/src/CmderLauncher.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index 6e3c923..9481047 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -334,6 +334,7 @@ void UnregisterShellMenu(std::wstring opt, wchar_t* keyBaseName) HKEY cmderKey; FAIL_ON_ERROR(RegCreateKeyEx(root, keyBaseName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL)); FAIL_ON_ERROR(RegDeleteTree(cmderKey, NULL)); + RegDeleteKeyEx(root, keyBaseName, KEY_ALL_ACCESS, NULL); RegCloseKey(cmderKey); RegCloseKey(root); } From bc72f20a2d189e06716dd3dd6cb3f429893a22b2 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Thu, 12 Apr 2018 21:06:00 -0400 Subject: [PATCH 32/62] reposition echo --- vendor/init.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/init.bat b/vendor/init.bat index 0db4741..380100a 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -302,8 +302,8 @@ if defined CMDER_USER_CONFIG ( ) if not exist "%initialConfig%" ( - ( echo Creating user startup file: "%initialConfig%" + ( echo :: use this file to run your own startup commands echo :: use in front of the command to prevent printing the command echo. From 063f30c1936c931ea5b04013b55625a8a5242539 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Thu, 12 Apr 2018 21:32:38 -0400 Subject: [PATCH 33/62] fix git missing error on cmder mini cmd shell --- vendor/lib/lib_console.cmd | 1 - vendor/lib/lib_git.cmd | 25 +++++++++++-------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/vendor/lib/lib_console.cmd b/vendor/lib/lib_console.cmd index 38f40b4..d94561b 100644 --- a/vendor/lib/lib_console.cmd +++ b/vendor/lib/lib_console.cmd @@ -76,5 +76,4 @@ exit /b :::------------------------------------------------------------------------------- echo ERROR: %~1 - echo CMDER Shell Initialization has Failed! exit /b diff --git a/vendor/lib/lib_git.cmd b/vendor/lib/lib_git.cmd index 7ff9562..ce3d0c8 100644 --- a/vendor/lib/lib_git.cmd +++ b/vendor/lib/lib_git.cmd @@ -45,20 +45,17 @@ exit /b %lib_console% debug-output :read_version "Env Var - git_executable=%git_executable%" :: check if the executable actually exists - if not exist "%git_executable%" ( - %lib_console% show_error "%git_executable%" does not exist! - exit /b -255 - ) - - :: get the git version in the provided directory - for /F "tokens=1,2,3 usebackq" %%A in (`"%git_executable%" --version 2^>nul`) do ( - if /i "%%A %%B" == "git version" ( - set "GIT_VERSION_%~1=%%C" - %lib_console% debug-output :read_version "Env Var - GIT_VERSION_%~1=%%C" - ) else ( - %lib_console% show_error "git --version" returned an inproper version string! - pause - exit /b + if exist "%git_executable%" ( + :: get the git version in the provided directory + for /F "tokens=1,2,3 usebackq" %%A in (`"%git_executable%" --version 2^>nul`) do ( + if /i "%%A %%B" == "git version" ( + set "GIT_VERSION_%~1=%%C" + %lib_console% debug-output :read_version "Env Var - GIT_VERSION_%~1=%%C" + ) else ( + %lib_console% show_error "git --version" returned an inproper version string! + pause + exit /b + ) ) ) From b8890ed29771180e9074685ba1369c80897e54a3 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Thu, 12 Apr 2018 21:39:52 -0400 Subject: [PATCH 34/62] switch to debug output --- vendor/lib/lib_git.cmd | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/vendor/lib/lib_git.cmd b/vendor/lib/lib_git.cmd index ce3d0c8..54b4e80 100644 --- a/vendor/lib/lib_git.cmd +++ b/vendor/lib/lib_git.cmd @@ -45,17 +45,20 @@ exit /b %lib_console% debug-output :read_version "Env Var - git_executable=%git_executable%" :: check if the executable actually exists - if exist "%git_executable%" ( - :: get the git version in the provided directory - for /F "tokens=1,2,3 usebackq" %%A in (`"%git_executable%" --version 2^>nul`) do ( - if /i "%%A %%B" == "git version" ( - set "GIT_VERSION_%~1=%%C" - %lib_console% debug-output :read_version "Env Var - GIT_VERSION_%~1=%%C" - ) else ( - %lib_console% show_error "git --version" returned an inproper version string! - pause - exit /b - ) + if not exist "%git_executable%" ( + %lib_console% debug-output :reda_version "%git_executable% does not exist." + exit /b -255 + ) + + :: get the git version in the provided directory + for /F "tokens=1,2,3 usebackq" %%A in (`"%git_executable%" --version 2^>nul`) do ( + if /i "%%A %%B" == "git version" ( + set "GIT_VERSION_%~1=%%C" + %lib_console% debug-output :read_version "Env Var - GIT_VERSION_%~1=%%C" + ) else ( + %lib_console% show_error "git --version" returned an inproper version string! + pause + exit /b ) ) From 12e37610177778d6647be3985b5a95e773126a08 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Thu, 12 Apr 2018 21:41:42 -0400 Subject: [PATCH 35/62] fix tab --- launcher/src/CmderLauncher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index 9481047..f417764 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -334,7 +334,7 @@ void UnregisterShellMenu(std::wstring opt, wchar_t* keyBaseName) HKEY cmderKey; FAIL_ON_ERROR(RegCreateKeyEx(root, keyBaseName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL)); FAIL_ON_ERROR(RegDeleteTree(cmderKey, NULL)); - RegDeleteKeyEx(root, keyBaseName, KEY_ALL_ACCESS, NULL); + RegDeleteKeyEx(root, keyBaseName, KEY_ALL_ACCESS, NULL); RegCloseKey(cmderKey); RegCloseKey(root); } From 2a18ba084cdc0346bbac03736fac71bbcb0bf3df Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Thu, 12 Apr 2018 21:43:31 -0400 Subject: [PATCH 36/62] fix spelling --- vendor/lib/lib_git.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/lib/lib_git.cmd b/vendor/lib/lib_git.cmd index 54b4e80..19fb98a 100644 --- a/vendor/lib/lib_git.cmd +++ b/vendor/lib/lib_git.cmd @@ -46,7 +46,7 @@ exit /b :: check if the executable actually exists if not exist "%git_executable%" ( - %lib_console% debug-output :reda_version "%git_executable% does not exist." + %lib_console% debug-output :read_version "%git_executable% does not exist." exit /b -255 ) From 9d0729fe42998687bcf05e47a911572cf88be00f Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Fri, 13 Apr 2018 20:19:23 +0200 Subject: [PATCH 37/62] :arrow_up: ConEmu to 180411 release notes: https://conemu.github.io/en/Whats_New.html --- vendor/sources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/sources.json b/vendor/sources.json index a30657d..53026e5 100644 --- a/vendor/sources.json +++ b/vendor/sources.json @@ -11,8 +11,8 @@ }, { "name": "conemu-maximus5", - "version": "180318", - "url": "https://github.com/Maximus5/ConEmu/releases/download/v18.03.18/ConEmuPack.180318.7z" + "version": "180411", + "url": "https://github.com/Maximus5/ConEmu/releases/download/v18.04.11/ConEmuPack.180411.7z" }, { "name": "clink-completions", From b2262522c99a6b42f8a47ee0815c3e81da901930 Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Fri, 13 Apr 2018 20:20:50 +0200 Subject: [PATCH 38/62] :arrow_up: Update Git to 2.17.0 Release notes: https://github.com/git-for-windows/git/releases/tag/v2.17.0.windows.1 --- vendor/sources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/sources.json b/vendor/sources.json index 53026e5..b61b50e 100644 --- a/vendor/sources.json +++ b/vendor/sources.json @@ -1,8 +1,8 @@ [ { "name": "git-for-windows", - "version": "v2.16.3.windows.1", - "url": "https://github.com/git-for-windows/git/releases/download/v2.16.3.windows.1/PortableGit-2.16.3-64-bit.7z.exe" + "version": "v2.17.0.windows.1", + "url": "https://github.com/git-for-windows/git/releases/download/v2.17.0.windows.1/PortableGit-2.17.0-64-bit.7z.exe" }, { "name": "clink", From dc8e572ca5de24432d9000a6ad71bde41c04a51c Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Thu, 19 Apr 2018 09:07:55 +0200 Subject: [PATCH 39/62] :arrow_up: ConEmu to 180416 release notes: https://conemu.github.io/en/Whats_New.html --- vendor/sources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/sources.json b/vendor/sources.json index b61b50e..c110c89 100644 --- a/vendor/sources.json +++ b/vendor/sources.json @@ -11,8 +11,8 @@ }, { "name": "conemu-maximus5", - "version": "180411", - "url": "https://github.com/Maximus5/ConEmu/releases/download/v18.04.11/ConEmuPack.180411.7z" + "version": "180416", + "url": "https://github.com/Maximus5/ConEmu/releases/download/v18.04.16/ConEmuPack.180416.7z" }, { "name": "clink-completions", From 13ea026dc9f3525626346785b6e5e18934b6c084 Mon Sep 17 00:00:00 2001 From: Dax T Games Date: Thu, 26 Apr 2018 19:06:18 -0400 Subject: [PATCH 40/62] Fix git install root This is untested so don't merge yet. I'll test tonight. --- vendor/init.bat | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vendor/init.bat b/vendor/init.bat index 380100a..4c156ef 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -197,15 +197,15 @@ if defined GIT_INSTALL_ROOT ( ) else if exist "!GIT_INSTALL_ROOT!\mingw64" ( %lib_path% enhance_path "!GIT_INSTALL_ROOT!\mingw64" append ) - %lib_path% enhance_path "%GIT_INSTALL_ROOT%\usr\bin" append + %lib_path% enhance_path "!GIT_INSTALL_ROOT!\usr\bin" append :: define SVN_SSH so we can use git svn with ssh svn repositories if not defined SVN_SSH set "SVN_SSH=%GIT_INSTALL_ROOT:\=\\%\\bin\\ssh.exe" ) :NO_GIT -endlocal & set "PATH=%PATH%" & set "SVN_SSH=%SVN_SSH%" & set "GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%" -%lib_console% debug-output init.bat "Env Var - GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%" +endlocal & set "PATH=%PATH%" & set "SVN_SSH=%SVN_SSH%" & set "GIT_INSTALL_ROOT=!GIT_INSTALL_ROOT!" +%lib_console% debug-output init.bat "Env Var - GIT_INSTALL_ROOT=!GIT_INSTALL_ROOT!" :: Enhance Path %lib_path% enhance_path_recursive "%CMDER_ROOT%\bin" %max_depth% From a843e85c8be9ff4678d311f3f9eada4471a65b59 Mon Sep 17 00:00:00 2001 From: Dax T Games Date: Thu, 3 May 2018 18:28:14 -0400 Subject: [PATCH 41/62] Fix GitHub download failures (#1760) * Github changed to only accept TLS 1.2 connections, this fixes the resulting failures. --- scripts/utils.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/utils.ps1 b/scripts/utils.ps1 index 08d40d0..fe5aa47 100644 --- a/scripts/utils.ps1 +++ b/scripts/utils.ps1 @@ -200,6 +200,8 @@ function Download-File { $Url, $File ) + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + # I think this is the problem $File = $File -Replace "/", "\" Write-Verbose "Downloading from $Url to $File" From 36403df91ed89b1fd70151911b0dc3a58e66a164 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Fri, 4 May 2018 02:59:25 +0430 Subject: [PATCH 42/62] Updates issue template, notes on README.me and fixes line ending (#1751) * add integration notes, refined docs * change img size * verbose issue template * move docs from README to WIKI * increased politeness factor by 10% --- .github/issue_template.md | 27 +++-- README.md | 31 ++++-- launcher/src/Resource.rc | 216 +++++++++++++++++++------------------- 3 files changed, 151 insertions(+), 123 deletions(-) diff --git a/.github/issue_template.md b/.github/issue_template.md index 064a3f4..5ebdb9c 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -4,7 +4,7 @@ ------------------------------------------------------------------ Please make sure you read and follow the following instructions - before reporting bugs, and/or requesting new features. + carefully before reporting bugs, and/or requesting new features. Make sure that you have: @@ -24,17 +24,22 @@ https://github.com/Maximus5/ConEmu/issues?q=is:issue - If there isn't an existing issue, you may open a new one. + If there isn't an existing issue, you may open a new one there. (We don't resolve issues regarding ConEmu here, so please make sure you open the issue in the correct place.) + + more info: https://conemu.github.io/en/ThirdPartyProblems.html - • If you are asking for Guides on how to integrate Cmder into + • If you are asking for guides on how to integrate Cmder into your favorite IDE of choice, or how to perform an specific - task with Cmder, make sure you visit our Guides section first: - - - https://github.com/cmderdev/cmder/issues?q=label:Guide - - https://github.com/cmderdev/cmder/issues?q=label:Question + task with Cmder, make sure you visit our label section first! + You may already have an answer under the Guides or Questions section. + + For a list of labels, visit: + - https://github.com/cmderdev/cmder/labels + + (Be sure to also check “Closed” issues in the labels section!) • If the issue is regarding the other upstream technologies that Cmder uses (e.g. Clink, Git, etc), please make sure that the @@ -42,6 +47,9 @@ combination with Cmder. If the bug applies when the mentioned tools are NOT used within Cmder, there's a good chance that you should open the bug at the corresponding repo instead. + + Read more on about Cmder on ConEmu docs: + https://conemu.github.io/en/cmder.html Thank you for making sure you are opening a new valid issue! @@ -56,6 +64,9 @@ - Post a screenshot or the command the triggered the problem, if applicable. - Avoid using ambiguous phrases like: doesn't work, there'a problem, etc. Help us reproduce the issue by explaining what went wrong, and what did you expect to happen. + - Please keep the ticket language to English only here. + We can't process your issue if it's written in Russian or Chinese as we can't understand them. + - ⚠ Read the following page to avoid posting a bad issue: https://conemu.github.io/en/BadIssue.html --> ### Purpose of the issue @@ -64,4 +75,4 @@ - [ ] Question ### Description of the issue - + diff --git a/README.md b/README.md index 66f5220..2d18f18 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ Cmder is a **software package** created out of pure frustration over absence of The main advantage of Cmder is portability. It is designed to be totally self-contained with no external dependencies, which makes it great for **USB Sticks** or **cloud storage**. So you can carry your console, aliases and binaries (like wget, curl and git) with you anywhere. +The Cmder's user interface is also designed to be more eye pleasing, and you can compare the main differences between Cmder and ConEmu [here](https://conemu.github.io/en/cmder.html). + ## Installation ### Single User Portable Config @@ -79,7 +81,7 @@ In a file explorer window right click in or on a directory to see "Cmder Here" i * Ctrl + R : History search * Shift + Mouse : Select and copy text from buffer -(Some shortcuts are not yet documented, though they exist - please document them here) +_(Some shortcuts are not yet documented, though they exist - please document them here)_ ## Features @@ -88,7 +90,7 @@ You can open multiple tabs each containing one of the following shells: | Task | Shell | Description | | ---- | ----- | ----------- | -| Cmder | cmd.exe | Windows 'cmd.exe' shell enhanced with Git, Git aware prompt, Clink(GNU Readline), and Aliases. | +| Cmder | cmd.exe | Windows 'cmd.exe' shell enhanced with Git, Git aware prompt, Clink (GNU Readline), and Aliases. | | Cmder as Admin | cmd.exe | Administrative Windows 'cmd.exe' Cmder shell. | | PowerShell | powershell.exe | Windows PowerShell enhanced with Git and Git aware prompt . | | PowerShell as Admin | powershell.exe | Administrative Windows 'powershell.exe' Cmder shell. | @@ -99,9 +101,13 @@ You can open multiple tabs each containing one of the following shells: Cmder, PowerShell, and Bash tabs all run on top of the Windows Console API and work as you might expect in Cmder with access to use ConEmu's color schemes, key bindings and other settings defined in the ConEmu Settings dialog. -Mintty tabs use a program called 'mintty' as the terminal that is not based on the Windows Console API so some differences in functionality are normal, as a result mintty specific config is done via the '[%USERPROFILE%|$HOME]/.minttyrc' file. +⚠ *NOTE:* Only the full edition of Cmder comes with a pre-installed bash, using a vendored [git-for-windows](https://gitforwindows.org/) installation. The pre-configured Bash tabs may not work on Cmder mini eidition without additional configuration. -Mintty differs from the other tabs in that it supports xterm/xterm-256color TERM types, and does not work with ConEmu settings like color schemes and key bindings. For more on Mintty and its config click [here](https://github.com/mintty/mintty). +You may however, choose to use an external installation of bash, such as Microsoft's [Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10) (called WSL) or the [Cygwin](https://cygwin.com/) project which provides POSIX support on windows. + +⚠ *NOTE:* Mintty tabs use a program called 'mintty' as the terminal emulator that is not based on the Windows Console API, rather it's rendered graphically by ConEmu. Mintty differs from the other tabs in that it supports xterm/xterm-256color TERM types, and does not work with ConEmu settings like color schemes and key bindings. As such, some differences in functionality are to be expected, such as Cmder not being able to apply a system-wide configuration to it. + +As a result mintty specific config is done via the '[%USERPROFILE%|$HOME]/.minttyrc' file. You may read more about Mintty and its config file [here](https://github.com/mintty/mintty). An example of setting Cmder portable terminal colors for mintty: @@ -114,6 +120,8 @@ cd mintty-colors-solarized/ echo source \$CMDER_ROOT/vendor/mintty-colors-solarized/mintty-solarized-dark.sh>>$CMDER_ROOT/config/user-profile.sh ``` +You may find some Monokai color schemes for mintty to match Cmder [here](https://github.com/PhilipDaniels/mintty/blob/master/themes/Monokai) or [here](https://github.com/oumu/mintty-color-schemes/blob/master/base16-monokai-mod.minttyrc). + ### Changing Cmder Default 'cmd.exe' Shell Startup Behaviour Using Task Arguments 1. Press Win + Alt + T @@ -211,7 +219,9 @@ Cmder is by default shipped with a vendored Git installation. On each instance You may use your favorite version of Git by including its path in the `%PATH%` enviroment variable. Moreover, the **Mini** edition of Cmder (found on the [downloads page](https://github.com/cmderdev/cmder/releases)) excludes any vendored Git binaries. -### Using external Cygwin/Babun, MSys2, or Git for Windows SDK with Cmder. +### Using external Cygwin/Babun, MSys2, WSL, or Git for Windows SDK with Cmder. + +You may run bash (the default shell used on Linux, macOS and GNU/Hurd) externally on Cmder, using the following instructions: 1. Setup a new task by pressing 'Win +Alt + T'. 1. Click the '+' button to add a task. @@ -219,7 +229,7 @@ You may use your favorite version of Git by including its path in the `%PATH%` e 1. Provide task parameters, this is optional. 1. Add ```cmd /c "[path_to_external_env]\bin\bash --login -i" -new_console``` to the `Commands` text box. -Recommended Optional Steps: +**Recommended Optional Steps:** Copy the 'vendor/cmder_exinit' file to the Cygwin/Babun, MSys2, or Git for Windows SDK environments ```/etc/profile.d/``` folder to use portable settings in the $CMDER_ROOT/config folder. @@ -236,9 +246,16 @@ Uncomment and edit the below line in the script to use Cmder config even when la # CMDER_ROOT=${USERPROFILE}/cmder # This is not required if launched from Cmder. ``` +### Integrating Cmder with [Hyper](https://github.com/zeit/hyper), [Microsoft VS Code](https://code.visualstudio.com/), and your favorite IDEs +Cmder by default comes with a vendored ConEmu installation as the underlying terminal emulator, as stated [here](https://conemu.github.io/en/cmder.html). + +However, Cmder can in fact run in a variety of other terminal emulators, and even integrated IDEs. Assuming you have the latest version of Cmder, follow the following instructions to get Cmder working with your own terminal emulator. + +For instructions on how to integrate Cmder with your IDE, please read our [Wiki section](https://github.com/cmderdev/cmder/wiki#cmder-integration). + ## Upgrading -The process of upgrading Cmder depends on the version/build you are currently running +The process of upgrading Cmder depends on the version/build you are currently running. If you have a `[cmder_root]/config/user-conemu.xml`, you are running a newer version of Cmder, follow the below process: diff --git a/launcher/src/Resource.rc b/launcher/src/Resource.rc index fa9a64f..55e2772 100644 --- a/launcher/src/Resource.rc +++ b/launcher/src/Resource.rc @@ -1,108 +1,108 @@ -/* _ - ___ _ __ ___ __| | ___ _ __ - / __| '_ ` _ \ / _` |/ _ \ '__| -| (__| | | | | | (_| | __/ | - \___|_| |_| |_|\__,_|\___|_| -============================================================================= - The Cmder Console Emulator Project -*/ - -#include "resource.h" -#include "version.rc2" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (United States) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN -"resource.h\0" -END - -2 TEXTINCLUDE -BEGIN -"#include ""winres.h""\r\n" -"\0" -END - -3 TEXTINCLUDE -BEGIN -"\r\n" -"\0" -END - -#endif // APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_CMDER ICON "..\\..\\icons\\cmder.ico" -#endif // English (United States) resources -///////////////////////////////////////////////////////////////////////////// - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION CMDER_MAJOR_VERSION,CMDER_MINOR_VERSION,CMDER_REVISION_VERSION,CMDER_BUILD_VERSION - PRODUCTVERSION CMDER_MAJOR_VERSION,CMDER_MINOR_VERSION,CMDER_REVISION_VERSION,CMDER_BUILD_VERSION - FILEFLAGSMASK VS_FFI_FILEFLAGSMASK - FILEFLAGS (CMDER_DEBUGFLAG | CMDER_BUILDFLAGS) - FILEOS VOS_NT_WINDOWS32 - FILETYPE VFT_APP - FILESUBTYPE VFT2_UNKNOWN -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "100904b0" - BEGIN - VALUE "CompanyName", CMDER_COMPANY_NAME_STR "\0" - VALUE "FileDescription", CMDER_FILE_DESCRIPTION_STR "\0" - VALUE "FileVersion", CMDER_VERSION_STR "\0" - VALUE "InternalName", CMDER_INTERNAL_NAME_STR "\0" - VALUE "LegalCopyright", "Copyright (C) " CMDER_COPYRIGHT_YEAR_STR " " CMDER_COMPANY_NAME_STR "\0" - VALUE "OriginalFilename", CMDER_ORIGINAL_FILENAME_STR "\0" - VALUE "ProductName", CMDER_PRODUCT_NAME_STR "\0" - VALUE "ProductVersion", CMDER_VERSION_STR "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x1009, 1200 - END -END - -///////////////////////////////////////////////////////////////////////////// - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED +/* _ + ___ _ __ ___ __| | ___ _ __ + / __| '_ ` _ \ / _` |/ _ \ '__| +| (__| | | | | | (_| | __/ | + \___|_| |_| |_|\__,_|\___|_| +============================================================================= + The Cmder Console Emulator Project +*/ + +#include "resource.h" +#include "version.rc2" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN +"resource.h\0" +END + +2 TEXTINCLUDE +BEGIN +"#include ""winres.h""\r\n" +"\0" +END + +3 TEXTINCLUDE +BEGIN +"\r\n" +"\0" +END + +#endif // APSTUDIO_INVOKED + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_CMDER ICON "..\\..\\icons\\cmder.ico" +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION CMDER_MAJOR_VERSION,CMDER_MINOR_VERSION,CMDER_REVISION_VERSION,CMDER_BUILD_VERSION + PRODUCTVERSION CMDER_MAJOR_VERSION,CMDER_MINOR_VERSION,CMDER_REVISION_VERSION,CMDER_BUILD_VERSION + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK + FILEFLAGS (CMDER_DEBUGFLAG | CMDER_BUILDFLAGS) + FILEOS VOS_NT_WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "100904b0" + BEGIN + VALUE "CompanyName", CMDER_COMPANY_NAME_STR "\0" + VALUE "FileDescription", CMDER_FILE_DESCRIPTION_STR "\0" + VALUE "FileVersion", CMDER_VERSION_STR "\0" + VALUE "InternalName", CMDER_INTERNAL_NAME_STR "\0" + VALUE "LegalCopyright", "Copyright (C) " CMDER_COPYRIGHT_YEAR_STR " " CMDER_COMPANY_NAME_STR "\0" + VALUE "OriginalFilename", CMDER_ORIGINAL_FILENAME_STR "\0" + VALUE "ProductName", CMDER_PRODUCT_NAME_STR "\0" + VALUE "ProductVersion", CMDER_VERSION_STR "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x1009, 1200 + END +END + +///////////////////////////////////////////////////////////////////////////// + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED From 7d31eeaa5a04fe8b7f69c024d50d84b98a60045b Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Thu, 17 May 2018 15:49:50 +0200 Subject: [PATCH 43/62] enable unc paths by default --- config/ConEmu.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/ConEmu.xml b/config/ConEmu.xml index 0a62f5e..db45a6a 100644 --- a/config/ConEmu.xml +++ b/config/ConEmu.xml @@ -59,6 +59,7 @@ + From 83f411384cc8e48d7ca1d5a5f9d5450814615e5e Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Tue, 29 May 2018 22:37:21 +0200 Subject: [PATCH 44/62] :arrow_up: Update Git to 2.17.1 Release notes: https://github.com/git-for-windows/git/releases/tag/v2.17.1.windows.2 --- vendor/sources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/sources.json b/vendor/sources.json index c110c89..96f134a 100644 --- a/vendor/sources.json +++ b/vendor/sources.json @@ -1,8 +1,8 @@ [ { "name": "git-for-windows", - "version": "v2.17.0.windows.1", - "url": "https://github.com/git-for-windows/git/releases/download/v2.17.0.windows.1/PortableGit-2.17.0-64-bit.7z.exe" + "version": "v2.17.1.windows.2", + "url": "https://github.com/git-for-windows/git/releases/download/v2.17.1.windows.2/PortableGit-2.17.1.2-64-bit.7z.exe" }, { "name": "clink", From 44aadccbecc6903918d749c693771c211ebb8fce Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Tue, 29 May 2018 22:42:32 +0200 Subject: [PATCH 45/62] :arrow_up: ConEmu to 180528 release notes: https://conemu.github.io/en/Whats_New.html --- vendor/sources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/sources.json b/vendor/sources.json index 96f134a..437a4ee 100644 --- a/vendor/sources.json +++ b/vendor/sources.json @@ -11,8 +11,8 @@ }, { "name": "conemu-maximus5", - "version": "180416", - "url": "https://github.com/Maximus5/ConEmu/releases/download/v18.04.16/ConEmuPack.180416.7z" + "version": "180528", + "url": "https://github.com/Maximus5/ConEmu/releases/download/v18.05.28/ConEmuPack.180528.7z" }, { "name": "clink-completions", From 19d5a872249967ebd6fee33af20b6aee7cc2f14d Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sat, 26 May 2018 13:29:19 -0500 Subject: [PATCH 46/62] Fix GIT_INSTALL_ROOT again --- vendor/init.bat | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/vendor/init.bat b/vendor/init.bat index 4c156ef..1328fc7 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -129,12 +129,14 @@ if not defined TERM set TERM=cygwin :: * test if a git is in path and if yes, use that :: * last, use our vendored git :: also check that we have a recent enough version of git by examining the version string +setlocal enabledelayedexpansion if defined GIT_INSTALL_ROOT ( if exist "%GIT_INSTALL_ROOT%\cmd\git.exe" goto :FOUND_GIT) ) +%lib_console% debug-output init.bat "Looking for Git install root..." + :: get the version information for vendored git binary -setlocal enabledelayedexpansion %lib_git% read_version VENDORED "%CMDER_ROOT%\vendor\git-for-windows\cmd" %lib_git% validate_version VENDORED !GIT_VERSION_VENDORED! @@ -203,11 +205,16 @@ if defined GIT_INSTALL_ROOT ( if not defined SVN_SSH set "SVN_SSH=%GIT_INSTALL_ROOT:\=\\%\\bin\\ssh.exe" ) -:NO_GIT -endlocal & set "PATH=%PATH%" & set "SVN_SSH=%SVN_SSH%" & set "GIT_INSTALL_ROOT=!GIT_INSTALL_ROOT!" -%lib_console% debug-output init.bat "Env Var - GIT_INSTALL_ROOT=!GIT_INSTALL_ROOT!" +endlocal & set "PATH=%PATH%" & set "SVN_SSH=%SVN_SSH%" & set "GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%" +%lib_console% debug-output init.bat "Env Var - GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%" +%lib_console% debug-output init.bat "Found Git in: '%GIT_INSTALL_ROOT%'" +goto :PATH_ENHANCE -:: Enhance Path +:NO_GIT +:: Skip this if GIT WAS FOUND else we did 'endlocal' above! +endlocal + +:PATH_ENHANCE %lib_path% enhance_path_recursive "%CMDER_ROOT%\bin" %max_depth% if defined CMDER_USER_BIN ( %lib_path% enhance_path_recursive "%CMDER_USER_BIN%" %max_depth% From 40b9ca4e28d5abf32b5d01495254ef50cda3d166 Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Wed, 30 May 2018 01:17:12 +0200 Subject: [PATCH 47/62] Update CHANGELOG.md --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cb69ea..aaf7120 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Change Log +## [1.3.6](https://github.com/cmderdev/cmder/tree/v1.3.6) (2018-05-30) +**Updated components:** + +* Git updated to v2.17.1.windows.2 +* ConEmu updated to 180528 + +**Updates:** + +* Cmder now opens in the in the current working dir +* TBD + ## [1.3.6-pre2](https://github.com/cmderdev/cmder/tree/v1.3.6-pre2) (2018-03-01) **Updated components:** From 4df1d744d3cda68214b686b3c71250e63b9c90c9 Mon Sep 17 00:00:00 2001 From: Dax T Games Date: Thu, 31 May 2018 07:35:02 -0500 Subject: [PATCH 48/62] Fix lib base (#1794) * Fix GIT_INSTALL_ROOT again * fixed lib_base error * fix lib help * fix lib help --- vendor/lib/lib_base.cmd | 7 ++----- vendor/lib/lib_console.cmd | 4 ++-- vendor/lib/lib_git.cmd | 4 ++-- vendor/lib/lib_path.cmd | 4 ++-- vendor/lib/lib_profile.cmd | 4 ++-- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/vendor/lib/lib_base.cmd b/vendor/lib/lib_base.cmd index 6ab50e8..37a1072 100644 --- a/vendor/lib/lib_base.cmd +++ b/vendor/lib/lib_base.cmd @@ -3,7 +3,7 @@ set lib_base=call "%~dp0lib_base.cmd" if "%~1" == "/h" ( - %lib_base% help "%0" + %lib_base% help "%~0" ) else if "%1" neq "" ( call :%* ) @@ -16,7 +16,7 @@ exit /b :::. :::include: :::. -::: call "$0" +::: call "lib_base.cmd" :::. :::usage: :::. @@ -27,12 +27,9 @@ exit /b ::: file full path to file containing lib_routines to display :::. :::------------------------------------------------------------------------------- - for /f "tokens=* delims=:" %%a in ('type "%~1" ^| findstr /i /r "^:::"') do ( rem echo a="%%a" - if "%%a"==" " ( - echo. if "%%a"=="." ( echo. ) else if /i "%%a" == "usage" ( diff --git a/vendor/lib/lib_console.cmd b/vendor/lib/lib_console.cmd index d94561b..4de7525 100644 --- a/vendor/lib/lib_console.cmd +++ b/vendor/lib/lib_console.cmd @@ -6,7 +6,7 @@ call "%~dp0lib_base.cmd" set lib_console=call "%~dp0lib_console.cmd" if "%~1" == "/h" ( - %lib_base% help "%0" + %lib_base% help "%~0" ) else if "%1" neq "" ( call :%* ) @@ -19,7 +19,7 @@ exit /b :::. :::include: :::. -::: call "$0" +::: call "lib_console.cmd" :::. :::usage: :::. diff --git a/vendor/lib/lib_git.cmd b/vendor/lib/lib_git.cmd index 19fb98a..d703e58 100644 --- a/vendor/lib/lib_git.cmd +++ b/vendor/lib/lib_git.cmd @@ -7,7 +7,7 @@ set lib_git=call "%~dp0lib_git.cmd" if "%~1" == "/h" ( - %lib_base% help "%0" + %lib_base% help "%~0" ) else if "%1" neq "" ( call :%* ) @@ -20,7 +20,7 @@ exit /b :::. :::include: :::. -::: call "$0" +::: call "lib_git.cmd" :::. :::usage: :::. diff --git a/vendor/lib/lib_path.cmd b/vendor/lib/lib_path.cmd index 7cd08a7..1d8c9e7 100644 --- a/vendor/lib/lib_path.cmd +++ b/vendor/lib/lib_path.cmd @@ -6,7 +6,7 @@ call "%%~dp0lib_console" set lib_path=call "%~dp0lib_path.cmd" if "%~1" == "/h" ( - %lib_base% help "%0" + %lib_base% help "%~0" ) else if "%1" neq "" ( call :%* ) @@ -19,7 +19,7 @@ exit /b ::: :::include: ::: -::: call "$0" +::: call "lib_path.cmd" ::: :::usage: ::: diff --git a/vendor/lib/lib_profile.cmd b/vendor/lib/lib_profile.cmd index 77eebf8..82dbb4a 100644 --- a/vendor/lib/lib_profile.cmd +++ b/vendor/lib/lib_profile.cmd @@ -6,7 +6,7 @@ call "%%~dp0lib_console" set lib_profile=call "%~dp0lib_profile.cmd" if "%~1" == "/h" ( - %lib_base% help "%0" + %lib_base% help "%~0" ) else if "%1" neq "" ( call :%* ) @@ -19,7 +19,7 @@ exit /b ::: :::include: ::: -::: call "$0" +::: call "lib_profile.cmd" ::: :::usage: ::: From 34554d6b080e348c4fa408fc7e6def37b2dc5c4e Mon Sep 17 00:00:00 2001 From: Aaron Arney Date: Wed, 30 May 2018 20:49:12 -0400 Subject: [PATCH 49/62] Update README Add formatting to code, path, and executable identifiers to promote readability/scanability. --- README.md | 104 +++++++++++++++++++++++++++--------------------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index 2d18f18..70bd5e6 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ The Cmder's user interface is also designed to be more eye pleasing, and you can 1. Download the [latest release](https://github.com/cmderdev/cmder/releases/) 2. Extract the archive. *Note: This path should not be `C:\Program Files` or anywhere else that would require Administrator access for modifying configuration files* 3. (optional) Place your own executable files into the `%cmder_root%\bin` folder to be injected into your PATH. -4. Run Cmder.exe +4. Run `Cmder.exe` ### Shared Cmder install with Non-Portable Individual User Config 1. Download the [latest release](https://github.com/cmderdev/cmder/releases/) @@ -26,7 +26,7 @@ The Cmder's user interface is also designed to be more eye pleasing, and you can 3. (optional) Place your own executable files into the `%cmder_root%\bin` folder to be injected into your PATH. 4. (optional) Create `%userprofile%\cmder_config\bin` folder to be injected into individual users PATH. Default is to auto create this on first run. 5. (optional) Place your own executable files into the `%userprofile%\cmder_config\bin` folder to be injected into your PATH. -6. Run Cmder.exe with "/C" command line argument. Example: `cmder.exe /C %userprofile%\cmder_config` +6. Run `Cmder.exe` with `/C` command line argument. Example: `cmder.exe /C %userprofile%\cmder_config` * This will create the following directory structure if it is missing. ``` @@ -43,10 +43,10 @@ The Cmder's user interface is also designed to be more eye pleasing, and you can | Argument | Description | | ------------------- | ----------------------------------------------------------------------- | -| /C [user_root_path] | Individual user Cmder root folder. Example: %userprofile%\cmder_config | -| /SINGLE | Start Cmder is single mode. | -| /START [start_path] | Folder path to start in. | -| /TASK [task_name] | Task to start after launch. | +| `/C [user_root_path]` | Individual user Cmder root folder. Example: `%userprofile%\cmder_config` | +| `/SINGLE` | Start Cmder is single mode. | +| `/START [start_path]` | Folder path to start in. | +| `/TASK [task_name]` | Task to start after launch. | ## Context Menu Integration @@ -90,14 +90,14 @@ You can open multiple tabs each containing one of the following shells: | Task | Shell | Description | | ---- | ----- | ----------- | -| Cmder | cmd.exe | Windows 'cmd.exe' shell enhanced with Git, Git aware prompt, Clink (GNU Readline), and Aliases. | -| Cmder as Admin | cmd.exe | Administrative Windows 'cmd.exe' Cmder shell. | -| PowerShell | powershell.exe | Windows PowerShell enhanced with Git and Git aware prompt . | -| PowerShell as Admin | powershell.exe | Administrative Windows 'powershell.exe' Cmder shell. | -| Bash | bash.exe | Unix/Linux like bash shell running on Windows. | -| Bash as Admin | bash.exe | Administrative Unix/Linux like bash shell running on Windows. | -| Mintty | bash.exe | Unix/Linux like bash shell running on Windows. See below for Mintty configuration differences | -| Mintty as Admin | bash.exe | Administrative Unix/Linux like bash shell running on Windows. See below for Mintty configuration differences | +| Cmder | `cmd.exe` | Windows `cmd.exe` shell enhanced with Git, Git aware prompt, Clink (GNU Readline), and Aliases. | +| Cmder as Admin | `cmd.exe` | Administrative Windows 'cmd.exe' Cmder shell. | +| PowerShell | `powershell.exe` | Windows PowerShell enhanced with Git and Git aware prompt . | +| PowerShell as Admin | `powershell.exe` | Administrative Windows `powershell.exe` Cmder shell. | +| Bash | `bash.exe` | Unix/Linux like bash shell running on Windows. | +| Bash as Admin | `bash.exe` | Administrative Unix/Linux like bash shell running on Windows. | +| Mintty | `bash.exe` | Unix/Linux like bash shell running on Windows. See below for Mintty configuration differences | +| Mintty as Admin | `bash.exe` | Administrative Unix/Linux like bash shell running on Windows. See below for Mintty configuration differences | Cmder, PowerShell, and Bash tabs all run on top of the Windows Console API and work as you might expect in Cmder with access to use ConEmu's color schemes, key bindings and other settings defined in the ConEmu Settings dialog. @@ -107,7 +107,7 @@ You may however, choose to use an external installation of bash, such as Microso ⚠ *NOTE:* Mintty tabs use a program called 'mintty' as the terminal emulator that is not based on the Windows Console API, rather it's rendered graphically by ConEmu. Mintty differs from the other tabs in that it supports xterm/xterm-256color TERM types, and does not work with ConEmu settings like color schemes and key bindings. As such, some differences in functionality are to be expected, such as Cmder not being able to apply a system-wide configuration to it. -As a result mintty specific config is done via the '[%USERPROFILE%|$HOME]/.minttyrc' file. You may read more about Mintty and its config file [here](https://github.com/mintty/mintty). +As a result mintty specific config is done via the `[%USERPROFILE%|$HOME]/.minttyrc` file. You may read more about Mintty and its config file [here](https://github.com/mintty/mintty). An example of setting Cmder portable terminal colors for mintty: @@ -122,7 +122,7 @@ echo source \$CMDER_ROOT/vendor/mintty-colors-solarized/mintty-solarized-dark.sh You may find some Monokai color schemes for mintty to match Cmder [here](https://github.com/PhilipDaniels/mintty/blob/master/themes/Monokai) or [here](https://github.com/oumu/mintty-color-schemes/blob/master/base16-monokai-mod.minttyrc). -### Changing Cmder Default 'cmd.exe' Shell Startup Behaviour Using Task Arguments +### Changing Cmder Default `cmd.exe` Shell Startup Behaviour Using Task Arguments 1. Press Win + Alt + T 1. Click either: @@ -140,36 +140,36 @@ You may find some Monokai color schemes for mintty to match Cmder [here](https:/ | Argument | Description | Default | | ----------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------- | -| /c [user cmder root] | Enables user bin and config folders for 'Cmder as admin' sessions due to non-shared environment. | not set | -| /d | Enables debug output. | not set | -| /git_install_root [file path] | User specified Git installation root path. | '%CMDER_ROOT%\vendor\Git-for-Windows' | -| /home [home folder] | User specified folder path to set `%HOME%` environment variable. | '%userprofile%' | -| /max_depth [1-5] | Define max recurse depth when adding to the path for `%cmder_root%\bin` and `%cmder_user_bin%` | 1 | -| /svn_ssh [path to ssh.exe] | Define %SVN_SSH% so we can use git svn with ssh svn repositories. | '%GIT_INSTALL_ROOT%\bin\ssh.exe' | -| /user_aliases [file path] | File path pointing to user aliases. | '%CMDER_ROOT%\config\user-liases.cmd' | -| /v | Enables verbose output. | not set | +| `/c [user cmder root]` | Enables user bin and config folders for 'Cmder as admin' sessions due to non-shared environment. | not set | +| `/d` | Enables debug output. | not set | +| `/git_install_root [file path]` | User specified Git installation root path. | `%CMDER_ROOT%\vendor\Git-for-Windows` | +| `/home [home folder]` | User specified folder path to set `%HOME%` environment variable. | `%userprofile%` | +| `/max_depth [1-5]` | Define max recurse depth when adding to the path for `%cmder_root%\bin` and `%cmder_user_bin%` | 1 | +| `/svn_ssh [path to ssh.exe]` | Define `%SVN_SSH%` so we can use git svn with ssh svn repositories. | `%GIT_INSTALL_ROOT%\bin\ssh.exe` | +| `/user_aliases [file path]` | File path pointing to user aliases. | `%CMDER_ROOT%\config\user-liases.cmd` | +| `/v` | Enables verbose output. | not set | ### Cmder Shell User Config Single user portable configuration is possible using the cmder specific shell config files. Edit the below files to add your own configuration: | Shell | Cmder Portable User Config | | ------------- | ----------------------------------------- | -| Cmder | %CMDER_ROOT%\\config\\user-profile.cmd | -| PowerShell | $ENV:CMDER_ROOT\\config\\user-profile.ps1 | -| Bash/Mintty | $CMDER_ROOT/config/user-profile.sh | +| Cmder | `%CMDER_ROOT%\\config\\user-profile.cmd` | +| PowerShell | `$ENV:CMDER_ROOT\\config\\user-profile.ps1` | +| Bash/Mintty | `$CMDER_ROOT/config/user-profile.sh` | -Note: Bash and Mintty sessions will also source the '$HOME/.bashrc' file if it exists after it sources '$CMDER_ROOT/config/user-profile.sh'. +Note: Bash and Mintty sessions will also source the `$HOME/.bashrc` file if it exists after it sources `$CMDER_ROOT/config/user-profile.sh`. -You can write *.cmd|*.bat, *.ps1, and *.sh scripts and just drop them in the %CMDER_ROOT%\config\profile.d folder to add startup config to Cmder. +You can write `*.cmd|*.bat`, `*.ps1`, and `*.sh` scripts and just drop them in the `%CMDER_ROOT%\config\profile.d` folder to add startup config to Cmder. -| Shell | Cmder 'Profile.d' Scripts | +| Shell | Cmder `Profile.d` Scripts | | ------------- | --------------------------------------------------| -| Cmder | %CMDER_ROOT%\\config\\profile.d\\\*.bat and *.cmd | -| PowerShell | $ENV:CMDER_ROOT\\config\\profile.d\\\*.ps1 | -| Bash/Mintty | $CMDER_ROOT/config/profile.d/*.sh | +| Cmder | `%CMDER_ROOT%\\config\\profile.d\\\*.bat and *.cmd` | +| PowerShell | `$ENV:CMDER_ROOT\\config\\profile.d\\\*.ps1` | +| Bash/Mintty | `$CMDER_ROOT/config/profile.d/*.sh` | ### Aliases -#### Cmder(Cmd.exe) Aliases +#### Cmder(`Cmd.exe`) Aliases You can define simple aliases for `cmd.exe` sessions with a command like `alias name=command`. Cmd.exe aliases support optional parameters through the `$1-9` or the `$*` special characters so the alias `vi=vim.exe $*` typed as `vi [filename]` will open `[filename]` in `vim.exe`. Cmd.exe aliases can also be more complex. See: [DOSKEY.EXE documentation](http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/doskey.mspx?mfr=true) for additional details on complex aliases/macros for 'cmd.exe' @@ -178,22 +178,22 @@ Aliases defined using the `alias.bat` command will automatically be saved in the To make an alias and/or any other profile settings permanent add it to one of the following: -Note: These are loaded in this order by '$CMDER_ROOT/vendor/init.bat'. Anyhing stored in '%CMDER_ROOT%' will be a portable setting and will follow cmder to another machine. +Note: These are loaded in this order by `$CMDER_ROOT/vendor/init.bat`. Anyhing stored in `%CMDER_ROOT%` will be a portable setting and will follow cmder to another machine. -* '%CMDER_ROOT%\\config\\profile.d\\\*.cmd and \*.bat' -* '%CMDER_ROOT%\\config\\user-aliases.cmd' -* '%CMDER_ROOT%\\config\\user-profile.cmd' +* `%CMDER_ROOT%\\config\\profile.d\\\*.cmd` and `\*.bat` +* `%CMDER_ROOT%\\config\\user-aliases.cmd` +* `%CMDER_ROOT%\\config\\user-profile.cmd` #### Bash.exe|Mintty.exe Aliases Bash shells support simple and complex aliases with optional parameters natively so they work a little different. Typing `alias name=command` will create an alias only for the current running session. To make an alias and/or any other profile settings permanent add it to one of the following: -Note: These are loaded in this order by '$CMDER_ROOT/vendor/git-for-windows/etc/profile.d/cmder.sh'. Anyhing stored in '$CMDER_ROOT' will be a portable setting and will follow cmder to another machine. +Note: These are loaded in this order by `$CMDER_ROOT/vendor/git-for-windows/etc/profile.d/cmder.sh`. Anyhing stored in `$CMDER_ROOT` will be a portable setting and will follow cmder to another machine. -* '$CMDER_ROOT/config/profile.d/*.sh' -* '$CMDER_ROOT/config/user-profile.sh' -* '$HOME/.bashrc' +* `$CMDER_ROOT/config/profile.d/*.sh` +* `$CMDER_ROOT/config/user-profile.sh` +* `$HOME/.bashrc` If you add bash aliases to `$CMDER_ROOT/config/user-profile.sh` they will be portable and follow your Cmder folder if you copy it to another machine. `$HOME/.bashrc` defined aliases are not portable. @@ -202,7 +202,7 @@ PowerShell has native simple alias support, for example `[new-alias | set-alias] To make an alias and/or any other profile settings permanent add it to one of the following: -Note: These are loaded in this order by '$ENV:CMDER_ROOT\\vendor\\user-profile.ps1'. Anyhing stored in '$ENV:CMDER_ROOT' will be a portable setting and will follow cmder to another machine. +Note: These are loaded in this order by `$ENV:CMDER_ROOT\\vendor\\user-profile.ps1`. Anyhing stored in `$ENV:CMDER_ROOT` will be a portable setting and will follow cmder to another machine. * '$ENV:CMDER_ROOT\\config\\profile.d\\\*.ps1' * '$ENV:CMDER_ROOT\\config\\user-profile.ps1' @@ -223,22 +223,22 @@ You may use your favorite version of Git by including its path in the `%PATH%` e You may run bash (the default shell used on Linux, macOS and GNU/Hurd) externally on Cmder, using the following instructions: -1. Setup a new task by pressing 'Win +Alt + T'. -1. Click the '+' button to add a task. +1. Setup a new task by pressing Win +Alt + T. +1. Click the `+` button to add a task. 1. Name the new task in the top text box. 1. Provide task parameters, this is optional. -1. Add ```cmd /c "[path_to_external_env]\bin\bash --login -i" -new_console``` to the `Commands` text box. +1. Add `cmd /c "[path_to_external_env]\bin\bash --login -i" -new_console` to the `Commands` text box. **Recommended Optional Steps:** -Copy the 'vendor/cmder_exinit' file to the Cygwin/Babun, MSys2, or Git for Windows SDK environments ```/etc/profile.d/``` folder to use portable settings in the $CMDER_ROOT/config folder. +Copy the `vendor/cmder_exinit` file to the Cygwin/Babun, MSys2, or Git for Windows SDK environments `/etc/profile.d/` folder to use portable settings in the `$CMDER_ROOT/config` folder. -Note: MinGW could work if the init scripts include profile.d but this has not been tested. +Note: MinGW could work if the init scripts include `profile.d` but this has not been tested. The destination file extension depends on the shell you use in that environment. For example: -* bash - Copy to /etc/profile.d/cmder_exinit.sh -* zsh - Copy to /etc/profile.d/cmder_exinit.zsh +* bash - Copy to `/etc/profile.d/cmder_exinit.sh` +* zsh - Copy to `/etc/profile.d/cmder_exinit.zsh` Uncomment and edit the below line in the script to use Cmder config even when launched from outside Cmder. @@ -265,7 +265,7 @@ If you have a `[cmder_root]/config/user-conemu.xml`, you are running a newer ver 2. Exit all Cmder sessions and backup any files you have manually edited under `[cmder_root]/vendor`. - * Editing files under `[cmder_root]/vendor` is not recommended since you will need to re-apply these changes after any upgrade. All user customizations should go in '[cmder_root]/config' folder. + * Editing files under `[cmder_root]/vendor` is not recommended since you will need to re-apply these changes after any upgrade. All user customizations should go in `[cmder_root]/config` folder. 3. Delete the `[cmder_root]/vendor` folder. 4. Extract the new `cmder.zip` or `cmder_mini.zip` into `[cmder_root]/` overwriting all files when prompted. @@ -276,7 +276,7 @@ If you do not have a `[cmder_root]/config/user-conemu.xml`, you are running an o 2. Backup any files you have manually edited under `[cmder_root]/vendor`. - * Editing files under `[cmder_root]/vendor` is not recommended since you will need to re-apply these changes after any upgrade. All user customizations should go in '[cmder_root]/config' folder. + * Editing files under `[cmder_root]/vendor` is not recommended since you will need to re-apply these changes after any upgrade. All user customizations should go in `[cmder_root]/config` folder. 3. Delete the `[cmder_root]/vendor` folder. 4. Extract the new `cmder.zip` or `cmder_mini.zip` into `[cmder_root]/` overwriting all files when prompted. From 27f51f48a4349859a4b82470fd0bdd0d40831572 Mon Sep 17 00:00:00 2001 From: Dax T Games Date: Sat, 2 Jun 2018 17:15:33 -0500 Subject: [PATCH 50/62] Profile.ps1 (#1796) * Fix GIT_INSTALL_ROOT again * fix profile.ps1 --- vendor/profile.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vendor/profile.ps1 b/vendor/profile.ps1 index 20f81c7..b59e773 100644 --- a/vendor/profile.ps1 +++ b/vendor/profile.ps1 @@ -155,16 +155,16 @@ $CmderUserProfilePath = Join-Path $env:CMDER_ROOT "config\user-profile.ps1" if (Test-Path $CmderUserProfilePath) { # Create this file and place your own command in there. . "$CmderUserProfilePath" - } if ($ENV:CMDER_USER_CONFIG) { $CmderUserProfilePath = Join-Path $ENV:CMDER_USER_CONFIG "user-profile.ps1" + if (Test-Path $CmderUserProfilePath) { + . "$CmderUserProfilePath" + } } -if (Test-Path $CmderUserProfilePath) { - . "$CmderUserProfilePath" -} else { +if (! (Test-Path $CmderUserProfilePath) ) { # This multiline string cannot be indented, for this reason I've not indented the whole block Write-Host -BackgroundColor Darkgreen -ForegroundColor White "First Run: Creating user startup file: $CmderUserProfilePath" From 0b2d7bd6557c6517b3fd106a6f2434fdb55acff8 Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Thu, 7 Jun 2018 16:08:53 +0200 Subject: [PATCH 51/62] sanitize dir before assigning to prompt Fixes #1265 --- vendor/clink.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vendor/clink.lua b/vendor/clink.lua index 12d0616..aa357d5 100644 --- a/vendor/clink.lua +++ b/vendor/clink.lua @@ -41,6 +41,13 @@ local function set_prompt_filter() -- color codes: "\x1b[1;37;40m" local cmder_prompt = "\x1b[1;32;40m{cwd} {git}{hg}{svn} \n\x1b[1;39;40m{lamb} \x1b[0m" local lambda = "λ" + local function sanitize_dir(str) + str = string.gsub(str, "+", " ") + str = string.gsub(str, "%%(%x%x)", function(h) return string.char(tonumber(h,16)) end) + str = string.gsub(str, "\r\n", "\n") + return str + end + cmder_prompt = sanitize_dir(cmder_prompt) cmder_prompt = string.gsub(cmder_prompt, "{cwd}", cwd) if env ~= nil then lambda = "("..env..") "..lambda @@ -235,7 +242,7 @@ end -- Get the status of working dir -- @return {bool} --- -function get_svn_status() +local function get_svn_status() local file = io.popen("svn status -q") for line in file:lines() do file:close() From 6c016788d43dec13d0a342ed75503efb43859972 Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Thu, 7 Jun 2018 17:04:06 +0200 Subject: [PATCH 52/62] Revert "sanitize dir before assigning to prompt" This reverts commit 0b2d7bd6557c6517b3fd106a6f2434fdb55acff8. --- vendor/clink.lua | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/vendor/clink.lua b/vendor/clink.lua index aa357d5..12d0616 100644 --- a/vendor/clink.lua +++ b/vendor/clink.lua @@ -41,13 +41,6 @@ local function set_prompt_filter() -- color codes: "\x1b[1;37;40m" local cmder_prompt = "\x1b[1;32;40m{cwd} {git}{hg}{svn} \n\x1b[1;39;40m{lamb} \x1b[0m" local lambda = "λ" - local function sanitize_dir(str) - str = string.gsub(str, "+", " ") - str = string.gsub(str, "%%(%x%x)", function(h) return string.char(tonumber(h,16)) end) - str = string.gsub(str, "\r\n", "\n") - return str - end - cmder_prompt = sanitize_dir(cmder_prompt) cmder_prompt = string.gsub(cmder_prompt, "{cwd}", cwd) if env ~= nil then lambda = "("..env..") "..lambda @@ -242,7 +235,7 @@ end -- Get the status of working dir -- @return {bool} --- -local function get_svn_status() +function get_svn_status() local file = io.popen("svn status -q") for line in file:lines() do file:close() From e3cdf43afc88b514045e80e30689b6f35cbdc925 Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Thu, 7 Jun 2018 18:29:48 +0200 Subject: [PATCH 53/62] better fix for #1265 --- vendor/clink.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vendor/clink.lua b/vendor/clink.lua index 12d0616..5c64c03 100644 --- a/vendor/clink.lua +++ b/vendor/clink.lua @@ -41,13 +41,19 @@ local function set_prompt_filter() -- color codes: "\x1b[1;37;40m" local cmder_prompt = "\x1b[1;32;40m{cwd} {git}{hg}{svn} \n\x1b[1;39;40m{lamb} \x1b[0m" local lambda = "λ" + cwd = string.gsub(cwd, "%%", "{percent}") cmder_prompt = string.gsub(cmder_prompt, "{cwd}", cwd) + if env ~= nil then lambda = "("..env..") "..lambda end clink.prompt.value = string.gsub(cmder_prompt, "{lamb}", lambda) end +local function percent_prompt_filter() + clink.prompt.value = string.gsub(clink.prompt.value, "{percent}", "%%") +end + --- -- Resolves closest directory location for specified directory. -- Navigates subsequently up one level and tries to find specified directory @@ -235,7 +241,7 @@ end -- Get the status of working dir -- @return {bool} --- -function get_svn_status() +local function get_svn_status() local file = io.popen("svn status -q") for line in file:lines() do file:close() @@ -340,6 +346,7 @@ clink.prompt.register_filter(set_prompt_filter, 1) clink.prompt.register_filter(hg_prompt_filter, 50) clink.prompt.register_filter(git_prompt_filter, 50) clink.prompt.register_filter(svn_prompt_filter, 50) +clink.prompt.register_filter(percent_prompt_filter, 51) local completions_dir = clink.get_env('CMDER_ROOT')..'/vendor/clink-completions/' for _,lua_module in ipairs(clink.find_files(completions_dir..'*.lua')) do From 431c6300e5dc47bc66668d4e3c0edefe063f17bf Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sun, 10 Jun 2018 12:40:37 +0200 Subject: [PATCH 54/62] Fixed spelling --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 70bd5e6..bbb74f7 100644 --- a/README.md +++ b/README.md @@ -189,7 +189,7 @@ Bash shells support simple and complex aliases with optional parameters natively To make an alias and/or any other profile settings permanent add it to one of the following: -Note: These are loaded in this order by `$CMDER_ROOT/vendor/git-for-windows/etc/profile.d/cmder.sh`. Anyhing stored in `$CMDER_ROOT` will be a portable setting and will follow cmder to another machine. +Note: These are loaded in this order by `$CMDER_ROOT/vendor/git-for-windows/etc/profile.d/cmder.sh`. Anything stored in `$CMDER_ROOT` will be a portable setting and will follow cmder to another machine. * `$CMDER_ROOT/config/profile.d/*.sh` * `$CMDER_ROOT/config/user-profile.sh` From b901a4a569bbba59c977f20da9c48c543e4e40e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=BA?= Date: Thu, 23 Aug 2018 11:50:29 +0800 Subject: [PATCH 55/62] add LANG support --- vendor/init.bat | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vendor/init.bat b/vendor/init.bat index 1328fc7..4a31844 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -203,9 +203,12 @@ if defined GIT_INSTALL_ROOT ( :: define SVN_SSH so we can use git svn with ssh svn repositories if not defined SVN_SSH set "SVN_SSH=%GIT_INSTALL_ROOT:\=\\%\\bin\\ssh.exe" + for /F "delims=" %%F in ('env /usr/bin/locale -uU 2^>nul') do ( + set "LANG=%%F" + ) ) -endlocal & set "PATH=%PATH%" & set "SVN_SSH=%SVN_SSH%" & set "GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%" +endlocal & set "PATH=%PATH%" & set "LANG=%LANG%" & set "SVN_SSH=%SVN_SSH%" & set "GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%" %lib_console% debug-output init.bat "Env Var - GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%" %lib_console% debug-output init.bat "Found Git in: '%GIT_INSTALL_ROOT%'" goto :PATH_ENHANCE From 34bb62409a5b2f31c5092cdca602d892a1b40dc4 Mon Sep 17 00:00:00 2001 From: "Dmitri S. Guskov" Date: Wed, 29 Aug 2018 14:38:59 +0300 Subject: [PATCH 56/62] Update profile.ps1 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 --- vendor/profile.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vendor/profile.ps1 b/vendor/profile.ps1 index b59e773..2952618 100644 --- a/vendor/profile.ps1 +++ b/vendor/profile.ps1 @@ -134,7 +134,7 @@ if (-not (test-path "$ENV:CMDER_ROOT\config\profile.d")) { pushd $ENV:CMDER_ROOT\config\profile.d foreach ($x in Get-ChildItem *.ps1) { # write-host write-host Sourcing $x - . $x + Import-Module $x } popd @@ -144,7 +144,7 @@ if ($ENV:CMDER_USER_CONFIG -ne "" -and (test-path "$ENV:CMDER_USER_CONFIG\profil pushd $ENV:CMDER_USER_CONFIG\profile.d foreach ($x in Get-ChildItem *.ps1) { # write-host write-host Sourcing $x - . $x + Import-Module $x } popd } @@ -154,13 +154,13 @@ if ($ENV:CMDER_USER_CONFIG -ne "" -and (test-path "$ENV:CMDER_USER_CONFIG\profil $CmderUserProfilePath = Join-Path $env:CMDER_ROOT "config\user-profile.ps1" if (Test-Path $CmderUserProfilePath) { # Create this file and place your own command in there. - . "$CmderUserProfilePath" + Import-Module "$CmderUserProfilePath" } if ($ENV:CMDER_USER_CONFIG) { $CmderUserProfilePath = Join-Path $ENV:CMDER_USER_CONFIG "user-profile.ps1" if (Test-Path $CmderUserProfilePath) { - . "$CmderUserProfilePath" + Import-Module "$CmderUserProfilePath" } } From 21b1f009813fc7c4eef8c12a204424389ba413fb Mon Sep 17 00:00:00 2001 From: "Dmitri S. Guskov" Date: Wed, 29 Aug 2018 14:42:01 +0300 Subject: [PATCH 57/62] Powershell 5.1 compatibility 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 --- config/ConEmu.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/ConEmu.xml b/config/ConEmu.xml index db45a6a..c4f4fff 100644 --- a/config/ConEmu.xml +++ b/config/ConEmu.xml @@ -508,7 +508,7 @@ - + @@ -517,7 +517,7 @@ - + From e80ad2356f58716b430331e37b3fbb11043a5090 Mon Sep 17 00:00:00 2001 From: Arion Roberto Krause Date: Wed, 29 Aug 2018 22:07:26 -0300 Subject: [PATCH 58/62] Fixed typo --- launcher/src/CmderLauncher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index f417764..bcb7bca 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -386,7 +386,7 @@ cmderOptions GetOption() i++; } else { - MessageBox(NULL, szArgList[i + 1], L"/START - Folder doses not exist!", MB_OK); + MessageBox(NULL, szArgList[i + 1], L"/START - Folder does not exist!", MB_OK); } } else if (_wcsicmp(L"/task", szArgList[i]) == 0) From 08e1244fe523a74db59cc78674bbeaf4487defba Mon Sep 17 00:00:00 2001 From: David Refoua Date: Tue, 28 Aug 2018 18:03:38 +0430 Subject: [PATCH 59/62] fix some spelling issues --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bbb74f7..ed6c1be 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,7 @@ Aliases defined using the `alias.bat` command will automatically be saved in the To make an alias and/or any other profile settings permanent add it to one of the following: -Note: These are loaded in this order by `$CMDER_ROOT/vendor/init.bat`. Anyhing stored in `%CMDER_ROOT%` will be a portable setting and will follow cmder to another machine. +Note: These are loaded in this order by `$CMDER_ROOT/vendor/init.bat`. Anything stored in `%CMDER_ROOT%` will be a portable setting and will follow cmder to another machine. * `%CMDER_ROOT%\\config\\profile.d\\\*.cmd` and `\*.bat` * `%CMDER_ROOT%\\config\\user-aliases.cmd` @@ -202,7 +202,7 @@ PowerShell has native simple alias support, for example `[new-alias | set-alias] To make an alias and/or any other profile settings permanent add it to one of the following: -Note: These are loaded in this order by `$ENV:CMDER_ROOT\\vendor\\user-profile.ps1`. Anyhing stored in `$ENV:CMDER_ROOT` will be a portable setting and will follow cmder to another machine. +Note: These are loaded in this order by `$ENV:CMDER_ROOT\\vendor\\user-profile.ps1`. Anything stored in `$ENV:CMDER_ROOT` will be a portable setting and will follow cmder to another machine. * '$ENV:CMDER_ROOT\\config\\profile.d\\\*.ps1' * '$ENV:CMDER_ROOT\\config\\user-profile.ps1' From d91438de47b47f7ceb4c3c09923cea9f20052673 Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Thu, 30 Aug 2018 15:21:51 +0200 Subject: [PATCH 60/62] replace user-aliases with user_aliases --- vendor/init.bat | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/vendor/init.bat b/vendor/init.bat index 1328fc7..09c797e 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -245,24 +245,24 @@ if not defined user-aliases ( :: The aliases environment variable is used by alias.bat to id :: the default file to store new aliases in. if not defined aliases ( - set "aliases=%user-aliases%" + set "aliases=%user_aliases%" ) :: Make sure we have a self-extracting user-aliases.cmd file setlocal enabledelayedexpansion -if not exist "%user-aliases%" ( - echo Creating initial user-aliases store in "%user-aliases%"... - copy "%CMDER_ROOT%\vendor\user-aliases.cmd.example" "%user-aliases%" +if not exist "%user_aliases%" ( + echo Creating initial user-aliases store in "%user_aliases%"... + copy "%CMDER_ROOT%\vendor\user-aliases.cmd.example" "%user_aliases%" ) else ( - type "%user-aliases%" | findstr /i ";= Add aliases below here" >nul + type "%user_aliases%" | findstr /i ";= Add aliases below here" >nul if "!errorlevel!" == "1" ( - echo Creating initial user-aliases store in "%user-aliases%"... + echo Creating initial user-aliases store in "%user_aliases%"... if defined CMDER_USER_CONFIG ( - copy "%user-aliases%" "%user-aliases%.old_format" - copy "%CMDER_ROOT%\vendor\user-aliases.cmd.example" "%user-aliases%" + copy "%user_aliases%" "%user_aliases%.old_format" + copy "%CMDER_ROOT%\vendor\user-aliases.cmd.example" "%user_aliases%" ) else ( - copy "%user-aliases%" "%user-aliases%.old_format" - copy "%CMDER_ROOT%\vendor\user-aliases.cmd.example" "%user-aliases%" + copy "%user_aliases%" "%user_aliases%.old_format" + copy "%CMDER_ROOT%\vendor\user-aliases.cmd.example" "%user_aliases%" ) ) ) @@ -270,15 +270,15 @@ if not exist "%user-aliases%" ( :: Update old 'user-aliases' to new self executing 'user-aliases.cmd' if exist "%CMDER_ROOT%\config\aliases" ( echo Updating old "%CMDER_ROOT%\config\aliases" to new format... - type "%CMDER_ROOT%\config\aliases" >> "%user-aliases%" && del "%CMDER_ROOT%\config\aliases" -) else if exist "%user-aliases%.old_format" ( - echo Updating old "%user-aliases%" to new format... - type "%user-aliases%.old_format" >> "%user-aliases%" && del "%user-aliases%.old_format" + type "%CMDER_ROOT%\config\aliases" >> "%user_aliases%" && del "%CMDER_ROOT%\config\aliases" +) else if exist "%user_aliases%.old_format" ( + echo Updating old "%user_aliases%" to new format... + type "%user_aliases%.old_format" >> "%user_aliases%" && del "%user_aliases%.old_format" ) endlocal :: Add aliases to the environment -call "%user-aliases%" +call "%user_aliases%" :: See vendor\git-for-windows\README.portable for why we do this :: Basically we need to execute this post-install.bat because we are From e4fb0d694b8007c48603e42add8e5b861064ce81 Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Fri, 31 Aug 2018 18:40:53 +0200 Subject: [PATCH 61/62] Revert "replace user-aliases with user_aliases" This reverts commit d91438de47b47f7ceb4c3c09923cea9f20052673. --- vendor/init.bat | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/vendor/init.bat b/vendor/init.bat index 09c797e..1328fc7 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -245,24 +245,24 @@ if not defined user-aliases ( :: The aliases environment variable is used by alias.bat to id :: the default file to store new aliases in. if not defined aliases ( - set "aliases=%user_aliases%" + set "aliases=%user-aliases%" ) :: Make sure we have a self-extracting user-aliases.cmd file setlocal enabledelayedexpansion -if not exist "%user_aliases%" ( - echo Creating initial user-aliases store in "%user_aliases%"... - copy "%CMDER_ROOT%\vendor\user-aliases.cmd.example" "%user_aliases%" +if not exist "%user-aliases%" ( + echo Creating initial user-aliases store in "%user-aliases%"... + copy "%CMDER_ROOT%\vendor\user-aliases.cmd.example" "%user-aliases%" ) else ( - type "%user_aliases%" | findstr /i ";= Add aliases below here" >nul + type "%user-aliases%" | findstr /i ";= Add aliases below here" >nul if "!errorlevel!" == "1" ( - echo Creating initial user-aliases store in "%user_aliases%"... + echo Creating initial user-aliases store in "%user-aliases%"... if defined CMDER_USER_CONFIG ( - copy "%user_aliases%" "%user_aliases%.old_format" - copy "%CMDER_ROOT%\vendor\user-aliases.cmd.example" "%user_aliases%" + copy "%user-aliases%" "%user-aliases%.old_format" + copy "%CMDER_ROOT%\vendor\user-aliases.cmd.example" "%user-aliases%" ) else ( - copy "%user_aliases%" "%user_aliases%.old_format" - copy "%CMDER_ROOT%\vendor\user-aliases.cmd.example" "%user_aliases%" + copy "%user-aliases%" "%user-aliases%.old_format" + copy "%CMDER_ROOT%\vendor\user-aliases.cmd.example" "%user-aliases%" ) ) ) @@ -270,15 +270,15 @@ if not exist "%user_aliases%" ( :: Update old 'user-aliases' to new self executing 'user-aliases.cmd' if exist "%CMDER_ROOT%\config\aliases" ( echo Updating old "%CMDER_ROOT%\config\aliases" to new format... - type "%CMDER_ROOT%\config\aliases" >> "%user_aliases%" && del "%CMDER_ROOT%\config\aliases" -) else if exist "%user_aliases%.old_format" ( - echo Updating old "%user_aliases%" to new format... - type "%user_aliases%.old_format" >> "%user_aliases%" && del "%user_aliases%.old_format" + type "%CMDER_ROOT%\config\aliases" >> "%user-aliases%" && del "%CMDER_ROOT%\config\aliases" +) else if exist "%user-aliases%.old_format" ( + echo Updating old "%user-aliases%" to new format... + type "%user-aliases%.old_format" >> "%user-aliases%" && del "%user-aliases%.old_format" ) endlocal :: Add aliases to the environment -call "%user_aliases%" +call "%user-aliases%" :: See vendor\git-for-windows\README.portable for why we do this :: Basically we need to execute this post-install.bat because we are From 49da3745bce7c4f850079c0cc5a92ee978207b56 Mon Sep 17 00:00:00 2001 From: Dax T Games Date: Fri, 31 Aug 2018 17:02:56 -0500 Subject: [PATCH 62/62] Fix #1806 #1675 (#1870) ## 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 --- .gitignore | 2 ++ README.md | 22 ++++++------- launcher/src/CmderLauncher.cpp | 33 ++++++++++++++++++- vendor/cmder.sh | 31 ++++++++++++------ vendor/cmder_exinit | 58 ++++++++++++++++++++-------------- vendor/init.bat | 14 ++++---- vendor/profile.ps1 | 18 ++++++++--- 7 files changed, 120 insertions(+), 58 deletions(-) diff --git a/.gitignore b/.gitignore index cf231c5..2ae90c5 100644 --- a/.gitignore +++ b/.gitignore @@ -14,8 +14,10 @@ build/ Version v* *.bak config/user-* +config/user_* config/settings config/aliases config/profile.d .github_changelog_generator launcher/.vs +launcher/src/version.rc2 diff --git a/README.md b/README.md index ed6c1be..b7e2f21 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ From a bash/mintty shell: cd $CMDER_ROOT/vendor git clone https://github.com/karlin/mintty-colors-solarized.git cd mintty-colors-solarized/ -echo source \$CMDER_ROOT/vendor/mintty-colors-solarized/mintty-solarized-dark.sh>>$CMDER_ROOT/config/user-profile.sh +echo source \$CMDER_ROOT/vendor/mintty-colors-solarized/mintty-solarized-dark.sh>>$CMDER_ROOT/config/user_profile.sh ``` You may find some Monokai color schemes for mintty to match Cmder [here](https://github.com/PhilipDaniels/mintty/blob/master/themes/Monokai) or [here](https://github.com/oumu/mintty-color-schemes/blob/master/base16-monokai-mod.minttyrc). @@ -154,11 +154,11 @@ Single user portable configuration is possible using the cmder specific shell co | Shell | Cmder Portable User Config | | ------------- | ----------------------------------------- | -| Cmder | `%CMDER_ROOT%\\config\\user-profile.cmd` | -| PowerShell | `$ENV:CMDER_ROOT\\config\\user-profile.ps1` | -| Bash/Mintty | `$CMDER_ROOT/config/user-profile.sh` | +| Cmder | `%CMDER_ROOT%\\config\\user_profile.cmd` | +| PowerShell | `$ENV:CMDER_ROOT\\config\\user_profile.ps1` | +| Bash/Mintty | `$CMDER_ROOT/config/user_profile.sh` | -Note: Bash and Mintty sessions will also source the `$HOME/.bashrc` file if it exists after it sources `$CMDER_ROOT/config/user-profile.sh`. +Note: Bash and Mintty sessions will also source the `$HOME/.bashrc` file if it exists after it sources `$CMDER_ROOT/config/user_profile.sh`. You can write `*.cmd|*.bat`, `*.ps1`, and `*.sh` scripts and just drop them in the `%CMDER_ROOT%\config\profile.d` folder to add startup config to Cmder. @@ -182,7 +182,7 @@ Note: These are loaded in this order by `$CMDER_ROOT/vendor/init.bat`. Anything * `%CMDER_ROOT%\\config\\profile.d\\\*.cmd` and `\*.bat` * `%CMDER_ROOT%\\config\\user-aliases.cmd` -* `%CMDER_ROOT%\\config\\user-profile.cmd` +* `%CMDER_ROOT%\\config\\user_profile.cmd` #### Bash.exe|Mintty.exe Aliases Bash shells support simple and complex aliases with optional parameters natively so they work a little different. Typing `alias name=command` will create an alias only for the current running session. @@ -192,26 +192,26 @@ To make an alias and/or any other profile settings permanent add it to one of th Note: These are loaded in this order by `$CMDER_ROOT/vendor/git-for-windows/etc/profile.d/cmder.sh`. Anything stored in `$CMDER_ROOT` will be a portable setting and will follow cmder to another machine. * `$CMDER_ROOT/config/profile.d/*.sh` -* `$CMDER_ROOT/config/user-profile.sh` +* `$CMDER_ROOT/config/user_profile.sh` * `$HOME/.bashrc` -If you add bash aliases to `$CMDER_ROOT/config/user-profile.sh` they will be portable and follow your Cmder folder if you copy it to another machine. `$HOME/.bashrc` defined aliases are not portable. +If you add bash aliases to `$CMDER_ROOT/config/user_profile.sh` they will be portable and follow your Cmder folder if you copy it to another machine. `$HOME/.bashrc` defined aliases are not portable. #### PowerShell.exe Aliases PowerShell has native simple alias support, for example `[new-alias | set-alias] alias command`, so complex aliases with optional parameters are not supported in PowerShell sessions. Type `get-help [new-alias|set-alias] -full` for help on PowerShell aliases. To make an alias and/or any other profile settings permanent add it to one of the following: -Note: These are loaded in this order by `$ENV:CMDER_ROOT\\vendor\\user-profile.ps1`. Anything stored in `$ENV:CMDER_ROOT` will be a portable setting and will follow cmder to another machine. +Note: These are loaded in this order by `$ENV:CMDER_ROOT\\vendor\\user_profile.ps1`. Anything stored in `$ENV:CMDER_ROOT` will be a portable setting and will follow cmder to another machine. * '$ENV:CMDER_ROOT\\config\\profile.d\\\*.ps1' -* '$ENV:CMDER_ROOT\\config\\user-profile.ps1' +* '$ENV:CMDER_ROOT\\config\\user_profile.ps1' ### SSH Agent To start the vendored SSH agent simply call `start-ssh-agent`, which is in the `vendor/git-for-windows/cmd` folder. -If you want to run SSH agent on startup, include the line `@call "%GIT_INSTALL_ROOT%/cmd/start-ssh-agent.cmd"` in `%CMDER_ROOT%/config/user-profile.cmd` (usually just uncomment it). +If you want to run SSH agent on startup, include the line `@call "%GIT_INSTALL_ROOT%/cmd/start-ssh-agent.cmd"` in `%CMDER_ROOT%/config/user_profile.cmd` (usually just uncomment it). ### Vendored Git diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index bcb7bca..9f0a275 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -9,6 +9,7 @@ #include #pragma comment(lib, "Shlwapi.lib") +#pragma warning( disable : 4091 ) #ifndef UNICODE #error "Must be compiled with unicode support." @@ -85,6 +86,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr wchar_t userConfigDirPath[MAX_PATH] = { 0 }; wchar_t userBinDirPath[MAX_PATH] = { 0 }; wchar_t userProfiledDirPath[MAX_PATH] = { 0 }; + wchar_t userProfilePath[MAX_PATH] = { 0 }; + wchar_t legacyUserProfilePath[MAX_PATH] = { 0 }; wchar_t args[MAX_PATH * 2 + 256] = { 0 }; std::wstring cmderStart = path; @@ -104,6 +107,21 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr PathCombine(icoPath, exeDir, L"icons\\cmder.ico"); PathCombine(configDirPath, exeDir, L"config"); + + PathCombine(legacyUserProfilePath, configDirPath, L"user-profile.cmd"); + if (PathFileExists(legacyUserProfilePath)) { + PathCombine(userProfilePath, configDirPath, L"user_profile.cmd"); + + char *lPr = (char *)malloc(MAX_PATH); + char *pR = (char *)malloc(MAX_PATH); + size_t i; + wcstombs_s(&i, lPr, (size_t)MAX_PATH, + legacyUserProfilePath, (size_t)MAX_PATH); + wcstombs_s(&i, pR, (size_t)MAX_PATH, + userProfilePath, (size_t)MAX_PATH); + rename(lPr, pR); + } + if (wcscmp(userConfigDirPath, L"") == 0) { PathCombine(userConfigDirPath, exeDir, L"config"); @@ -118,6 +136,20 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr PathCombine(userProfiledDirPath, userConfigDirPath, L"profile.d"); SHCreateDirectoryEx(0, userProfiledDirPath, 0); + + PathCombine(legacyUserProfilePath, userConfigDirPath, L"user-profile.cmd"); + if (PathFileExists(legacyUserProfilePath)) { + PathCombine(userProfilePath, userConfigDirPath, L"user_profile.cmd"); + + char *lPr = (char *)malloc(MAX_PATH); + char *pR = (char *)malloc(MAX_PATH); + size_t i; + wcstombs_s(&i, lPr, (size_t)MAX_PATH, + legacyUserProfilePath, (size_t)MAX_PATH); + wcstombs_s(&i, pR, (size_t)MAX_PATH, + userProfilePath, (size_t)MAX_PATH); + rename(lPr, pR); + } } // Set path to vendored ConEmu config file @@ -131,7 +163,6 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr ExpandEnvironmentStrings(cpuCfgPath, cpuCfgPath, sizeof(cpuCfgPath) / sizeof(cpuCfgPath[0])); PathCombine(userCfgPath, userConfigDirPath, L"user-ConEmu.xml"); - if (PathFileExists(cpuCfgPath)) { if (PathFileExists(cfgPath)) { if (!CopyFile(cfgPath, cpuCfgPath, FALSE)) diff --git a/vendor/cmder.sh b/vendor/cmder.sh index 90bca50..aa59642 100644 --- a/vendor/cmder.sh +++ b/vendor/cmder.sh @@ -1,6 +1,6 @@ # DO NOT EDIT THIS FILE IT WILL BE OVERWRITTEN ON UPDATE # -# Add portable user customizations ${CMDER_ROOT}/config/user-profile.sh, +# Add portable user customizations ${CMDER_ROOT}/config/user_profile.sh, # these customizations will follow Cmder if $CMDER_ROOT is copied # to another machine. # @@ -63,21 +63,32 @@ if [ -d "${CMDER_USER_CONFIG}/profile.d" ] ; then runProfiled "${CMDER_USER_CONFIG}/profile.d" fi -initialConfig="${CMDER_ROOT}/config/user-profile.sh" -if [ -f "${CMDER_ROOT}/config/user-profile.sh" ] ; then - . "${CMDER_ROOT}/config/user-profile.sh" + +# Renaming to "config\user_profile.sh" to "user_profile.sh" for consistency. +if [ -f "$CMDER_ROOT/config/user-profile.sh" ] ; then + mv "$CMDER_ROOT/config/user-profile.sh" "$CMDER_ROOT/config/user_profile.sh" +fi + +CmderUserProfilePath="${CMDER_ROOT}/config/user_profile.sh" +if [ -f "${CMDER_ROOT}/config/user_profile.sh" ] ; then + . "${CMDER_ROOT}/config/user_profile.sh" fi if [ "${CMDER_USER_CONFIG}" != "" ] ; then - initialConfig="${CMDER_USER_CONFIG}/user-profile.sh" - if [ -f "${CMDER_USER_CONFIG}/user-profile.sh" ] ; then - . "${CMDER_USER_CONFIG}/user-profile.sh" + # Renaming to "config\user_profile.sh" to "user_profile.sh" for consistency. + if [ -f "$CMDER_USER_CONFIG/user-profile.sh" ] ; then + mv "$CMDER_USER_CONFIG/user-profile.sh" "$CMDER_USER_CONFIG/user_profile.sh" + fi + + CmderUserProfilePath="${CMDER_USER_CONFIG}/user_profile.sh" + if [ -f "${CMDER_USER_CONFIG}/user_profile.sh" ] ; then + . "${CMDER_USER_CONFIG}/user_profile.sh" fi fi -if [ ! -f "${initialConfig}" ] ; then - echo Creating user startup file: "${initialConfig}" - cat <<-eof >"${initialConfig}" +if [ ! -f "${CmderUserProfilePath}" ] ; then + echo Creating user startup file: "${CmderUserProfilePath}" + cat <<-eof >"${CmderUserProfilePath}" # use this file to run your own startup commands for msys2 bash' # To add a new vendor to the path, do something like: diff --git a/vendor/cmder_exinit b/vendor/cmder_exinit index f20bef1..c182aee 100644 --- a/vendor/cmder_exinit +++ b/vendor/cmder_exinit @@ -1,4 +1,4 @@ -# Copy this file to your non integrated *nix-like environment, +# Copy this file to your non integrated *nix-like environment, # Cygwin/MSys2/Git for Windows SDK, installs '/etc/profile.d/' # folder to integrate the externally installed Unix like environment # into Cmder so it has access to settings stored in Cmder/config @@ -15,7 +15,7 @@ # These customizations will follow Cmder if $CMDER_ROOT is copied # to another machine. # -# Add system specific users customizations to $HOME/.bashrc, these +# Add system specific users customizations to $HOME/.bashrc, these # customizations will not follow Cmder to another machine. # # Uncomment and edit the CMDER_ROOT line to use Cmder/config even when launched @@ -58,45 +58,55 @@ fi if [ ! "$CMDER_ROOT" = "" ] ; then # Remove any trailing '/' CMDER_ROOT=$(echo $CMDER_ROOT | sed 's:/*$::') - + echo "Using \"CMDER_ROOT\" at \"${CMDER_ROOT}\"." - + export CMDER_ROOT - + PATH=${CMDER_ROOT}/bin:$PATH:${CMDER_ROOT} - + export PATH - + # Drop *.sh or *.zsh files into "${CMDER_ROOT}\config\profile.d" # to source them at startup. if [ ! -d "${CMDER_ROOT}/config/profile.d" ] ; then mkdir -p "${CMDER_ROOT}/config/profile.d" fi - + if [ -d "${CMDER_ROOT}/config/profile.d" ] ; then runProfiled "${CMDER_ROOT}/config/profile.d" fi - + if [ -d "${CMDER_USER_CONFIG}/profile.d" ] ; then runProfiled "${CMDER_USER_CONFIG}/profile.d" fi - - if [ -f "${CMDER_ROOT}/config/user-profile.sh" ] ; then - . "${CMDER_ROOT}/config/user-profile.sh" + + # Renaming to "config\user_profile.sh" to "user_profile.sh" for consistency. + if [ -f "$CMDER_ROOT/config/user-profile.sh" ] ; then + mv "$CMDER_ROOT/config/user-profile.sh" "$CMDER_ROOT/config/user_profile.sh" fi - - if [ -f "${CMDER_USER_CONFIG}/user-profile.sh" ] ; then - . "${CMDER_USER_CONFIG}/user-profile.sh" - else - if [ "${CMDER_USER_CONFIG}" != "" ] ; then - initialProfile="${CMDER_USER_CONFIG}/user-profile.sh" - else - initialProfile="${CMDER_ROOT}/config/user-profile.sh" - fi - - echo Creating user startup file: "${initialProfile}" - cat <<-eof >"${initialProfile}" + + CmderUserProfilePath="${CMDER_ROOT}/config/user_profile.sh" + if [ -f "${CMDER_ROOT}/config/user_profile.sh" ] ; then + . "${CMDER_ROOT}/config/user_profile.sh" + fi + + if [ "${CMDER_USER_CONFIG}" != "" ] ; then + # Renaming to "config\user_profile.sh" to "user_profile.sh" for consistency. + if [ -f "$CMDER_USER_CONFIG/user-profile.sh" ] ; then + mv "$CMDER_USER_CONFIG/user-profile.sh" "$CMDER_USER_CONFIG/user_profile.sh" + fi + + CmderUserProfilePath="${CMDER_USER_CONFIG}/user_profile.sh" + if [ -f "${CMDER_USER_CONFIG}/user_profile.sh" ] ; then + . "${CMDER_USER_CONFIG}/user_profile.sh" + fi + fi + + if [ ! -f "${CmderUserProfilePath}" ] ; then + echo Creating user startup file: "${CmderUserProfilePath}" + cat <<-eof >"${CmderUserProfilePath}" # use this file to run your own startup commands for msys2 bash' # To add a new vendor to the path, do something like: diff --git a/vendor/init.bat b/vendor/init.bat index 1328fc7..9959275 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -4,7 +4,7 @@ :: Created as part of cmder project :: !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED -:: !!! Use "%CMDER_ROOT%\config\user-profile.cmd" to add your own startup commands +:: !!! Use "%CMDER_ROOT%\config\user_profile.cmd" to add your own startup commands :: Use /v command line arg or set to > 0 for verbose output to aid in debugging. set verbose-output=0 @@ -294,17 +294,17 @@ if exist "%GIT_INSTALL_ROOT%\post-install.bat" ( if not defined HOME set "HOME=%USERPROFILE%" %lib_console% debug-output init.bat "Env Var - HOME=%HOME%" -set "initialConfig=%CMDER_ROOT%\config\user-profile.cmd" -if exist "%CMDER_ROOT%\config\user-profile.cmd" ( +set "initialConfig=%CMDER_ROOT%\config\user_profile.cmd" +if exist "%CMDER_ROOT%\config\user_profile.cmd" ( REM Create this file and place your own command in there - call "%CMDER_ROOT%\config\user-profile.cmd" + call "%CMDER_ROOT%\config\user_profile.cmd" ) if defined CMDER_USER_CONFIG ( - set "initialConfig=%CMDER_USER_CONFIG%\user-profile.cmd" - if exist "%CMDER_USER_CONFIG%\user-profile.cmd" ( + set "initialConfig=%CMDER_USER_CONFIG%\user_profile.cmd" + if exist "%CMDER_USER_CONFIG%\user_profile.cmd" ( REM Create this file and place your own command in there - call "%CMDER_USER_CONFIG%\user-profile.cmd" + call "%CMDER_USER_CONFIG%\user_profile.cmd" ) ) diff --git a/vendor/profile.ps1 b/vendor/profile.ps1 index 2952618..8c9f207 100644 --- a/vendor/profile.ps1 +++ b/vendor/profile.ps1 @@ -2,7 +2,7 @@ # Created as part of cmder project # !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED -# !!! Use "%CMDER_ROOT%\config\user-profile.ps1" to add your own startup commands +# !!! Use "%CMDER_ROOT%\config\user_profile.ps1" to add your own startup commands # Compatibility with PS major versions <= 2 if(!$PSScriptRoot) { @@ -97,7 +97,7 @@ $env:Path = "$Env:CMDER_ROOT\bin;$env:Path;$Env:CMDER_ROOT" # # Prompt Section -# Users should modify their user-profile.ps1 as it will be safe from updates. +# Users should modify their user_profile.ps1 as it will be safe from updates. # # Pre assign the hooks so the first run of cmder gets a working prompt. @@ -149,16 +149,24 @@ if ($ENV:CMDER_USER_CONFIG -ne "" -and (test-path "$ENV:CMDER_USER_CONFIG\profil popd } +# Renaming to "config\user_profile.ps1" to "user_profile.ps1" for consistency. +if (test-path "$env:CMDER_ROOT\config\user-profile.ps1") { + rename-item "$env:CMDER_ROOT\config\user-profile.ps1" user_profile.ps1 +} - -$CmderUserProfilePath = Join-Path $env:CMDER_ROOT "config\user-profile.ps1" +$CmderUserProfilePath = Join-Path $env:CMDER_ROOT "config\user_profile.ps1" if (Test-Path $CmderUserProfilePath) { # Create this file and place your own command in there. Import-Module "$CmderUserProfilePath" } if ($ENV:CMDER_USER_CONFIG) { - $CmderUserProfilePath = Join-Path $ENV:CMDER_USER_CONFIG "user-profile.ps1" + # Renaming to "$env:CMDER_USER_CONFIG\user-profile.ps1" to "user_profile.ps1" for consistency. + if (test-path "$env:CMDER_USER_CONFIG\user-profile.ps1") { + rename-item "$env:CMDER_USER_CONFIG\user-profile.ps1" user_profile.ps1 + } + + $CmderUserProfilePath = Join-Path $ENV:CMDER_USER_CONFIG "user_profile.ps1" if (Test-Path $CmderUserProfilePath) { Import-Module "$CmderUserProfilePath" }