From 0a5d1ac156ac8d1fc0e2e55a74c1501f051f3a2a Mon Sep 17 00:00:00 2001 From: Shahzeb Ihsan Date: Fri, 17 Mar 2017 10:26:57 +0800 Subject: [PATCH 01/30] Use cat -n for printing history to show cmd index Currently the "history" command in Cmder prints commands without any index associated with any command, so you can copy/paste a command or use "!!" to execute a command from the history but, unlike BASH, you can't do "!". "cat" has a switch, "-n", which prints line numbers of the file being printed. This, in conjunction with "history_io=3" in Clink settings (to read/write history when editing a command") works just like BASH, i.e., you can use the index printed next to a command in the history to execute that command as "!". --- vendor/user-aliases.cmd.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/user-aliases.cmd.example b/vendor/user-aliases.cmd.example index 01df318..5279705 100644 --- a/vendor/user-aliases.cmd.example +++ b/vendor/user-aliases.cmd.example @@ -9,7 +9,7 @@ gl=git log --oneline --all --graph --decorate $* ls=ls --show-control-chars -F --color $* pwd=cd clear=cls -history=cat %CMDER_ROOT%\config\.history +history=cat -n %CMDER_ROOT%\config\.history unalias=alias /d $1 vi=vim $* cmderr=cd /d "%CMDER_ROOT%" From d8444dae973322e1052a6773cffdb604e489154c Mon Sep 17 00:00:00 2001 From: Shahzeb Ihsan Date: Fri, 17 Mar 2017 10:59:12 +0800 Subject: [PATCH 02/30] Set history_io=3 in default Clink settings Currently the "history" command in Cmder prints commands without any index associated with any command, so you can copy/paste a command or use "!!" to execute a command from the history but, unlike BASH, you can't do "!". "cat" has a switch, "-n", which prints line numbers of the file being printed. This, in conjunction with "history_io=3" in Clink settings (to read/write history when editing a command") works just like BASH, i.e., you can use the index printed next to a command in the history to execute that command as "!". --- vendor/init.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/vendor/init.bat b/vendor/init.bat index 730efea..b874709 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -26,6 +26,7 @@ if "%PROCESSOR_ARCHITECTURE%"=="x86" ( :: Tell the user about the clink config files... if not exist "%CMDER_ROOT%\config\settings" ( + set clink.history_io=3 echo Generating clink initial settings in "%CMDER_ROOT%\config\settings" echo Additional *.lua files in "%CMDER_ROOT%\config" are loaded on startup. ) From 63128ed52fd1245a8565bb9a29ce377895550eac Mon Sep 17 00:00:00 2001 From: David Refoua Date: Thu, 7 Mar 2019 16:59:46 +0330 Subject: [PATCH 03/30] =?UTF-8?q?=E2=9C=A8=20polished=20issues=20template?= =?UTF-8?q?=20(#2056)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - added version subsection - better worded upstream technologies notice - more clear instructions --- .github/issue_template.md | 54 ++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/.github/issue_template.md b/.github/issue_template.md index 5ebdb9c..21b489a 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -10,16 +10,18 @@ • Searched for existing issues (including the **closed** ones) for the similar problems here: + https://github.com/cmderdev/cmder/issues?q=is:issue - • Read the README.md and the Wiki: + • Read both the README.md and the Wiki: + - https://github.com/cmderdev/cmder/blob/master/README.md - https://github.com/cmderdev/cmder/wiki (What you may be asking here could already be explained there!) - • Please understand that Cmder by default uses ConEmu as the - underlying Terminal Emulator. If your issue is regarding + • Please understand that Cmder uses ConEmu as the default + underlying Terminal Emulator. If your issue is regarding the **Terminal Emulator**, please visit the ConEmu issues page: https://github.com/Maximus5/ConEmu/issues?q=is:issue @@ -30,35 +32,53 @@ 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 - your favorite IDE of choice, or how to perform an specific - task with Cmder, make sure you visit our label section first! + + • If you would like to ask for guides on how to integrate Cmder with + your favorite IDE of choice, or how to perform a specific 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 you are having an issue with any of the **upstream technologies** + that are used by Cmder, please make sure that the issue is reproducible + _only_ when used in combination with Cmder. + + We may not directly address the issues related to the following tools: + - Clink, the default shell in Cmder + - ConEmu, the terminal emulator + - Git/MinGW, which also provide *NIX tools + - clink-completions, which provide autocomplete + + The issues related to upstream technologies are marked as 👆 [name]. + + We'll try our best to help you -- but we recommend creating an issue + specifically at each of the corresponding repositories for the best + result. + + ► Try to reproduce the bug you're reporting, on a stand-alone edition + of each tool, without using 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. - • If the issue is regarding the other upstream technologies that - Cmder uses (e.g. Clink, Git, etc), please make sure that the - bug you are reporting only applies when they are used in - 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. + • Lastly, have a look at official documentation for Cmder over + our website, and our wiki. 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! + Thank you for making sure you are opening a new valid issue! ♥ --> @@ -74,5 +95,8 @@ - [ ] Feature request (request for new functionality) - [ ] Question +### Version Information + + ### Description of the issue From 98a64b71b24d0c5bdde26c73ddbc95523bc2a359 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sat, 16 Mar 2019 13:52:47 -0400 Subject: [PATCH 04/30] Allow full ps1 prompt customization by 'config/*.ps1' scripts --- vendor/profile.ps1 | 79 ++++++++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 34 deletions(-) diff --git a/vendor/profile.ps1 b/vendor/profile.ps1 index 73fde18..498bdc0 100644 --- a/vendor/profile.ps1 +++ b/vendor/profile.ps1 @@ -27,7 +27,7 @@ $ENV:CMDER_ROOT = (($ENV:CMDER_ROOT).trimend("\")) # do not load bundled psget if a module installer is already available # -> recent PowerShell versions include PowerShellGet out of the box -$moduleInstallerAvailable = [bool](Get-Command -Name 'Install-Module' -ErrorAction SilentlyContinue | Out-Null) +$moduleInstallerAvailable = [bool](Get-Command -Name 'Install-Module' -ErrorAction SilentlyContinue) # Add Cmder modules directory to the autoload path. $CmderModulePath = Join-path $PSScriptRoot "psmodules/" @@ -96,31 +96,6 @@ $env:Path = "$Env:CMDER_ROOT\bin;$Env:CMDER_ROOT\vendor\bin;$env:Path;$Env:CMDER # 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. -[ScriptBlock]$PrePrompt = {} -[ScriptBlock]$PostPrompt = {} -[ScriptBlock]$CmderPrompt = { - $Host.UI.RawUI.ForegroundColor = "White" - Microsoft.PowerShell.Utility\Write-Host $pwd.ProviderPath -NoNewLine -ForegroundColor Green - checkGit($pwd.ProviderPath) -} - -<# -This scriptblock runs every time the prompt is returned. -Explicitly use functions from MS namespace to protect from being overridden in the user session. -Custom prompt functions are loaded in as constants to get the same behaviour -#> -[ScriptBlock]$Prompt = { - $realLASTEXITCODE = $LASTEXITCODE - $host.UI.RawUI.WindowTitle = Microsoft.PowerShell.Management\Split-Path $pwd.ProviderPath -Leaf - PrePrompt | Microsoft.PowerShell.Utility\Write-Host -NoNewline - CmderPrompt - Microsoft.PowerShell.Utility\Write-Host "`nλ " -NoNewLine -ForegroundColor "DarkGray" - PostPrompt | Microsoft.PowerShell.Utility\Write-Host -NoNewline - $global:LASTEXITCODE = $realLASTEXITCODE - return " " -} - # Drop *.ps1 files into "$ENV:CMDER_ROOT\config\profile.d" # to source them at startup. if (-not (test-path "$ENV:CMDER_ROOT\config\profile.d")) { @@ -154,7 +129,7 @@ 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 @@ -185,11 +160,47 @@ if (! (Test-Path $CmderUserProfilePath) ) { Copy-Item "$env:CMDER_ROOT\vendor\user_profile.ps1.default" -Destination $CmderUserProfilePath } -# Once Created these code blocks cannot be overwritten -Set-Item -Path function:\PrePrompt -Value $PrePrompt -Options Constant -Set-Item -Path function:\CmderPrompt -Value $CmderPrompt -Options Constant -Set-Item -Path function:\PostPrompt -Value $PostPrompt -Options Constant +# Only set the prompt if it is currently set to the default +# This allows users to configure the prompt in their user_profile.ps1 or config\profile.d\*.ps1 +if ( $(get-command prompt).Definition -match 'PS \$\(\$executionContext.SessionState.Path.CurrentLocation\)\$\(' -and ` + $(get-command prompt).Definition -match '\(\$nestedPromptLevel \+ 1\)\) ";') { + # Pre assign the hooks so the first run of cmder gets a working prompt. + [ScriptBlock]$PrePrompt = {} + [ScriptBlock]$PostPrompt = {} + [ScriptBlock]$CmderPrompt = { + $Host.UI.RawUI.ForegroundColor = "White" + Microsoft.PowerShell.Utility\Write-Host $pwd.ProviderPath -NoNewLine -ForegroundColor Green + checkGit($pwd.ProviderPath) + } -# Functions can be made constant only at creation time -# ReadOnly at least requires `-force` to be overwritten -Set-Item -Path function:\prompt -Value $Prompt -Options ReadOnly + <# + This scriptblock runs every time the prompt is returned. + Explicitly use functions from MS namespace to protect from being overridden in the user session. + Custom prompt functions are loaded in as constants to get the same behaviour + #> + [ScriptBlock]$Prompt = { + $realLASTEXITCODE = $LASTEXITCODE + $host.UI.RawUI.WindowTitle = Microsoft.PowerShell.Management\Split-Path $pwd.ProviderPath -Leaf + PrePrompt | Microsoft.PowerShell.Utility\Write-Host -NoNewline + CmderPrompt + Microsoft.PowerShell.Utility\Write-Host "`nλ " -NoNewLine -ForegroundColor "DarkGray" + PostPrompt | Microsoft.PowerShell.Utility\Write-Host -NoNewline + $global:LASTEXITCODE = $realLASTEXITCODE + return " " + } + + + # Once Created these code blocks cannot be overwritten + # if (-not $(get-command PrePrompt).Options -match 'Constant') {Set-Item -Path function:\PrePrompt -Value $PrePrompt -Options Constant} + # if (-not $(get-command CmderPrompt).Options -match 'Constant') {Set-Item -Path function:\CmderPrompt -Value $CmderPrompt -Options Constant} + # if (-not $(get-command PostPrompt).Options -match 'Constant') {Set-Item -Path function:\PostPrompt -Value $PostPrompt -Options Constant} + + Set-Item -Path function:\PrePrompt -Value $PrePrompt -Options Constant + Set-Item -Path function:\CmderPrompt -Value $CmderPrompt -Options Constant + Set-Item -Path function:\PostPrompt -Value $PostPrompt -Options Constant + + # Functions can be made constant only at creation time + # ReadOnly at least requires `-force` to be overwritten + # if (!$(get-command Prompt).Options -match 'ReadOnly') {Set-Item -Path function:\prompt -Value $Prompt -Options ReadOnly} + Set-Item -Path function:\prompt -Value $Prompt -Options ReadOnly +} From 8abfa9d4134a1ee0ff81eb9a2e8a8bfc209d6052 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sat, 16 Mar 2019 19:15:36 -0400 Subject: [PATCH 05/30] add back shell context menu to drives on register unregister --- launcher/src/CmderLauncher.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index d9e17c9..e399a47 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -20,6 +20,8 @@ #define MB_TITLE L"Cmder Launcher" #define SHELL_MENU_REGISTRY_PATH_BACKGROUND L"Directory\\Background\\shell\\Cmder" #define SHELL_MENU_REGISTRY_PATH_LISTITEM L"Directory\\shell\\Cmder" +#define SHELL_MENU_REGISTRY_DRIVE_PATH_BACKGROUND L"Drive\\Background\\shell\\Cmder" +#define SHELL_MENU_REGISTRY_DRIVE_PATH_LISTITEM L"Drive\\shell\\Cmder" #define streqi(a, b) (_wcsicmp((a), (b)) == 0) @@ -665,11 +667,15 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, { RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle); RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_LISTITEM, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle); + RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle); + RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_LISTITEM, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle); } else if (cmderOptions.unRegisterApp == true) { UnregisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_BACKGROUND); UnregisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_LISTITEM); + UnregisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_BACKGROUND); + UnregisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_LISTITEM); } else if (cmderOptions.error == true) { From a93fff6798ad5b4b7c4eda1d933cc8578cf24462 Mon Sep 17 00:00:00 2001 From: Dax T Games Date: Sun, 17 Mar 2019 15:09:02 -0400 Subject: [PATCH 06/30] Update init.bat --- vendor/init.bat | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vendor/init.bat b/vendor/init.bat index 20676f6..5cc29ab 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -51,9 +51,7 @@ call "%cmder_root%\vendor\lib\lib_profile" ) else if /i "%1"=="/v" ( set verbose_output=1 ) else if /i "%1"=="/d" ( - if not defined VSCODE_CWD ( - set debug_output=1 - ) + set debug_output=1 ) else if /i "%1" == "/max_depth" ( if "%~2" geq "1" if "%~2" leq "5" ( set "max_depth=%~2" From 280bbfff1fd7e938bfe6e11f42cec6d8a8a74178 Mon Sep 17 00:00:00 2001 From: David Refoua Date: Thu, 21 Mar 2019 01:27:13 +0330 Subject: [PATCH 07/30] update issue template (#2062) --- .github/issue_template.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/issue_template.md b/.github/issue_template.md index 21b489a..2806b29 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -44,6 +44,11 @@ (Be sure to also check “Closed” issues in the labels section!) + • If you have a request to provide auto-complete support for a new tool, + please post your request here: + + https://github.com/vladimir-kotikov/clink-completions/issues + • If you are having an issue with any of the **upstream technologies** that are used by Cmder, please make sure that the issue is reproducible _only_ when used in combination with Cmder. @@ -52,9 +57,9 @@ - Clink, the default shell in Cmder - ConEmu, the terminal emulator - Git/MinGW, which also provide *NIX tools - - clink-completions, which provide autocomplete + - clink-completions, which provide autocompletion - The issues related to upstream technologies are marked as 👆 [name]. + The issues related to upstream technologies are labeled as 👆 [name]. We'll try our best to help you -- but we recommend creating an issue specifically at each of the corresponding repositories for the best @@ -78,7 +83,7 @@ + + ### Description of the issue From 081624d88e3bac96306451b1751b5c01c3c0cbde Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sat, 23 Mar 2019 15:03:44 -0400 Subject: [PATCH 08/30] cleanup --- vendor/profile.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vendor/profile.ps1 b/vendor/profile.ps1 index 498bdc0..53b4e5a 100644 --- a/vendor/profile.ps1 +++ b/vendor/profile.ps1 @@ -25,7 +25,7 @@ if (! $ENV:CMDER_ROOT ) { # Remove trailing '\' $ENV:CMDER_ROOT = (($ENV:CMDER_ROOT).trimend("\")) -# do not load bundled psget if a module installer is already available +# Do not load bundled psget if a module installer is already available # -> recent PowerShell versions include PowerShellGet out of the box $moduleInstallerAvailable = [bool](Get-Command -Name 'Install-Module' -ErrorAction SilentlyContinue) @@ -91,11 +91,6 @@ if (Get-Module PSReadline -ErrorAction "SilentlyContinue") { # Enhance Path $env:Path = "$Env:CMDER_ROOT\bin;$Env:CMDER_ROOT\vendor\bin;$env:Path;$Env:CMDER_ROOT" -# -# Prompt Section -# Users should modify their user_profile.ps1 as it will be safe from updates. -# - # Drop *.ps1 files into "$ENV:CMDER_ROOT\config\profile.d" # to source them at startup. if (-not (test-path "$ENV:CMDER_ROOT\config\profile.d")) { @@ -160,6 +155,11 @@ if (! (Test-Path $CmderUserProfilePath) ) { Copy-Item "$env:CMDER_ROOT\vendor\user_profile.ps1.default" -Destination $CmderUserProfilePath } +# +# Prompt Section +# Users should modify their user_profile.ps1 as it will be safe from updates. +# + # Only set the prompt if it is currently set to the default # This allows users to configure the prompt in their user_profile.ps1 or config\profile.d\*.ps1 if ( $(get-command prompt).Definition -match 'PS \$\(\$executionContext.SessionState.Path.CurrentLocation\)\$\(' -and ` From 192c2f4dd102140144db656a739da1f36226659d Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sun, 31 Mar 2019 09:47:50 -0400 Subject: [PATCH 09/30] fix git detection --- vendor/lib/lib_git.cmd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vendor/lib/lib_git.cmd b/vendor/lib/lib_git.cmd index bfbcdb2..02f156b 100644 --- a/vendor/lib/lib_git.cmd +++ b/vendor/lib/lib_git.cmd @@ -88,8 +88,11 @@ exit /b ::: [SCOPE]_BUILD Scoped Build version. :::------------------------------------------------------------------------------- - setlocal enabledelayedexpansion :: process a `x.x.x.xxxx.x` formatted string + set "%~1_MAJOR=" + set "%~1_MINOR=" + set "%~1_PATCH=" + set "%~1_BUILD=" %lib_console% debug_output :parse_version "ARGV[1]=%~1, ARGV[2]=%~2" for /F "tokens=1-3* delims=.,-" %%A in ("%2") do ( set "%~1_MAJOR=%%A" @@ -98,7 +101,6 @@ exit /b set "%~1_BUILD=%%D" ) - endlocal & set "%~1_MAJOR=!%~1_MAJOR!" & set "%~1_MINOR=!%~1_MINOR!" & set "%~1_PATCH=!%~1_PATCH!" & set "%~1_BUILD=!%~1_BUILD!" exit /b :validate_version From b424012a08f4645d5c61423867e9dcc0b7276fd5 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sun, 31 Mar 2019 09:48:58 -0400 Subject: [PATCH 10/30] make debug messages more verbose --- vendor/init.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/init.bat b/vendor/init.bat index 20676f6..3907beb 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -235,7 +235,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_console% debug_output "Using vendored Git from '!GIT_INSTALL_ROOT!..." + %lib_console% debug_output "Using vendored Git '!GIT_VERSION_VENDORED!' from '!GIT_INSTALL_ROOT!..." goto :CONFIGURE_GIT ) else ( goto :NO_GIT @@ -246,7 +246,7 @@ if exist "%CMDER_ROOT%\vendor\git-for-windows" ( goto :CONFIGURE_GIT :FOUND_GIT -%lib_console% debug_output "Using found Git from '%GIT_INSTALL_ROOT%..." +%lib_console% debug_output "Using found Git '!GIT_VERSION_USER!' from '%GIT_INSTALL_ROOT%..." goto :CONFIGURE_GIT :CONFIGURE_GIT From f39b921121f3c4c99741cc33ef6bb554f5b2a69d Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sun, 31 Mar 2019 16:11:14 -0400 Subject: [PATCH 11/30] fixes --- .github/issue_template.md | 54 ++++++++++++++++----------------- vendor/user_aliases.cmd.default | 2 +- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/issue_template.md b/.github/issue_template.md index 2806b29..e3fc4e5 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -2,86 +2,86 @@ Thank you for reporting a bug for the Cmder project! ------------------------------------------------------------------ - + Please make sure you read and follow the following instructions carefully before reporting bugs, and/or requesting new features. - + Make sure that you have: - + • Searched for existing issues (including the **closed** ones) for the similar problems here: - + https://github.com/cmderdev/cmder/issues?q=is:issue - + • Read both the README.md and the Wiki: - + - https://github.com/cmderdev/cmder/blob/master/README.md - https://github.com/cmderdev/cmder/wiki - + (What you may be asking here could already be explained there!) - + • Please understand that Cmder uses ConEmu as the default underlying Terminal Emulator. If your issue is regarding the **Terminal Emulator**, please visit the ConEmu issues page: - + https://github.com/Maximus5/ConEmu/issues?q=is:issue - + If there isn't an existing issue, you may open a new one there. - - (We don't resolve issues regarding ConEmu here, so please + + (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 would like to ask for guides on how to integrate Cmder with your favorite IDE of choice, or how to perform a specific 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 you have a request to provide auto-complete support for a new tool, please post your request here: - + https://github.com/vladimir-kotikov/clink-completions/issues - + • If you are having an issue with any of the **upstream technologies** that are used by Cmder, please make sure that the issue is reproducible _only_ when used in combination with Cmder. - + We may not directly address the issues related to the following tools: - Clink, the default shell in Cmder - ConEmu, the terminal emulator - Git/MinGW, which also provide *NIX tools - clink-completions, which provide autocompletion - + The issues related to upstream technologies are labeled as 👆 [name]. - + We'll try our best to help you -- but we recommend creating an issue specifically at each of the corresponding repositories for the best result. - + ► Try to reproduce the bug you're reporting, on a stand-alone edition of each tool, without using 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. - + • Lastly, have a look at official documentation for Cmder over our website, and our wiki. 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! ♥ - + --> - -### Description of the issue +### Description of the issue diff --git a/vendor/user_aliases.cmd.default b/vendor/user_aliases.cmd.default index 5279705..4221684 100644 --- a/vendor/user_aliases.cmd.default +++ b/vendor/user_aliases.cmd.default @@ -9,7 +9,7 @@ gl=git log --oneline --all --graph --decorate $* ls=ls --show-control-chars -F --color $* pwd=cd clear=cls -history=cat -n %CMDER_ROOT%\config\.history +history=cat -n "%CMDER_ROOT%\config\.history" unalias=alias /d $1 vi=vim $* cmderr=cd /d "%CMDER_ROOT%" From 13de4924ca3ca0426db5bbb0febfc4a6ca91aeb5 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sun, 31 Mar 2019 16:47:36 -0400 Subject: [PATCH 12/30] make powershell use of bash commands more bash like --- vendor/profile.ps1 | 50 ++++++++++++++++++++------------- vendor/user_profile.ps1.default | 17 +++++++++++ 2 files changed, 47 insertions(+), 20 deletions(-) diff --git a/vendor/profile.ps1 b/vendor/profile.ps1 index 498bdc0..781cba6 100644 --- a/vendor/profile.ps1 +++ b/vendor/profile.ps1 @@ -36,26 +36,21 @@ if(-not $moduleInstallerAvailable -and -not $env:PSModulePath.Contains($CmderMod $env:PSModulePath = $env:PSModulePath.Insert(0, "$CmderModulePath;") } -try { - Get-command -Name "vim" -ErrorAction Stop >$null -} catch { - # # You could do this but it may be a little drastic and introduce a lot of - # # unix tool overlap with powershel unix like aliases - # $env:Path += $(";" + $env:CMDER_ROOT + "\vendor\git-for-windows\usr\bin") - # set-alias -name "vi" -value "vim" - # # I think the below is safer. +function Configure-Git($GIT_INSTALL_ROOT){ + $env:Path += $(";" + $GIT_INSTALL_ROOT + "\cmd") - new-alias -name "vim" -value $($ENV:CMDER_ROOT + "\vendor\git-for-windows\usr\bin\vim.exe") - new-alias -name "vi" -value vim -} - -try { - # Check if git is on PATH, i.e. Git already installed on system - Get-command -Name "git" -ErrorAction Stop >$null -} catch { - $env:Path += $(";" + $env:CMDER_ROOT + "\vendor\git-for-windows\cmd") - # for bash.exe, which in the cmd version is found as \usr\bin\bash.exe - $env:Path += $(";" + $env:CMDER_ROOT + "\vendor\git-for-windows\bin") + # Add "$GIT_INSTALL_ROOT\usr\bin" to the path if exists and not done already + $GIT_INSTALL_ROOT_ESC=$GIT_INSTALL_ROOT.replace('\','\\') + if ((test-path "$GIT_INSTALL_ROOT\usr\bin") -and -not ($env:path -match "$GIT_INSTALL_ROOT_ESC\\usr\\bin")) { + $env:path = "$env:path;$GIT_INSTALL_ROOT\usr\bin" + } + + # Add "$GIT_INSTALL_ROOT\mingw[32|64]\bin" to the path if exists and not done already + if ((test-path "$GIT_INSTALL_ROOT\mingw32\bin") -and -not ($env:path -match "$GIT_INSTALL_ROOT_ESC\\mingw32\\bin")) { + $env:path = "$env:path;$GIT_INSTALL_ROOT\mingw32\bin" + } elseif ((test-path "$GIT_INSTALL_ROOT\mingw64\bin") -and -not ($env:path -match "$GIT_INSTALL_ROOT_ESC\\mingw64\\bin")) { + $env:path = "$env:path;$GIT_INSTALL_ROOT\mingw64\bin" + } } $gitLoaded = $false @@ -84,6 +79,19 @@ function checkGit($Path) { } } +try { + # Check if git is on PATH, i.e. Git already installed on system + Get-command -Name "git" -ErrorAction Stop >$null +} catch { + if (test-path "$env:CMDER_ROOT\vendor\git-for-windows") { + Configure-Git "$env:CMDER_ROOT\vendor\git-for-windows" + } +} + +if ( Get-command -Name "vim" -ErrorAction silentlycontinue) { + new-alias -name "vi" -value vim +} + if (Get-Module PSReadline -ErrorAction "SilentlyContinue") { Set-PSReadlineOption -ExtraPromptLineCount 1 } @@ -170,7 +178,9 @@ if ( $(get-command prompt).Definition -match 'PS \$\(\$executionContext.SessionS [ScriptBlock]$CmderPrompt = { $Host.UI.RawUI.ForegroundColor = "White" Microsoft.PowerShell.Utility\Write-Host $pwd.ProviderPath -NoNewLine -ForegroundColor Green - checkGit($pwd.ProviderPath) + if (get-command git -erroraction silentlycontinue) { + checkGit($pwd.ProviderPath) + } } <# diff --git a/vendor/user_profile.ps1.default b/vendor/user_profile.ps1.default index b85ebee..27cc47b 100644 --- a/vendor/user_profile.ps1.default +++ b/vendor/user_profile.ps1.default @@ -23,3 +23,20 @@ ## +# Delete default powershell aliases that conflict with bash commands +# If you prefer the powershell aliases remove this. +if (get-command git) { + del -force alias:cat + del -force alias:clear + del -force alias:cp + del -force alias:diff + del -force alias:echo + del -force alias:kill + del -force alias:ls + del -force alias:mv + del -force alias:ps + del -force alias:pwd + del -force alias:rm + del -force alias:sleep + del -force alias:tee +} From a813e359c5c75d819b6c166c40c968dc2037101e Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Mon, 1 Apr 2019 09:09:32 -0400 Subject: [PATCH 13/30] don't delete aliases by default but provide an easy way for users to do so. --- vendor/bin/alias.cmd | 46 ++++++++++++++++++++++++++------- vendor/user_profile.ps1.default | 33 ++++++++++++----------- 2 files changed, 52 insertions(+), 27 deletions(-) diff --git a/vendor/bin/alias.cmd b/vendor/bin/alias.cmd index 1a1739d..8e10d1d 100644 --- a/vendor/bin/alias.cmd +++ b/vendor/bin/alias.cmd @@ -48,6 +48,9 @@ goto parseargument set _x=%* ) ) + +echo _x=%_x% + rem #endregion parseargument if "%ALIASES%" neq "%CMDER_ROOT%\config\user_aliases.cmd" ( @@ -63,18 +66,41 @@ if "%ALIASES%" neq "%CMDER_ROOT%\config\user_aliases.cmd" ( ) ) -:: validate alias -for /f "delims== tokens=1,* usebackq" %%G in (`echo "%_x%"`) do ( - set alias_name=%%G - set alias_value=%%H +:: create with multiple parameters +if [%1] == [create] ( + if not [%2] == [] ( + if not [%3] == [] ( + set _x=%1=%2 + :: if command create was submitted + set alias_name=%~2 + shift + shift + echo %* + set alias_value=%* + + for /f "tokens=1,2,* usebackq" %%G in (`echo %*`) do ( + set alias_name=%%H + set alias_value=%%I + ) + ) + ) +) else ( + :: validate alias + echo %_x% + set x=!_x:%=^^%! + echo !_x! + for /f "delims== tokens=1,* usebackq" %%G in (`echo "!_x!"`) do ( + set alias_name=%%G + set alias_value=%%H + ) + + :: leading quotes added while validating + set alias_name=!alias_name:~1! + + :: trailing quotes added while validating + set alias_value=!alias_value:~1,-1! ) -:: leading quotes added while validating -set alias_name=%alias_name:~1% - -:: trailing quotes added while validating -set alias_value=%alias_value:~0,-1% - ::remove spaces set _temp=%alias_name: =% diff --git a/vendor/user_profile.ps1.default b/vendor/user_profile.ps1.default index 27cc47b..8ed5b81 100644 --- a/vendor/user_profile.ps1.default +++ b/vendor/user_profile.ps1.default @@ -23,20 +23,19 @@ ## -# Delete default powershell aliases that conflict with bash commands -# If you prefer the powershell aliases remove this. -if (get-command git) { - del -force alias:cat - del -force alias:clear - del -force alias:cp - del -force alias:diff - del -force alias:echo - del -force alias:kill - del -force alias:ls - del -force alias:mv - del -force alias:ps - del -force alias:pwd - del -force alias:rm - del -force alias:sleep - del -force alias:tee -} +# # Delete default powershell aliases that conflict with bash commands +# if (get-command git) { +# del -force alias:cat +# del -force alias:clear +# del -force alias:cp +# del -force alias:diff +# del -force alias:echo +# del -force alias:kill +# del -force alias:ls +# del -force alias:mv +# del -force alias:ps +# del -force alias:pwd +# del -force alias:rm +# del -force alias:sleep +# del -force alias:tee +# } From 3e40c803311292055e2e74132d184706b5d19e4f Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Mon, 1 Apr 2019 16:58:45 -0400 Subject: [PATCH 14/30] new alias create syntax --- vendor/bin/alias.cmd | 82 +++++++++++++++++++++++++++++++++----------- 1 file changed, 62 insertions(+), 20 deletions(-) diff --git a/vendor/bin/alias.cmd b/vendor/bin/alias.cmd index 1a1739d..ee64ad4 100644 --- a/vendor/bin/alias.cmd +++ b/vendor/bin/alias.cmd @@ -14,6 +14,8 @@ if "%~1" == "" echo Use /? for help & echo. & goto :p_show rem #region parseargument goto parseargument +set args= + :do_shift shift @@ -22,10 +24,15 @@ goto parseargument if /i "%currentarg%" equ "/f" ( set ALIASES=%~2 + set ALT_ALIASES=%~2 shift goto :do_shift ) else if /i "%currentarg%" == "/reload" ( goto :p_reload + ) else if "%currentarg%" equ "/H" ( + goto :p_help + ) else if "%currentarg%" equ "/h" ( + goto :p_help ) else if "%currentarg%" equ "/?" ( goto :p_help ) else if /i "%currentarg%" equ "/d" ( @@ -43,11 +50,28 @@ goto parseargument doskey /macros | %WINDIR%\System32\findstr /b %currentarg%= && exit /b echo insufficient parameters. goto :p_help + ) else if "%currentarg%" == "create" ( + set action=create + if [%ALT_ALIASES%] neq [] ( + echo 1 + for /f "tokens=1,2,3,* usebackq" %%G in (`echo %*`) do ( + set args=%%J + ) + ) else ( + echo 2 + for /f "tokens=1,2,* usebackq" %%G in (`echo %*`) do ( + set args=%%H %%I + ) + ) ) else ( :: handle quotes within command definition, e.g. quoted long file names set _x=%* ) ) + +:: echo _x=%_x% +:: echo args=%args% + rem #endregion parseargument if "%ALIASES%" neq "%CMDER_ROOT%\config\user_aliases.cmd" ( @@ -63,25 +87,38 @@ if "%ALIASES%" neq "%CMDER_ROOT%\config\user_aliases.cmd" ( ) ) -:: validate alias -for /f "delims== tokens=1,* usebackq" %%G in (`echo "%_x%"`) do ( - set alias_name=%%G - set alias_value=%%H +:: create with multiple parameters +if [%action%] == [create] ( + if not ["%args%"] == [""] ( + for /f "tokens=1,* usebackq" %%G in (`echo %args%`) do ( + set alias_name=%%G + set alias_value=%%H + ) + ) +) else ( + :: validate alias + echo %_x% + set x=!_x:%=^^%! + echo !_x! + for /f "delims== tokens=1,* usebackq" %%G in (`echo "!_x!"`) do ( + set alias_name=%%G + set alias_value=%%H + ) + + :: leading quotes added while validating + set alias_name=!alias_name:~1! + + :: trailing quotes added while validating + set alias_value=!alias_value:~1,-1! ) -:: leading quotes added while validating -set alias_name=%alias_name:~1% - -:: trailing quotes added while validating -set alias_value=%alias_value:~0,-1% - ::remove spaces set _temp=%alias_name: =% if not ["%_temp%"] == ["%alias_name%"] ( - echo Your alias name can not contain a space - endlocal - exit /b + echo Your alias name can not contain a space + endlocal + exit /b ) :: replace already defined alias @@ -111,21 +148,26 @@ exit /b :p_help echo.Usage: echo. -echo. alias [options] [alias=full command] +echo. alias [options] [alias=alias command] or [[create [alias] [alias command]]] echo. echo.Options: echo. +echo. Note: Options MUST precede the alias definition. +echo. echo. /d [alias] Delete an [alias]. echo. /f [macrofile] Path to the [macrofile] you want to store the new alias in. echo. Default: %cmder_root%\config\user_aliases.cmd echo. /reload Reload the aliases file. Can be used with /f argument. echo. Default: %cmder_root%\config\user_aliases.cmd echo. -echo. If alias is called with no parameters, it will display the list of existing aliases. +echo. If alias is called with no parameters, it will display the list of existing aliases. echo. -echo. In the command, you can use the following notations: -echo. $* allows the alias to assume all the parameters of the supplied command. -echo. $1-$9 Allows you to seperate parameter by number, much like %%1 in batch. -echo. $T is the command seperator, allowing you to string several commands together into one alias. -echo. For more information, read DOSKEY/? +echo. In the alias command, you can use the following notations: +echo. +echo. ^^^^^^^^%% - '%%' in env vars must be escaped if preserving the variable in the alias is desired. +echo. $* - allows the alias to assume all the parameters of the supplied command. +echo. $1-$9 - Allows you to seperate parameter by number, much like %%1 in batch. +echo. $T - Command seperator, allowing you to string several commands together into one alias. +echo. +echo. For more information, read DOSKEY /? exit /b From 67b374ad378bee1b9157b9a0b20c8e667ec6c6da Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Mon, 1 Apr 2019 17:09:05 -0400 Subject: [PATCH 15/30] revert alias.cmd changes --- vendor/bin/alias.cmd | 46 ++++++++++---------------------------------- 1 file changed, 10 insertions(+), 36 deletions(-) diff --git a/vendor/bin/alias.cmd b/vendor/bin/alias.cmd index 8e10d1d..1a1739d 100644 --- a/vendor/bin/alias.cmd +++ b/vendor/bin/alias.cmd @@ -48,9 +48,6 @@ goto parseargument set _x=%* ) ) - -echo _x=%_x% - rem #endregion parseargument if "%ALIASES%" neq "%CMDER_ROOT%\config\user_aliases.cmd" ( @@ -66,41 +63,18 @@ if "%ALIASES%" neq "%CMDER_ROOT%\config\user_aliases.cmd" ( ) ) -:: create with multiple parameters -if [%1] == [create] ( - if not [%2] == [] ( - if not [%3] == [] ( - set _x=%1=%2 - :: if command create was submitted - set alias_name=%~2 - shift - shift - echo %* - set alias_value=%* - - for /f "tokens=1,2,* usebackq" %%G in (`echo %*`) do ( - set alias_name=%%H - set alias_value=%%I - ) - ) - ) -) else ( - :: validate alias - echo %_x% - set x=!_x:%=^^%! - echo !_x! - for /f "delims== tokens=1,* usebackq" %%G in (`echo "!_x!"`) do ( - set alias_name=%%G - set alias_value=%%H - ) - - :: leading quotes added while validating - set alias_name=!alias_name:~1! - - :: trailing quotes added while validating - set alias_value=!alias_value:~1,-1! +:: validate alias +for /f "delims== tokens=1,* usebackq" %%G in (`echo "%_x%"`) do ( + set alias_name=%%G + set alias_value=%%H ) +:: leading quotes added while validating +set alias_name=%alias_name:~1% + +:: trailing quotes added while validating +set alias_value=%alias_value:~0,-1% + ::remove spaces set _temp=%alias_name: =% From cf134604bb465673de068bea6a14a9a318952905 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Mon, 1 Apr 2019 17:31:46 -0400 Subject: [PATCH 16/30] fixes --- vendor/bin/alias.cmd | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/vendor/bin/alias.cmd b/vendor/bin/alias.cmd index 5000dc7..9d58ecc 100644 --- a/vendor/bin/alias.cmd +++ b/vendor/bin/alias.cmd @@ -24,7 +24,6 @@ set args= if /i "%currentarg%" equ "/f" ( set ALIASES=%~2 - set ALT_ALIASES=%~2 shift goto :do_shift ) else if /i "%currentarg%" == "/reload" ( @@ -52,13 +51,11 @@ set args= goto :p_help ) else if "%currentarg%" == "create" ( set action=create - if [%ALT_ALIASES%] neq [] ( - echo 1 + if ["%ALIASES%"] neq ["%CMDER_ROOT%\config\user_aliases.cmd"] ( for /f "tokens=1,2,3,* usebackq" %%G in (`echo %*`) do ( set args=%%J ) ) else ( - echo 2 for /f "tokens=1,2,* usebackq" %%G in (`echo %*`) do ( set args=%%H %%I ) @@ -85,29 +82,11 @@ if "%ALIASES%" neq "%CMDER_ROOT%\config\user_aliases.cmd" ( ) :: create with multiple parameters -<<<<<<< HEAD if [%action%] == [create] ( if not ["%args%"] == [""] ( for /f "tokens=1,* usebackq" %%G in (`echo %args%`) do ( set alias_name=%%G set alias_value=%%H -======= -if [%1] == [create] ( - if not [%2] == [] ( - if not [%3] == [] ( - set _x=%1=%2 - :: if command create was submitted - set alias_name=%~2 - shift - shift - echo %* - set alias_value=%* - - for /f "tokens=1,2,* usebackq" %%G in (`echo %*`) do ( - set alias_name=%%H - set alias_value=%%I - ) ->>>>>>> ac2082d56d59b3731824e11227eae396278b9f37 ) ) ) else ( From f20eca01ac386dd0d930376ece307f3b87482de2 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Mon, 1 Apr 2019 17:34:00 -0400 Subject: [PATCH 17/30] fixes --- vendor/bin/alias.cmd.orig | 183 -------------------------------------- 1 file changed, 183 deletions(-) delete mode 100644 vendor/bin/alias.cmd.orig diff --git a/vendor/bin/alias.cmd.orig b/vendor/bin/alias.cmd.orig deleted file mode 100644 index e915e6b..0000000 --- a/vendor/bin/alias.cmd.orig +++ /dev/null @@ -1,183 +0,0 @@ -@echo off - - -if "%ALIASES%" == "" ( - set ALIASES="%CMDER_ROOT%\config\user_aliases.cmd" -) - -setlocal enabledelayedexpansion - -if "%~1" == "" echo Use /? for help & echo. & goto :p_show - -:: check command usage - -rem #region parseargument -goto parseargument - -set args= - -:do_shift - shift - -:parseargument - set currentarg=%~1 - - if /i "%currentarg%" equ "/f" ( - set ALIASES=%~2 - shift - goto :do_shift - ) else if /i "%currentarg%" == "/reload" ( - goto :p_reload - ) else if "%currentarg%" equ "/H" ( - goto :p_help - ) else if "%currentarg%" equ "/h" ( - goto :p_help - ) else if "%currentarg%" equ "/?" ( - goto :p_help - ) else if /i "%currentarg%" equ "/d" ( - if "%~2" neq "" ( - if "%~3" equ "" ( - :: /d flag for delete existing alias - call :p_del %~2 - shift - goto :eof - ) - ) - ) else if "%currentarg%" neq "" ( - if "%~2" equ "" ( - :: Show the specified alias - doskey /macros | %WINDIR%\System32\findstr /b %currentarg%= && exit /b - echo insufficient parameters. - goto :p_help - ) else if "%currentarg%" == "create" ( - set action=create - if ["%ALIASES%"] neq ["%CMDER_ROOT%\config\user_aliases.cmd"] ( - for /f "tokens=1,2,3,* usebackq" %%G in (`echo %*`) do ( - set args=%%J - ) - ) else ( - for /f "tokens=1,2,* usebackq" %%G in (`echo %*`) do ( - set args=%%H %%I - ) - ) - ) else ( - :: handle quotes within command definition, e.g. quoted long file names - set _x=%* - ) - ) -<<<<<<< HEAD - -======= ->>>>>>> 67b374ad378bee1b9157b9a0b20c8e667ec6c6da -rem #endregion parseargument - -if "%ALIASES%" neq "%CMDER_ROOT%\config\user_aliases.cmd" ( - set _x=!_x:/f "%ALIASES%" =! - - if not exist "%ALIASES%" ( - echo ;= @echo off>"%ALIASES%" - echo ;= rem Call DOSKEY and use this file as the macrofile>>"%ALIASES%" - echo ;= %%SystemRoot%%\system32\doskey /listsize=1000 /macrofile=%%0%%>>"%ALIASES%" - echo ;= rem In batch mode, jump to the end of the file>>"%ALIASES%" - echo ;= goto:eof>>"%ALIASES%" - echo ;= Add aliases below here>>"%ALIASES%" - ) -) - -<<<<<<< HEAD -:: create with multiple parameters -if [%action%] == [create] ( - if not ["%args%"] == [""] ( - for /f "tokens=1,* usebackq" %%G in (`echo %args%`) do ( - set alias_name=%%G - set alias_value=%%H - ) - ) -) else ( - :: validate alias - echo %_x% - set x=!_x:%=^^%! - echo !_x! - for /f "delims== tokens=1,* usebackq" %%G in (`echo "!_x!"`) do ( - set alias_name=%%G - set alias_value=%%H - ) - - :: leading quotes added while validating - set alias_name=!alias_name:~1! - - :: trailing quotes added while validating - set alias_value=!alias_value:~1,-1! -======= -:: validate alias -for /f "delims== tokens=1,* usebackq" %%G in (`echo "%_x%"`) do ( - set alias_name=%%G - set alias_value=%%H ->>>>>>> 67b374ad378bee1b9157b9a0b20c8e667ec6c6da -) - -:: leading quotes added while validating -set alias_name=%alias_name:~1% - -:: trailing quotes added while validating -set alias_value=%alias_value:~0,-1% - -::remove spaces -set _temp=%alias_name: =% - -if not ["%_temp%"] == ["%alias_name%"] ( - echo Your alias name can not contain a space - endlocal - exit /b -) - -:: replace already defined alias -%WINDIR%\System32\findstr /b /v /i "%alias_name%=" "%ALIASES%" >> "%ALIASES%.tmp" -echo %alias_name%=%alias_value% >> "%ALIASES%.tmp" && type "%ALIASES%.tmp" > "%ALIASES%" & @del /f /q "%ALIASES%.tmp" -doskey /macrofile="%ALIASES%" -endlocal -exit /b - -:p_del -set del_alias=%~1 -%WINDIR%\System32\findstr /b /v /i "%del_alias%=" "%ALIASES%" >> "%ALIASES%.tmp" -type "%ALIASES%".tmp > "%ALIASES%" & @del /f /q "%ALIASES%.tmp" -doskey %del_alias%= -doskey /macrofile="%ALIASES%" -goto:eof - -:p_reload -doskey /macrofile="%ALIASES%" -echo Aliases reloaded -exit /b - -:p_show -doskey /macros|%WINDIR%\System32\findstr /v /r "^;=" | sort -exit /b - -:p_help -echo.Usage: -echo. -echo. alias [options] [alias=alias command] or [[create [alias] [alias command]]] -echo. -echo.Options: -echo. -echo. Note: Options MUST precede the alias definition. -echo. -echo. /d [alias] Delete an [alias]. -echo. /f [macrofile] Path to the [macrofile] you want to store the new alias in. -echo. Default: %cmder_root%\config\user_aliases.cmd -echo. /reload Reload the aliases file. Can be used with /f argument. -echo. Default: %cmder_root%\config\user_aliases.cmd -echo. -echo. If alias is called with no parameters, it will display the list of existing aliases. -echo. -echo. In the alias command, you can use the following notations: -echo. -echo. ^^^^^^^^%% - '%%' in env vars must be escaped if preserving the variable in the alias is desired. -echo. $* - allows the alias to assume all the parameters of the supplied command. -echo. $1-$9 - Allows you to seperate parameter by number, much like %%1 in batch. -echo. $T - Command seperator, allowing you to string several commands together into one alias. -echo. -echo. For more information, read DOSKEY /? -exit /b From 528bbea7f5f54fe7a152e50382d7ba97eac66ed3 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Mon, 1 Apr 2019 22:10:21 -0400 Subject: [PATCH 18/30] fixes --- vendor/bin/alias.cmd | 51 ++++++++++++++++++-------------------------- 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/vendor/bin/alias.cmd b/vendor/bin/alias.cmd index 149996a..502c11a 100644 --- a/vendor/bin/alias.cmd +++ b/vendor/bin/alias.cmd @@ -14,8 +14,6 @@ if "%~1" == "" echo Use /? for help & echo. & goto :p_show rem #region parseargument goto parseargument -set args= - :do_shift shift @@ -24,6 +22,7 @@ set args= if /i "%currentarg%" equ "/f" ( set ALIASES=%~2 + set _f=%~2 shift goto :do_shift ) else if /i "%currentarg%" == "/reload" ( @@ -50,19 +49,27 @@ set args= echo insufficient parameters. goto :p_help ) else if "%currentarg%" == "create" ( + set _x=%* + + set _x=!_x:^^=^^^^! set action=create - if ["%ALIASES%"] neq ["%CMDER_ROOT%\config\user_aliases.cmd"] ( - for /f "tokens=1,2,3,* usebackq" %%G in (`echo %*`) do ( - set args=%%J + if ["%_f%"] neq [""] ( + for /f "tokens=1,2,3,* usebackq" %%G in (`echo !_x!`) do ( + set _x=%%J ) ) else ( - for /f "tokens=1,2,* usebackq" %%G in (`echo %*`) do ( - set args=%%H %%I + for /f "tokens=1,2,* usebackq" %%G in (`echo !_x!`) do ( + set _x=%%H %%I ) ) ) else ( - :: handle quotes within command definition, e.g. quoted long file names set _x=%* + if ["%_f%"] neq [""] ( + set _x=!_x:^^=^^^^! + for /f "tokens=1,2,* usebackq" %%G in (`echo !_x!`) do ( + set _x=%%I + ) + ) ) ) @@ -81,20 +88,16 @@ if "%ALIASES%" neq "%CMDER_ROOT%\config\user_aliases.cmd" ( ) ) -<<<<<<< HEAD :: create with multiple parameters if [%action%] == [create] ( - if not ["%args%"] == [""] ( - for /f "tokens=1,* usebackq" %%G in (`echo %args%`) do ( - set alias_name=%%G - set alias_value=%%H - ) + for /f "tokens=1,* usebackq" %%G in (`echo !_x!`) do ( + set alias_name=%%G + set alias_value=%%H ) ) else ( :: validate alias - echo %_x% - set x=!_x:%=^^%! - echo !_x! + rem set _x=!_x:%=^^%! + for /f "delims== tokens=1,* usebackq" %%G in (`echo "!_x!"`) do ( set alias_name=%%G set alias_value=%%H @@ -104,21 +107,9 @@ if [%action%] == [create] ( set alias_name=!alias_name:~1! :: trailing quotes added while validating - set alias_value=!alias_value:~1,-1! -======= -:: validate alias -for /f "delims== tokens=1,* usebackq" %%G in (`echo "%_x%"`) do ( - set alias_name=%%G - set alias_value=%%H ->>>>>>> 67b374ad378bee1b9157b9a0b20c8e667ec6c6da + set alias_value=!alias_value:~0,-1! ) -:: leading quotes added while validating -set alias_name=%alias_name:~1% - -:: trailing quotes added while validating -set alias_value=%alias_value:~0,-1% - ::remove spaces set _temp=%alias_name: =% From ab3f0b76fb5506bff818cee0184b0dc09344475f Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Mon, 1 Apr 2019 22:17:53 -0400 Subject: [PATCH 19/30] fixes --- vendor/bin/alias.cmd | 2 -- 1 file changed, 2 deletions(-) diff --git a/vendor/bin/alias.cmd b/vendor/bin/alias.cmd index 502c11a..999e5a0 100644 --- a/vendor/bin/alias.cmd +++ b/vendor/bin/alias.cmd @@ -96,8 +96,6 @@ if [%action%] == [create] ( ) ) else ( :: validate alias - rem set _x=!_x:%=^^%! - for /f "delims== tokens=1,* usebackq" %%G in (`echo "!_x!"`) do ( set alias_name=%%G set alias_value=%%H From 52eea5fe9ff5264581bf825d718fa0d3b7a3147f Mon Sep 17 00:00:00 2001 From: Joshua Webb Date: Fri, 19 Apr 2019 16:16:45 +1000 Subject: [PATCH 20/30] Close file handles in clink.lua --- vendor/clink.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/vendor/clink.lua b/vendor/clink.lua index d5f6876..d39a5ac 100644 --- a/vendor/clink.lua +++ b/vendor/clink.lua @@ -189,12 +189,15 @@ end -- @return {false|mercurial branch name} --- local function get_hg_branch() - for line in io.popen("hg branch 2>nul"):lines() do + local file = io.popen("hg branch 2>nul") + for line in file:lines() do local m = line:match("(.+)$") if m then + file:close() return m end end + file:close() return false end @@ -204,12 +207,15 @@ end -- @return {false|svn branch name} --- local function get_svn_branch(svn_dir) - for line in io.popen("svn info 2>nul"):lines() do + local file = io.popen("svn info 2>nul") + for line in file:lines() do local m = line:match("^Relative URL:") if m then + file:close() return line:sub(line:find("/")+1,line:len()) end end + file:close() return false end From 9b9bb13f6a694e366c076b94f7726b8a18b3e2b1 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sun, 5 May 2019 17:06:44 -0400 Subject: [PATCH 21/30] fix commnd line help --- vendor/bin/alias.cmd | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/vendor/bin/alias.cmd b/vendor/bin/alias.cmd index 999e5a0..e5269f5 100644 --- a/vendor/bin/alias.cmd +++ b/vendor/bin/alias.cmd @@ -144,26 +144,36 @@ exit /b :p_help echo.Usage: echo. -echo. alias [options] [alias=alias command] or [[create [alias] [alias command]]] +echo. alias [options] [alias=alias command] +echo. +echo OR +echo. +echo. alias create [alias] [alias command] echo. echo.Options: echo. -echo. Note: Options MUST precede the alias definition. +echo. Note: Options MUST precede the alias definition. echo. -echo. /d [alias] Delete an [alias]. -echo. /f [macrofile] Path to the [macrofile] you want to store the new alias in. -echo. Default: %cmder_root%\config\user_aliases.cmd -echo. /reload Reload the aliases file. Can be used with /f argument. -echo. Default: %cmder_root%\config\user_aliases.cmd +echo. /d [alias] Delete an [alias]. +echo. /f [macrofile] Path to the [macrofile] you want to store the new alias in. +echo. Default: %cmder_root%\config\user_aliases.cmd +echo. /reload Reload the aliases file. Can be used with /f argument. +echo. Default: %cmder_root%\config\user_aliases.cmd echo. -echo. If alias is called with no parameters, it will display the list of existing aliases. +echo. If alias is called with no parameters, it will display the list of existing +echo. aliases. echo. echo. In the alias command, you can use the following notations: echo. -echo. ^^^^^^^^%% - '%%' in env vars must be escaped if preserving the variable in the alias is desired. -echo. $* - allows the alias to assume all the parameters of the supplied command. -echo. $1-$9 - Allows you to seperate parameter by number, much like %%1 in batch. -echo. $T - Command seperator, allowing you to string several commands together into one alias. +echo. ^^^^^^^^%% - %% signs in env vars must be escaped if preserving the variable +echo. in he alias is desired. Variables in aliases surrounded by double +echo. quotes only require '^^%%' vs '^^^^^^^^%%' +echo. $* - allows the alias to assume all the parameters of the supplied +echo. command. +echo. $1-$9 - Allows you to seperate parameter by number, much like %%1 in +echo. batch. +echo. $T - Command seperator, allowing you to string several commands +echo. together into one alias. echo. echo. For more information, read DOSKEY /? exit /b From 5f9f3560c8cb6798230d06ca2c517ebf4b481020 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sun, 5 May 2019 17:11:31 -0400 Subject: [PATCH 22/30] fix commnd line help --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34ae8ed..bde41af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,13 @@ * Turn this on in existing Cmder using `clink set history_io 1` * Allow clink disable by setting CMDER_CLINK=0 before starting task +### Adds + +* Pull Request: [#2072](https://github.com/cmderdev/cmder/pull/2072) + * New alias create [alias] [alias command] syntax + * Based on [#1750](https://github.com/cmderdev/cmder/pull/1750) + * Syntax: `alias create [alias] [alias command]` + ## [1.3.11](https://github.com/cmderdev/cmder/tree/v1.3.11) (2018-12-22) ### Fixes From 5e5e0ece7364f739db5c06af2960f66a8015d1df Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sun, 5 May 2019 17:25:47 -0400 Subject: [PATCH 23/30] CHANGELog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 34ae8ed..6b0f875 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ * Provide default settings for Clink that updates the history file in real time * Turn this on in existing Cmder using `clink set history_io 1` * Allow clink disable by setting CMDER_CLINK=0 before starting task +* Pull Request: [#2068](https://github.com/cmderdev/cmder/pull/2068) + * Print Index in History Command Output. + * Sets default `history_expand_mode = 3` in initial Clink Settings. ## [1.3.11](https://github.com/cmderdev/cmder/tree/v1.3.11) (2018-12-22) From 893207453dd388915110150bdecea8365da392b3 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sun, 5 May 2019 17:27:25 -0400 Subject: [PATCH 24/30] CHANGELog --- vendor/init.bat | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vendor/init.bat b/vendor/init.bat index 20676f6..5cc29ab 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -51,9 +51,7 @@ call "%cmder_root%\vendor\lib\lib_profile" ) else if /i "%1"=="/v" ( set verbose_output=1 ) else if /i "%1"=="/d" ( - if not defined VSCODE_CWD ( - set debug_output=1 - ) + set debug_output=1 ) else if /i "%1" == "/max_depth" ( if "%~2" geq "1" if "%~2" leq "5" ( set "max_depth=%~2" From 5def1c584ae76089fef514f60e6ddfb90b447d78 Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 12 May 2019 15:18:15 +0200 Subject: [PATCH 25/30] Add FWPARS cmdline argument. This argument forwards parameters to ConEmu app. e.g. Cmder.exe /FWPARS "-min -tsa" In this case Cmder will start minimized on TaskBar --- README.md | 1 + launcher/src/CmderLauncher.cpp | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d624972..4b9940f 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ The Cmder's user interface is also designed to be more eye pleasing, and you can | `/SINGLE` | Start Cmder in single mode. | | `/START [start_path]` | Folder path to start in. | | `/TASK [task_name]` | Task to start after launch. | +| `/FWPARS [ConEmu params]` | Forwads parameters to ConEmu | ## Context Menu Integration diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index e399a47..2490bb3 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -71,7 +71,7 @@ bool FileExists(const wchar_t * filePath) return false; } -void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstring taskName = L"", std::wstring cfgRoot = L"", bool use_user_cfg = true) +void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstring taskName = L"", std::wstring cfgRoot = L"", bool use_user_cfg = true, std::wstring pars2fw = L"") { #if USE_TASKBAR_API wchar_t appId[MAX_PATH] = { 0 }; @@ -98,6 +98,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr std::wstring cmderStart = path; std::wstring cmderTask = taskName; + std::wstring cmderPars2CEmu = pars2fw; std::copy(cfgRoot.begin(), cfgRoot.end(), userConfigDirPath); userConfigDirPath[cfgRoot.length()] = 0; @@ -391,6 +392,11 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr swprintf_s(args, L"%s -loadcfgfile \"%s\"", args, userConEmuCfgPath); } + if (!streqi(cmderPars2CEmu.c_str(), L"")) + { + swprintf_s(args, L"%s %s", args, cmderPars2CEmu.c_str()); + } + SetEnvironmentVariable(L"CMDER_ROOT", exeDir); if (wcscmp(userConfigDirPath, configDirPath) != 0) { @@ -527,6 +533,7 @@ struct cmderOptions std::wstring cmderStart = L""; std::wstring cmderTask = L""; std::wstring cmderRegScope = L"USER"; + std::wstring cmderPars2CEmu = L""; bool cmderSingle = false; bool cmderUserCfg = true; bool registerApp = false; @@ -620,6 +627,11 @@ cmderOptions GetOption() } } } + else if (_wcsicmp(L"/fwpars", szArgList[i]) == 0) + { + cmderOptions.cmderPars2CEmu = szArgList[i + 1]; + i++; + } else if (cmderOptions.cmderStart == L"") { int len = wcslen(szArgList[i]); @@ -635,13 +647,13 @@ cmderOptions GetOption() } else { - MessageBox(NULL, L"Unrecognized parameter.\n\nValid options:\n\n /c [CMDER User Root Path]\n\n /task [ConEmu Task Name]\n\n [/start [Start in Path] | [Start in Path]]\n\n /single\n\n /m\n\nor\n\n /register [USER | ALL]\n\nor\n\n /unregister [USER | ALL]\n", MB_TITLE, MB_OK); + MessageBox(NULL, L"Unrecognized parameter.\n\nValid options:\n\n /c [CMDER User Root Path]\n\n /task [ConEmu Task Name]\n\n [/start [Start in Path] | [Start in Path]]\n\n /single\n\n /m\n\n /fwpars [ConEmu parameters to fw]\n\nor\n\n /register [USER | ALL]\n\nor\n\n /unregister [USER | ALL]\n", MB_TITLE, MB_OK); cmderOptions.error = true; } } else { - MessageBox(NULL, L"Unrecognized parameter.\n\nValid options:\n\n /c [CMDER User Root Path]\n\n /task [ConEmu Task Name]\n\n [/start [Start in Path] | [Start in Path]]\n\n /single\n\n /m\n\nor\n\n /register [USER | ALL]\n\nor\n\n /unregister [USER | ALL]\n", MB_TITLE, MB_OK); + MessageBox(NULL, L"Unrecognized parameter.\n\nValid options:\n\n /c [CMDER User Root Path]\n\n /task [ConEmu Task Name]\n\n [/start [Start in Path] | [Start in Path]]\n\n /single\n\n /m\n\n /fwpars [ConEmu parameters to fw]\n\nor\n\n /register [USER | ALL]\n\nor\n\n /unregister [USER | ALL]\n", MB_TITLE, MB_OK); cmderOptions.error = true; } } @@ -683,7 +695,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, } else { - StartCmder(cmderOptions.cmderStart, cmderOptions.cmderSingle, cmderOptions.cmderTask, cmderOptions.cmderCfgRoot, cmderOptions.cmderUserCfg); + StartCmder(cmderOptions.cmderStart, cmderOptions.cmderSingle, cmderOptions.cmderTask, cmderOptions.cmderCfgRoot, cmderOptions.cmderUserCfg, cmderOptions.cmderPars2CEmu); } return 0; From efc978f6f821291f4ccb634f9b79d47147b74450 Mon Sep 17 00:00:00 2001 From: Wayne Arthurton Date: Thu, 16 May 2019 15:13:07 -0400 Subject: [PATCH 26/30] Update README.md Added /t switch for timed init mode. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d624972..c2f97a2 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,7 @@ You may find some Monokai color schemes for mintty to match Cmder [here](https:/ | `/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 | | `/f` | Enables Cmder Fast Init Mode. This disables some features, see pull request [#1492](https://github.com/cmderdev/cmder/pull/1942) for more details. | not set | +| `/t` | Enables Cmder Timed Init Mode. This displays the time taken run init scripts | 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 | From 543c7ca6e97ce6e52fb1dccb87548f751b97e8dc Mon Sep 17 00:00:00 2001 From: Ezio Date: Sun, 19 May 2019 22:54:47 +0200 Subject: [PATCH 27/30] Replace /FWPARS argument with /X as "daxgames" request. --- CHANGELOG.md | 6 ++++++ README.md | 2 +- launcher/src/CmderLauncher.cpp | 21 +++++++++++---------- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f6ef29..133b1e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## [Unreleased] +* Question issue: [#2094](https://github.com/cmderdev/cmder/issues/2094) +* Pull Request : [#2096](https://github.com/cmderdev/cmder/pull/2096) + * New argument created to ConEmu forwarding arguments. + * Syntax: `/x [ConEmu extras arguments]` + * e.g.: `Cmder.exe /x "-min -tsa"` + ### Fixes * Pull Request: [#2002](https://github.com/cmderdev/cmder/pull/2002) diff --git a/README.md b/README.md index 4b9940f..97378b4 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ The Cmder's user interface is also designed to be more eye pleasing, and you can | `/SINGLE` | Start Cmder in single mode. | | `/START [start_path]` | Folder path to start in. | | `/TASK [task_name]` | Task to start after launch. | -| `/FWPARS [ConEmu params]` | Forwads parameters to ConEmu | +| `/X [ConEmu extras pars]` | Forwads parameters to ConEmu | ## Context Menu Integration diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index 2490bb3..de10d04 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -71,7 +71,7 @@ bool FileExists(const wchar_t * filePath) return false; } -void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstring taskName = L"", std::wstring cfgRoot = L"", bool use_user_cfg = true, std::wstring pars2fw = L"") +void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstring taskName = L"", std::wstring cfgRoot = L"", bool use_user_cfg = true, std::wstring conemu_args = L"") { #if USE_TASKBAR_API wchar_t appId[MAX_PATH] = { 0 }; @@ -98,7 +98,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr std::wstring cmderStart = path; std::wstring cmderTask = taskName; - std::wstring cmderPars2CEmu = pars2fw; + std::wstring cmderConEmuArgs = conemu_args; std::copy(cfgRoot.begin(), cfgRoot.end(), userConfigDirPath); userConfigDirPath[cfgRoot.length()] = 0; @@ -392,9 +392,9 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr swprintf_s(args, L"%s -loadcfgfile \"%s\"", args, userConEmuCfgPath); } - if (!streqi(cmderPars2CEmu.c_str(), L"")) + if (!streqi(cmderConEmuArgs.c_str(), L"")) { - swprintf_s(args, L"%s %s", args, cmderPars2CEmu.c_str()); + swprintf_s(args, L"%s %s", args, cmderConEmuArgs.c_str()); } SetEnvironmentVariable(L"CMDER_ROOT", exeDir); @@ -533,7 +533,7 @@ struct cmderOptions std::wstring cmderStart = L""; std::wstring cmderTask = L""; std::wstring cmderRegScope = L"USER"; - std::wstring cmderPars2CEmu = L""; + std::wstring cmderConEmuArgs = L""; bool cmderSingle = false; bool cmderUserCfg = true; bool registerApp = false; @@ -627,9 +627,10 @@ cmderOptions GetOption() } } } - else if (_wcsicmp(L"/fwpars", szArgList[i]) == 0) + /* Used for passing arguments to conemu prog */ + else if (_wcsicmp(L"/x", szArgList[i]) == 0) { - cmderOptions.cmderPars2CEmu = szArgList[i + 1]; + cmderOptions.cmderConEmuArgs = szArgList[i + 1]; i++; } else if (cmderOptions.cmderStart == L"") @@ -647,13 +648,13 @@ cmderOptions GetOption() } else { - MessageBox(NULL, L"Unrecognized parameter.\n\nValid options:\n\n /c [CMDER User Root Path]\n\n /task [ConEmu Task Name]\n\n [/start [Start in Path] | [Start in Path]]\n\n /single\n\n /m\n\n /fwpars [ConEmu parameters to fw]\n\nor\n\n /register [USER | ALL]\n\nor\n\n /unregister [USER | ALL]\n", MB_TITLE, MB_OK); + MessageBox(NULL, L"Unrecognized parameter.\n\nValid options:\n\n /c [CMDER User Root Path]\n\n /task [ConEmu Task Name]\n\n [/start [Start in Path] | [Start in Path]]\n\n /single\n\n /m\n\n /x [ConEmu extra arguments]\n\nor\n\n /register [USER | ALL]\n\nor\n\n /unregister [USER | ALL]\n", MB_TITLE, MB_OK); cmderOptions.error = true; } } else { - MessageBox(NULL, L"Unrecognized parameter.\n\nValid options:\n\n /c [CMDER User Root Path]\n\n /task [ConEmu Task Name]\n\n [/start [Start in Path] | [Start in Path]]\n\n /single\n\n /m\n\n /fwpars [ConEmu parameters to fw]\n\nor\n\n /register [USER | ALL]\n\nor\n\n /unregister [USER | ALL]\n", MB_TITLE, MB_OK); + MessageBox(NULL, L"Unrecognized parameter.\n\nValid options:\n\n /c [CMDER User Root Path]\n\n /task [ConEmu Task Name]\n\n [/start [Start in Path] | [Start in Path]]\n\n /single\n\n /m\n\n /x [ConEmu extra arguments]\n\nor\n\n /register [USER | ALL]\n\nor\n\n /unregister [USER | ALL]\n", MB_TITLE, MB_OK); cmderOptions.error = true; } } @@ -695,7 +696,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, } else { - StartCmder(cmderOptions.cmderStart, cmderOptions.cmderSingle, cmderOptions.cmderTask, cmderOptions.cmderCfgRoot, cmderOptions.cmderUserCfg, cmderOptions.cmderPars2CEmu); + StartCmder(cmderOptions.cmderStart, cmderOptions.cmderSingle, cmderOptions.cmderTask, cmderOptions.cmderCfgRoot, cmderOptions.cmderUserCfg, cmderOptions.cmderConEmuArgs); } return 0; From a97ce1f95050a255db518e24c89810e3563719aa Mon Sep 17 00:00:00 2001 From: Martin Kemp Date: Fri, 24 May 2019 13:47:01 +0100 Subject: [PATCH 28/30] Create stale.yml --- .github/stale.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/stale.yml diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000..426c00a --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,18 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 30 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 7 +# Issues with these labels will never be considered stale +exemptLabels: + - 📌 Pinned +# Label to use when marking an issue as stale +staleLabel: 👀 Awaiting Response +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed in a week if no further activity occurs. + Thank you for your contribution. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: > + This issue has been automatically closed due to it not having any + activity since it was marked as stale. Thank you for your contribution. From 73c21d1a59a62c848fbcea3a46cb965d5e5e4f18 Mon Sep 17 00:00:00 2001 From: Martin Kemp Date: Fri, 24 May 2019 13:54:09 +0100 Subject: [PATCH 29/30] Wrap labels with quotes --- .github/stale.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/stale.yml b/.github/stale.yml index 426c00a..c3b0200 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -4,9 +4,9 @@ daysUntilStale: 30 daysUntilClose: 7 # Issues with these labels will never be considered stale exemptLabels: - - 📌 Pinned + - "📌 Pinned" # Label to use when marking an issue as stale -staleLabel: 👀 Awaiting Response +staleLabel: "👀 Awaiting Response" # Comment to post when marking an issue as stale. Set to `false` to disable markComment: > This issue has been automatically marked as stale because it has not had From ea531cdd444f9b97a90ffad713207e8f38fc3829 Mon Sep 17 00:00:00 2001 From: Dax T Games Date: Mon, 3 Jun 2019 06:23:00 -0400 Subject: [PATCH 30/30] Fix post-install.bat not running and deleting itself (#2106) * Fix post-install.bat not running * Changelog * Changelog --- CHANGELOG.md | 3 +++ vendor/init.bat | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 133b1e0..7543a5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ ### Fixes +* Pull Request: [#2106](https://github.com/cmderdev/cmder/pull/2106) + * Portable Git requires running `post-install.bat` which deletes itself when done. This was not happening. + * Resolves [#2105](https://github.com/cmderdev/cmder/issues/2105) * Pull Request: [#2002](https://github.com/cmderdev/cmder/pull/2002) * Updated the HG prompt code to use the '-ib' option to 'hg id' so the branch name is always available, regardless of the state of the working copy diff --git a/vendor/init.bat b/vendor/init.bat index bb089d6..d0737dd 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -369,9 +369,9 @@ call "%user_aliases%" :: Basically we need to execute this post-install.bat because we are :: manually extracting the archive rather than executing the 7z sfx if exist "%GIT_INSTALL_ROOT%\post-install.bat" ( - %lib_console% verbose_output "Running Git for Windows one time Post Install...." + echo Running Git for Windows one time Post Install.... pushd "%GIT_INSTALL_ROOT%\" - "%GIT_INSTALL_ROOT%\git-bash.exe" --no-needs-console --hide --no-cd --command=post-install.bat + "%GIT_INSTALL_ROOT%\git-cmd.exe" --no-needs-console --no-cd --command=post-install.bat popd )