From 74d79ea62887c57d7eabd2dd4e9eef9e050464c1 Mon Sep 17 00:00:00 2001 From: "Wild.Farmer" Date: Sat, 17 Jun 2017 22:29:06 +0800 Subject: [PATCH 01/12] add /TASK option --- launcher/src/CmderLauncher.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index 42f2902..164b87e 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -95,7 +95,7 @@ bool FileExists(const wchar_t * filePath) return false; } -void StartCmder(std::wstring path, bool is_single_mode) +void StartCmder(std::wstring path, bool is_single_mode, std::wstring taskName = L"") { #if USE_TASKBAR_API wchar_t appId[MAX_PATH] = { 0 }; @@ -180,6 +180,10 @@ void StartCmder(std::wstring path, bool is_single_mode) swprintf_s(args, L"/Icon \"%s\" /Title Cmder", icoPath); } + if (!taskName.empty()) { + swprintf_s(args, L"%s -run {%s}", args, taskName.c_str()); + } + SetEnvironmentVariable(L"CMDER_ROOT", exeDir); if (!streqi(path.c_str(), L"")) { @@ -323,6 +327,10 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, { StartCmder(opt.second, true); } + else if (streqi(opt.first.c_str(), L"/TASK")) + { + StartCmder(L"", false, opt.second); + } else if (streqi(opt.first.c_str(), L"/REGISTER")) { RegisterShellMenu(opt.second, SHELL_MENU_REGISTRY_PATH_BACKGROUND); @@ -335,7 +343,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance, } else { - MessageBox(NULL, L"Unrecognized parameter.\n\nValid options:\n /START \n /SINGLE \n /REGISTER [USER/ALL]\n /UNREGISTER [USER/ALL]", MB_TITLE, MB_OK); + MessageBox(NULL, L"Unrecognized parameter.\n\nValid options:\n /START \n /SINGLE \n /TASK \n /REGISTER [USER/ALL]\n /UNREGISTER [USER/ALL]", MB_TITLE, MB_OK); return 1; } From aea1a977bf8b21eb1ef1e6197b458cad8d4d3813 Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Fri, 23 Jun 2017 18:18:21 +0200 Subject: [PATCH 02/12] :arrow_up: Update Git to v2.13.1(2) Release notes: https://github.com/git-for-windows/git/releases/tag/v2.13.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 124321c..563db44 100644 --- a/vendor/sources.json +++ b/vendor/sources.json @@ -1,8 +1,8 @@ [ { "name": "git-for-windows", - "version": "v2.13.1.windows.1", - "url": "https://github.com/git-for-windows/git/releases/download/v2.13.1.windows.1/PortableGit-2.13.1-32-bit.7z.exe" + "version": "v2.13.1.windows.2", + "url": "https://github.com/git-for-windows/git/releases/download/v2.13.1.windows.2/PortableGit-2.13.1.2-32-bit.7z.exe" }, { "name": "clink", From 409b92aac2eeb662c047e0f4625f217cb856c8d2 Mon Sep 17 00:00:00 2001 From: "Wild.Farmer" Date: Sat, 24 Jun 2017 22:10:15 +0800 Subject: [PATCH 03/12] modify -cmd command line style to /cmd --- 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 164b87e..da97b69 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -181,7 +181,7 @@ void StartCmder(std::wstring path, bool is_single_mode, std::wstring taskName = } if (!taskName.empty()) { - swprintf_s(args, L"%s -run {%s}", args, taskName.c_str()); + swprintf_s(args, L"%s /run {%s}", args, taskName.c_str()); } SetEnvironmentVariable(L"CMDER_ROOT", exeDir); From 262d92265e3cdad3e00d2e7fe778565e7c2b7525 Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Tue, 27 Jun 2017 00:55:58 +0200 Subject: [PATCH 04/12] :arrow_up: Update Git to v2.13.2.windows.1 Release notes: https://github.com/git-for-windows/git/releases/tag/v2.13.2.windows.1 --- vendor/sources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/sources.json b/vendor/sources.json index 563db44..30156ab 100644 --- a/vendor/sources.json +++ b/vendor/sources.json @@ -1,8 +1,8 @@ [ { "name": "git-for-windows", - "version": "v2.13.1.windows.2", - "url": "https://github.com/git-for-windows/git/releases/download/v2.13.1.windows.2/PortableGit-2.13.1.2-32-bit.7z.exe" + "version": "v2.13.2.windows.1", + "url": "https://github.com/git-for-windows/git/releases/download/v2.13.2.windows.1/PortableGit-2.13.2-32-bit.7z.exe" }, { "name": "clink", From 512787f3917cbc2b84e10fa00200bf82085ec885 Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Tue, 27 Jun 2017 00:56:53 +0200 Subject: [PATCH 05/12] :arrow_up: Update ConEmu to 170622 (preview) Changelog: https://conemu.github.io/blog/2017/06/22/Build-170622.html --- vendor/sources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/sources.json b/vendor/sources.json index 30156ab..84d1b8d 100644 --- a/vendor/sources.json +++ b/vendor/sources.json @@ -11,8 +11,8 @@ }, { "name": "conemu-maximus5", - "version": "170605", - "url": "https://github.com/Maximus5/ConEmu/releases/download/v17.06.05/ConEmuPack.170605.7z" + "version": "170622", + "url": "https://github.com/Maximus5/ConEmu/releases/download/v17.06.22/ConEmuPack.170622.7z" }, { "name": "clink-completions", From 0877a6d9954e41c0974fbbd73c1803d497f831a1 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Mon, 10 Jul 2017 22:21:22 -0500 Subject: [PATCH 06/12] cmder git prompt --- vendor/git-prompt.sh | 57 ++++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/vendor/git-prompt.sh b/vendor/git-prompt.sh index 81aedb0..9992b47 100644 --- a/vendor/git-prompt.sh +++ b/vendor/git-prompt.sh @@ -1,22 +1,39 @@ -PS1='\[\033]0;$MSYSTEM:${PWD//[^[:ascii:]]/?}\007\]' # set window title -PS1="$PS1"'\[\033[32m\]' # change to green -PS1="$PS1"'\u@\h ' # user@host -PS1="$PS1"'\[\033[33m\]' # change to brownish yellow -PS1="$PS1"'\w' # current working directory -if test -z "$WINELOADERNOEXEC" +if test -f /etc/profile.d/git-sdk.sh then - GIT_EXEC_PATH="$(git --exec-path 2>/dev/null)" - COMPLETION_PATH="${GIT_EXEC_PATH%/libexec/git-core}" - COMPLETION_PATH="${COMPLETION_PATH%/lib/git-core}" - COMPLETION_PATH="$COMPLETION_PATH/share/git/completion" - if test -f "$COMPLETION_PATH/git-prompt.sh" - then - . "$COMPLETION_PATH/git-completion.bash" - . "$COMPLETION_PATH/git-prompt.sh" - PS1="$PS1"'\[\033[36m\]' # change color to cyan - PS1="$PS1"'`__git_ps1`' # bash function - fi + TITLEPREFIX=SDK-${MSYSTEM#MINGW} +else + TITLEPREFIX=$MSYSTEM fi -PS1="$PS1"'\[\033[0m\]' # change color -PS1="$PS1"'\n' # new line -PS1="$PS1"'λ ' # prompt: always λ + +if test -f ~/.config/git/git-prompt.sh +then + . ~/.config/git/git-prompt.sh +else + PS1='\[\033]0;$MSYSTEM:${PWD//[^[:ascii:]]/?}\007\]' # set window title + # PS1="$PS1"'\n' # new line + PS1="$PS1"'\[\033[32m\]' # change to green + PS1="$PS1"'\u@\h ' # user@host + # PS1="$PS1"'\[\033[35m\]' # change to purple + # PS1="$PS1"'$MSYSTEM ' # show MSYSTEM + PS1="$PS1"'\[\033[33m\]' # change to brownish yellow + PS1="$PS1"'\w' # current working directory + if test -z "$WINELOADERNOEXEC" + then + GIT_EXEC_PATH="$(git --exec-path 2>/dev/null)" + COMPLETION_PATH="${GIT_EXEC_PATH%/libexec/git-core}" + COMPLETION_PATH="${COMPLETION_PATH%/lib/git-core}" + COMPLETION_PATH="$COMPLETION_PATH/share/git/completion" + if test -f "$COMPLETION_PATH/git-prompt.sh" + then + . "$COMPLETION_PATH/git-completion.bash" + . "$COMPLETION_PATH/git-prompt.sh" + PS1="$PS1"'\[\033[36m\]' # change color to cyan + PS1="$PS1"'`__git_ps1`' # bash function + fi + fi + PS1="$PS1"'\[\033[0m\]' # change color + PS1="$PS1"'\n' # new line + PS1="$PS1"'λ ' # prompt: always λ +fi + +MSYS2_PS1="$PS1" # for detection by MSYS2 SDK's bash.basrc From bcb60f8f591ba0ad97a3391ddf43df2d838fcc60 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Mon, 10 Jul 2017 22:23:51 -0500 Subject: [PATCH 07/12] cmder git prompt spacing --- vendor/git-prompt.sh | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/vendor/git-prompt.sh b/vendor/git-prompt.sh index 9992b47..135e994 100644 --- a/vendor/git-prompt.sh +++ b/vendor/git-prompt.sh @@ -1,35 +1,35 @@ if test -f /etc/profile.d/git-sdk.sh then - TITLEPREFIX=SDK-${MSYSTEM#MINGW} + TITLEPREFIX=SDK-${MSYSTEM#MINGW} else - TITLEPREFIX=$MSYSTEM + TITLEPREFIX=$MSYSTEM fi if test -f ~/.config/git/git-prompt.sh then - . ~/.config/git/git-prompt.sh + . ~/.config/git/git-prompt.sh else PS1='\[\033]0;$MSYSTEM:${PWD//[^[:ascii:]]/?}\007\]' # set window title - # PS1="$PS1"'\n' # new line + # PS1="$PS1"'\n' # new line PS1="$PS1"'\[\033[32m\]' # change to green PS1="$PS1"'\u@\h ' # user@host - # PS1="$PS1"'\[\033[35m\]' # change to purple - # PS1="$PS1"'$MSYSTEM ' # show MSYSTEM + # PS1="$PS1"'\[\033[35m\]' # change to purple + # PS1="$PS1"'$MSYSTEM ' # show MSYSTEM PS1="$PS1"'\[\033[33m\]' # change to brownish yellow PS1="$PS1"'\w' # current working directory if test -z "$WINELOADERNOEXEC" then - GIT_EXEC_PATH="$(git --exec-path 2>/dev/null)" - COMPLETION_PATH="${GIT_EXEC_PATH%/libexec/git-core}" - COMPLETION_PATH="${COMPLETION_PATH%/lib/git-core}" - COMPLETION_PATH="$COMPLETION_PATH/share/git/completion" - if test -f "$COMPLETION_PATH/git-prompt.sh" - then - . "$COMPLETION_PATH/git-completion.bash" - . "$COMPLETION_PATH/git-prompt.sh" - PS1="$PS1"'\[\033[36m\]' # change color to cyan - PS1="$PS1"'`__git_ps1`' # bash function - fi + GIT_EXEC_PATH="$(git --exec-path 2>/dev/null)" + COMPLETION_PATH="${GIT_EXEC_PATH%/libexec/git-core}" + COMPLETION_PATH="${COMPLETION_PATH%/lib/git-core}" + COMPLETION_PATH="$COMPLETION_PATH/share/git/completion" + if test -f "$COMPLETION_PATH/git-prompt.sh" + then + . "$COMPLETION_PATH/git-completion.bash" + . "$COMPLETION_PATH/git-prompt.sh" + PS1="$PS1"'\[\033[36m\]' # change color to cyan + PS1="$PS1"'`__git_ps1`' # bash function + fi fi PS1="$PS1"'\[\033[0m\]' # change color PS1="$PS1"'\n' # new line From 815b99b98b3e921234d685d4743d0b12d10489fb Mon Sep 17 00:00:00 2001 From: Chrs Borckholder Date: Fri, 14 Jul 2017 11:30:19 +0200 Subject: [PATCH 08/12] Avoid clobbering Install-Module If the Install-Module command is available, do not include the bundled module path containing a deprecated version of PSGet. Recent powershell versions include PowerShellGet as standard module installer. Resolve #1318. --- vendor/profile.ps1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vendor/profile.ps1 b/vendor/profile.ps1 index 7878ff2..ccb858e 100644 --- a/vendor/profile.ps1 +++ b/vendor/profile.ps1 @@ -17,10 +17,14 @@ if(!$PSScriptRoot) { $PSScriptRoot = Split-Path $Script:MyInvocation.MyCommand.Path } +# 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) + # Add Cmder modules directory to the autoload path. $CmderModulePath = Join-path $PSScriptRoot "psmodules/" -if( -not $env:PSModulePath.Contains($CmderModulePath) ){ +if(-not $moduleInstallerAvailable -and -not $env:PSModulePath.Contains($CmderModulePath) ){ $env:PSModulePath = $env:PSModulePath.Insert(0, "$CmderModulePath;") } From 4c270699a1989b6c1109ff268ee18a538e9515df Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Sat, 15 Jul 2017 23:05:51 +0200 Subject: [PATCH 09/12] :arrow_up: Update Git to v2.13.3 Release notes: https://github.com/git-for-windows/git/releases/tag/v2.13.3.windows.1 --- vendor/sources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/sources.json b/vendor/sources.json index 84d1b8d..7a5e3e8 100644 --- a/vendor/sources.json +++ b/vendor/sources.json @@ -1,8 +1,8 @@ [ { "name": "git-for-windows", - "version": "v2.13.2.windows.1", - "url": "https://github.com/git-for-windows/git/releases/download/v2.13.2.windows.1/PortableGit-2.13.2-32-bit.7z.exe" + "version": "v2.13.3.windows.1", + "url": "https://github.com/git-for-windows/git/releases/download/v2.13.3.windows.1/PortableGit-2.13.3-32-bit.7z.exe" }, { "name": "clink", From f687281be044ae9d968ce38546ef4fe884583062 Mon Sep 17 00:00:00 2001 From: Tian Date: Tue, 25 Jul 2017 05:14:17 +0800 Subject: [PATCH 10/12] Fixed quotation marks (#1360) 1. Changed " --login -i"" to "" --login -i" in ConEmu 2. Closed quotation in "alias.bat :p_del doskey" command of "%ALIASES%" Suppose %CMDER_ROOT% is "C:\Program Files\cmder", this BUG will be raised while we exec command of "unalias xxx" or creat terminal "{bash::bash}" and "{bash::mintty}", it will throws an error like: 'C:\Program' is not recognized as an internal or external command, operable program or batch file. --- bin/alias.bat | 2 +- config/ConEmu.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/alias.bat b/bin/alias.bat index cf5d07d..69497f6 100644 --- a/bin/alias.bat +++ b/bin/alias.bat @@ -96,7 +96,7 @@ set del_alias=%~1 findstr /b /v /i "%del_alias%=" "%ALIASES%" >> "%ALIASES%.tmp" type "%ALIASES%".tmp > "%ALIASES%" & @del /f /q "%ALIASES%.tmp" doskey %del_alias%= -doskey /macrofile=%ALIASES% +doskey /macrofile="%ALIASES%" goto:eof :p_reload diff --git a/config/ConEmu.xml b/config/ConEmu.xml index af06ef0..0be905d 100644 --- a/config/ConEmu.xml +++ b/config/ConEmu.xml @@ -548,14 +548,14 @@ - + - + From 1f9e743ef20e9da2bf8ffeef2b66267a936e5b76 Mon Sep 17 00:00:00 2001 From: Alpha Date: Mon, 24 Jul 2017 17:15:17 -0400 Subject: [PATCH 11/12] Added pagent ssh auth support (#1391) (and some comments on the user-profile.cmd file) Inspired by the comments from https://github.com/cmderdev/cmder/issues/193 and my personal need to use pageant instead of OpenSSH authentication agents (which is more Window user-friendly), I have used this approach which works as expected. Keeping the spirit of the current scripts, I left it disabled, and with some comments explaining what they all do. --- vendor/init.bat | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vendor/init.bat b/vendor/init.bat index 1fefa10..ef54dfe 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -173,7 +173,14 @@ if exist "%CMDER_ROOT%\config\user-profile.cmd" ( echo :: use this file to run your own startup commands echo :: use in front of the command to prevent printing the command echo. + echo :: uncomment this to have the ssh agent load when cmder starts echo :: call "%%GIT_INSTALL_ROOT%%/cmd/start-ssh-agent.cmd" + echo. + echo :: uncomment this next two lines to use pageant as the ssh authentication agent + echo :: SET SSH_AUTH_SOCK=/tmp/.ssh-pageant-auth-sock + echo :: call "%%GIT_INSTALL_ROOT%%/cmd/start-ssh-pageant.cmd" + echo. + echo :: you can add your plugins to the cmder path like so echo :: set "PATH=%%CMDER_ROOT%%\vendor\whatever;%%PATH%%" echo. ) > "%CMDER_ROOT%\config\user-profile.cmd" From a34e17f2bd1ca6018ab81258fa41cb980e7c18ff Mon Sep 17 00:00:00 2001 From: Dax T Games Date: Thu, 27 Jul 2017 10:43:44 -0500 Subject: [PATCH 12/12] Doc updates For profile/alias settings scripts, what loads them, and load order. --- README.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7630fed..96e78b8 100644 --- a/README.md +++ b/README.md @@ -112,16 +112,39 @@ You can define simple aliases for `cmd.exe` sessions with a command like `alias 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' -Aliases defined using the `alias.bat` command will automatically be saved in the `%CMDER_ROOT%\config\aliases` file +Aliases defined using the `alias.bat` command will automatically be saved in the `%CMDER_ROOT%\config\user-aliases.cmd` file + +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. + +* '%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 permanent add it to either your `$CMDER_ROOT/config/user-profile.sh` or your `$HOME/.bashrc`. +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. + +* '$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. #### 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'. 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' + ### SSH Agent To start SSH agent simply call `start-ssh-agent`, which is in the `vendor/git-for-windows/cmd` folder.