From 187156487e075be59bd892c82652a319bf6dfda3 Mon Sep 17 00:00:00 2001 From: Kody Brown Date: Tue, 17 Mar 2015 14:39:27 -0600 Subject: [PATCH 01/42] Added code to check for the existence of a customized ini file named `ConEmu-%COMPUTERNAME%.ini`, before checking for the standard ini file `ConEmu.ini`. --- launcher/src/CmderLauncher.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index 893e33c..1aa720f 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -99,7 +99,11 @@ void StartCmder(std::wstring path, bool is_single_mode) PathRemoveFileSpec(exeDir); PathCombine(icoPath, exeDir, L"icons\\cmder.ico"); - PathCombine(cfgPath, exeDir, L"config\\ConEmu.xml"); + PathCombine(cfgPath, exeDir, L"config\\ConEmu-%COMPUTERNAME%.xml"); + ExpandEnvironmentStrings(cfgPath, cfgPath, sizeof(cfgPath) / sizeof(cfgPath[0])); + if (!PathFileExists(cfgPath)) { + PathCombine(cfgPath, exeDir, L"config\\ConEmu.xml"); + } PathCombine(conEmuPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu.exe"); if (is_single_mode) From a57c11e171f97eb8cc6a10b61053731d2940316a Mon Sep 17 00:00:00 2001 From: Manuel Tanzer Date: Fri, 4 Sep 2015 22:16:30 +0200 Subject: [PATCH 02/42] Enable the '/single' switch by using the registry as statemachine for the current location ('CMDER_START') Fixed issue #577 --- launcher/src/CmderLauncher.cpp | 25 +++++++++++++++++++------ vendor/profile.ps1 | 23 +++++++++++++++++++---- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index 49f836a..1ef0b59 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -18,7 +18,7 @@ #define SHELL_MENU_REGISTRY_PATH_BACKGROUND L"Directory\\Background\\shell\\Cmder" #define SHELL_MENU_REGISTRY_PATH_LISTITEM L"Directory\\shell\\Cmder" -#define streqi(a, b) (_wcsicmp((a), (b)) == 0) +#define streqi(a, b) (_wcsicmp((a), (b)) == 0) #define WIDEN2(x) L ## x #define WIDEN(x) WIDEN2(x) @@ -29,7 +29,7 @@ void ShowErrorAndExit(DWORD ec, const wchar_t * func, int line) { wchar_t * buffer; - if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, ec, 0, (LPWSTR) &buffer, 0, NULL) == 0) { buffer = L"Unknown error. FormatMessage failed."; @@ -129,17 +129,30 @@ void StartCmder(std::wstring path, bool is_single_mode) } } - if (is_single_mode) + if (is_single_mode) { swprintf_s(args, L"/single /Icon \"%s\" /Title Cmder", icoPath); } - else + else { swprintf_s(args, L"/Icon \"%s\" /Title Cmder", icoPath); } - SetEnvironmentVariable(L"CMDER_ROOT", exeDir); - SetEnvironmentVariable(L"CMDER_START", path.c_str()); + SetEnvironmentVariable(L"CMDER_ROOT", exeDir); + //SetEnvironmentVariable(L"CMDER_START", path.c_str()); + + // Send out the Settings Changed message - Once using ANSII... + //SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment", SMTO_ABORTIFHUNG, 5000, NULL); + + // ...and once using UniCode (because Windows 8 likes it that way). + //SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM) L"Environment", SMTO_ABORTIFHUNG, 5000, NULL); + + HKEY cmderStartRegistryKey; + if (RegCreateKeyEx(HKEY_CURRENT_USER, L"Software\\cmder", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &cmderStartRegistryKey, 0) == ERROR_SUCCESS) + { + RegSetValueEx(cmderStartRegistryKey, L"CMDER_START", 0, REG_SZ, (const BYTE*) path.c_str(), path.size() * 2); + RegCloseKey(cmderStartRegistryKey); + } STARTUPINFO si = { 0 }; si.cb = sizeof(STARTUPINFO); diff --git a/vendor/profile.ps1 b/vendor/profile.ps1 index cc3850c..9591666 100644 --- a/vendor/profile.ps1 +++ b/vendor/profile.ps1 @@ -61,10 +61,25 @@ if ($gitStatus) { } # Move to the wanted location -if (Test-Path Env:\CMDER_START) { - Set-Location -Path $Env:CMDER_START -} elseif ($Env:CMDER_ROOT -and $Env:CMDER_ROOT.StartsWith($pwd)) { - Set-Location -Path $Env:USERPROFILE +$cmderStartKey = 'HKCU:\Software\cmder' +$cmderStartSubKey = 'CMDER_START' + +$cmderStart = (Get-Item -Path $cmderStartKey).GetValue($cmderStartSubKey) +if ( $cmderStart ) { + $cmderStart = ($cmderStart).Trim('"').Trim("'") + if ( $cmderStart.EndsWith(':') ) { + $cmderStart += '\' + } + + if ( ( Get-Item $cmderStart -Force ) -is [System.IO.FileInfo] ) { + $cmderStart = Split-Path $cmderStart + } + + Set-Location -Path "${cmderStart}" + + Set-ItemProperty -Path $cmderStartKey -Name $cmderStartSubKey -Value $null +} else { + Set-Location -Path "${env:HOME}" } # Enhance Path From cf15dcffc7f58d2349c792a48c3f98aee10200b4 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sun, 8 Nov 2015 21:25:42 -0600 Subject: [PATCH 03/42] Added/enhanced bash with cmder.sh/user-cmder.sh, organized tasks menu added personal files to .gitignore so they never get uploaded to the repo and added support for msys2 bash in the new git for windows added autocreate of config/user-cmder.sh if iot does not exist and added it to the .gitignore Added tasks: cmd::Cmder, cmd::Cmder as Admin, bash::bash, bash::bash as Admin, bash::mintty, bash::mintty as admin, powershell::powershell, powershell::powershell as Admin. Set default task to cmd::Cmder. Cot rid of init.bat running before /bin/bash, fixes double exit requirement Added running git for windows post-install.bat on first cmder launch fixed file/path not found errors when launching powershell as admin fixed file/path not found errors when launching bash/mintty as admin fixed PATH in vendor/cmder.sh Added sourcing ~/.bashrc if it exists. changed .gitignore to ignore anything with path of config/user-* removed my personal files from .gitignore, left in config/user-* Make sure $CMDER_ROOT does not have a trailing '/' %CMDER_ROOT% does not have trailing '\'. allow user to specify a conemu.xml on the command line Removed '\' from %CMDER_ROOT% --- .gitignore | 1 + Cmder.bat | 10 ++++- config/ConEmu.xml | 103 +++++++++++++++++++++++++++++++++------------ packignore | 1 + scripts/build.ps1 | 6 +++ vendor/cmder.sh | 53 +++++++++++++++++++++++ vendor/init.bat | 13 ++++++ vendor/profile.ps1 | 14 ++++-- 8 files changed, 169 insertions(+), 32 deletions(-) create mode 100644 vendor/cmder.sh diff --git a/.gitignore b/.gitignore index 03da90b..0e9e5ec 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ Thumbs.db build/ Version v* *.bak +config/user-* diff --git a/Cmder.bat b/Cmder.bat index 4ae276a..c806d6a 100644 --- a/Cmder.bat +++ b/Cmder.bat @@ -1,3 +1,11 @@ @echo off SET CMDER_ROOT=%~dp0 -start %~dp0/vendor/conemu-maximus5/ConEmu.exe /Icon "%CMDER_ROOT%\icons\cmder.ico" /Title Cmder /LoadCfgFile "%CMDER_ROOT%\config\ConEmu.xml" + +:: Remove trailing '\' +@if "%CMDER_ROOT:~-1%" == "\" SET CMDER_ROOT=%CMDER_ROOT:~0,-1% + +if exist "%~1" ( + start %~dp0/vendor/conemu-maximus5/ConEmu.exe /Icon "%CMDER_ROOT%\icons\cmder.ico" /Title Cmder /LoadCfgFile "%~1" +) else ( + start %~dp0/vendor/conemu-maximus5/ConEmu.exe /Icon "%CMDER_ROOT%\icons\cmder.ico" /Title Cmder /LoadCfgFile "%CMDER_ROOT%\config\ConEmu.xml" +) \ No newline at end of file diff --git a/config/ConEmu.xml b/config/ConEmu.xml index f675df0..2e6b296 100644 --- a/config/ConEmu.xml +++ b/config/ConEmu.xml @@ -1,7 +1,7 @@ - + @@ -72,7 +72,7 @@ - + @@ -123,12 +123,12 @@ - + - - + + @@ -483,10 +483,19 @@ - - - - + + + + + + + + + + + + + @@ -494,17 +503,8 @@ - - - - - - - - - - - + + @@ -512,22 +512,60 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - + - - + + @@ -628,7 +666,7 @@ - + @@ -805,7 +843,16 @@ + + + + + + + + + diff --git a/packignore b/packignore index d72b3ed..538efb3 100644 --- a/packignore +++ b/packignore @@ -16,3 +16,4 @@ icons\icon_256.png Cmder.bat vendor\tmp appveyor.yml +vendor\cmder.sh diff --git a/scripts/build.ps1 b/scripts/build.ps1 index df30fbb..7365586 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -110,4 +110,10 @@ if($Compile) { Write-Warning "This cannot be a release. Test build only!" } +# Put vendor\cmder.sh in /etc/profile.d so it runs when we start bash or mintty +if ( (Test-Path $($SaveTo + "git-for-windows/etc/profile.d") ) ) { + write-verbose "Adding cmder.sh /etc/profile.d" + Copy-Item $($SaveTo + "cmder.sh") $($SaveTo + "git-for-windows/etc/profile.d/cmder.sh") +} + Write-Verbose "All good and done!" diff --git a/vendor/cmder.sh b/vendor/cmder.sh new file mode 100644 index 0000000..a82ea80 --- /dev/null +++ b/vendor/cmder.sh @@ -0,0 +1,53 @@ +# DO NOT EDIT THIS FILE IT WILL BE OVERWRITTEN ON UPDATE +# +# Add portable user customizations ${CMDER_ROOT}/config/user-cmder.sh, +# these customizations will follow Cmder if $CMDER_ROOT is copied +# to another machine. +# +# Add system specific users customizations to $HOME/.bashrc, these +# customizations will not follow Cmder to another machine. + +# We do this for bash as admin sessions since $CMDER_ROOT is not being set +if [ "$CMDER_ROOT" == "" ] ; then + case "$ConEmuDir" in *\\*) CMDER_ROOT=$( cd "$(cygpath -u "$ConEmuDir")/../.." ; pwd );; esac +else + case "$CMDER_ROOT" in *\\*) CMDER_ROOT="$(cygpath -u "$CMDER_ROOT")";; esac +fi + +# Remove any trailing '/' +CMDER_ROOT=$(echo $CMDER_ROOT | sed 's:/*$::') + +export CMDER_ROOT + +if [ -d "/c/Program Files/Git" ] ; then + GIT_INSTALL_ROOT="/c/Program Files/Git" +elif [ -d "/c/Program Files(x86)/Git" ] ; then + GIT_INSTALL_ROOT="/c/Program Files(x86)/Git" +elif [ -d "${CMDER_ROOT}/vendor/git-for-windows" ] ; then + GIT_INSTALL_ROOT=${CMDER_ROOT}/vendor/git-for-windows +fi + +if [[ ! "$PATH" =~ "${GIT_INSTALL_ROOT}/bin:" ]] ; then + PATH=${GIT_INSTALL_ROOT}/bin:$PATH +fi + +PATH=${CMDER_ROOT}/bin:$PATH:${CMDER_ROOT} + +export PATH + +if [ -f ${CMDER_ROOT}/config/user-cmder.sh ] ; then + . ${CMDER_ROOT}/config/user-cmder.sh +else + echo Creating user startup file: "${CMDER_ROOT}/config/user-cmder.sh" + cat <<-eof >"${CMDER_ROOT}/config/user-cmder.sh" +# use this file to run your own startup commands for msys2 bash' + +# To add a new vendor to the path, do something like: +# export PATH=\${CMDER_ROOT}/vendor/whatever:\${PATH} +eof +fi + +# Source the users .bashrc file if it exists +if [ -f "${HOME}/.bashrc" ] ; then + . "${HOME}/.bashrc" +fi diff --git a/vendor/init.bat b/vendor/init.bat index 0814411..fa4b403 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -9,6 +9,9 @@ for /f "delims=" %%i in ("%ConEmuDir%\..\..") do @set CMDER_ROOT=%%~fi ) +:: Remove trailing '\' +@if "%CMDER_ROOT:~-1%" == "\" SET CMDER_ROOT=%CMDER_ROOT:~0,-1% + :: Change the prompt style :: Mmm tasty lamb @prompt $E[1;32;40m$P$S{git}{hg}$S$_$E[1;30;40m{lamb}$S$E[0m @@ -51,6 +54,16 @@ :: Add aliases @doskey /macrofile="%CMDER_ROOT%\config\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 +:: manually extracting the archive rather than executing the 7z sfx +@if exist "%CMDER_ROOT%\vendor\git-for-windows\post-install.bat" ( + echo Running Git for Windows one time Post Install.... + cd /d "%CMDER_ROOT%\vendor\git-for-windows\" + "%CMDER_ROOT%\vendor\git-for-windows\git-bash.exe" --no-needs-console --hide --no-cd --command=post-install.bat + cd /d %USERPROFILE% +) + :: Set home path @if not defined HOME set HOME=%USERPROFILE% diff --git a/vendor/profile.ps1 b/vendor/profile.ps1 index cc3850c..499fc83 100644 --- a/vendor/profile.ps1 +++ b/vendor/profile.ps1 @@ -4,6 +4,14 @@ # !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED # !!! Use "%CMDER_ROOT%\config\user-profile.ps1" to add your own startup commands +# We do this for Powershell as Admin Sessions because CMDER_ROOT is not beng set. +if (! $ENV:CMDER_ROOT ) { + $ENV:CMDER_ROOT = resolve-path( $ENV:ConEmuDir + "\..\.." ) +} + +# Remove trailing '\' +$ENV:CMDER_ROOT = (($ENV:CMDER_ROOT).trimend("\")) + # Compatibility with PS major versions <= 2 if(!$PSScriptRoot) { $PSScriptRoot = Split-Path $Script:MyInvocation.MyCommand.Path @@ -20,7 +28,7 @@ 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\bin" + $env:Path += $(";" + $env:CMDER_ROOT + "\vendor\git-for-windows\bin") } try { @@ -71,11 +79,11 @@ if (Test-Path Env:\CMDER_START) { $env:Path = "$Env:CMDER_ROOT\bin;$env:Path;$Env:CMDER_ROOT" -$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. . "$CmderUserProfilePath" } else { Write-Host "Creating user startup file: $CmderUserProfilePath" "# Use this file to run your own startup commands" | Out-File $CmderUserProfilePath -} \ No newline at end of file +} From a3e2d7546d19d5cead20cc4783c1c7fc42624454 Mon Sep 17 00:00:00 2001 From: Martin Kemp Date: Fri, 20 Nov 2015 10:29:32 +0000 Subject: [PATCH 04/42] Update to ConEmu 151119 Changelog: https://conemu.github.io/blog/2015/11/19/Build-151119.html --- vendor/sources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/sources.json b/vendor/sources.json index c0e6cb6..258235f 100644 --- a/vendor/sources.json +++ b/vendor/sources.json @@ -11,8 +11,8 @@ }, { "name": "conemu-maximus5", - "version": "151109", - "url": "https://github.com/Maximus5/ConEmu/releases/download/v15.11.09/ConEmuPack.151109.7z" + "version": "151119", + "url": "https://github.com/Maximus5/ConEmu/releases/download/v15.11.19/ConEmuPack.151119.7z" }, { "name": "clink-completions", From e6d2394d481bbde269bf628f1984c8b4f817307b Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Mon, 23 Nov 2015 17:47:48 -0500 Subject: [PATCH 05/42] Added some documentation to the README.md file --- README.md | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6c3596f..a62c6de 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,39 @@ In a file explorer window right click in or on a directory to see "Cmder Here" i ## Features +### Access to multiple shells in one window using tabs +You can open multiple tabs each containing one of the following shells: + +* Cmder | Cmder as Admin - Enhanced Windows 'cmd.exe' shell. +* Powershell | Powershell as Admin - Enhanced Windows Powershell. +* Bash/mintty | Bash/mintty as Admin - Unix/Linux like bash shell running on Windows. + +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. + +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://code.google.com/p/mintty/). + +An example of setting Cmder portable terminal colors for mintty: + +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-cmder.sh +``` + +### Cmder Portable Shell User Config +User specific configuration is possible using the cmder specific shell config files. Edit the below files to add your own configuration: + +* Cmder - %CMDER_ROOT%\config\user-startup.cmd +* Powershell - $ENV:CMDER_ROOT\config\user-profile.ps1 +* Bash/Mintty - $CMDER_ROOT/config/user-cmder.sh + +Bash and Mintty sessions will also source the '$HOME/.bashrc' file it it exists before it sources '$CMDER_ROOT/config/user-cmder.sh'. + ### Aliases You can define simple aliases with command `alias name=command`. @@ -68,8 +101,7 @@ If you want to run SSH agent on startup, include the line `@call "%GIT_INSTALL_R ## Todo -1. Git Bash -2. Check for clink and git before injecting them (Sort of done) +1. Check for clink and git before injecting them (Sort of done) ## License From 8566b6f6caa693814c5d3119a1910f409dcddef1 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Mon, 23 Nov 2015 19:10:22 -0500 Subject: [PATCH 06/42] Added vi/vim aliases and fixed powershell startup errors --- config/aliases | 1 + vendor/profile.ps1 | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/config/aliases b/config/aliases index 41d71ad..c726204 100644 --- a/config/aliases +++ b/config/aliases @@ -5,3 +5,4 @@ pwd=cd clear=cls history=cat %CMDER_ROOT%\config\.history unalias=alias /d $1 +vi=vim $* diff --git a/vendor/profile.ps1 b/vendor/profile.ps1 index ba9422e..134e4d9 100644 --- a/vendor/profile.ps1 +++ b/vendor/profile.ps1 @@ -27,7 +27,14 @@ if( -not $env:PSModulePath.Contains($CmderModulePath) ){ try { Get-command -Name "vim" -ErrorAction Stop >$null } catch { - $env:Path += ";$env:CMDER_ROOT\vendor\git-for-windows\usr\share\vim\vim74" + # # 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. + set-alias -name "vim" -value $($ENV:CMDER_ROOT + "\vendor\git-for-windows\usr\bin\vim.exe $1 $2 $3 $4 $5 $6 $7 $8 $9") + set-alias -name "vi" -value $($ENV:CMDER_ROOT + "\vendor\git-for-windows\usr\bin\vim.exe $1 $2 $3 $4 $5 $6 $7 $8 $9") + } try { @@ -78,8 +85,10 @@ if ($gitStatus) { $cmderStartKey = 'HKCU:\Software\cmder' $cmderStartSubKey = 'CMDER_START' -$cmderStart = (Get-Item -Path $cmderStartKey).GetValue($cmderStartSubKey) +$cmderStart = (Get-Item -Path $cmderStartKey -ErrorAction SilentlyContinue) + if ( $cmderStart ) { + $cmderStart = $cmderStart.GetValue($cmderStartSubKey) $cmderStart = ($cmderStart).Trim('"').Trim("'") if ( $cmderStart.EndsWith(':') ) { $cmderStart += '\' @@ -96,6 +105,7 @@ if ( $cmderStart ) { Set-Location -Path "${env:HOME}" } + # Enhance Path $env:Path = "$Env:CMDER_ROOT\bin;$env:Path;$Env:CMDER_ROOT" From 5eff672a4b4d88075f411f449df83aa91f0fd946 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Mon, 23 Nov 2015 21:58:56 -0600 Subject: [PATCH 07/42] Added lambda prompt for bash/mintty, matches cmder and powershell prompts --- packignore | 1 + scripts/build.ps1 | 7 +++++++ vendor/git-prompt.sh | 22 ++++++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 vendor/git-prompt.sh diff --git a/packignore b/packignore index 538efb3..04025a6 100644 --- a/packignore +++ b/packignore @@ -17,3 +17,4 @@ Cmder.bat vendor\tmp appveyor.yml vendor\cmder.sh +vendor\git-prompt.sh diff --git a/scripts/build.ps1 b/scripts/build.ps1 index c9d10d0..998c442 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -117,4 +117,11 @@ if ( (Test-Path $($SaveTo + "git-for-windows/etc/profile.d") ) ) { Copy-Item $($SaveTo + "cmder.sh") $($SaveTo + "git-for-windows/etc/profile.d/cmder.sh") } +# Replace /etc/profile.d/git-prompt.sh with cmder lambda prompt so it runs when we start bash or mintty +if ( !(Test-Path $($SaveTo + "git-for-windows/etc/profile.d/git-prompt.sh.bak") ) ) { + write-verbose "Replacing /etc/profile.d/git-prompt.sh with our git-prompt.sh" + Move-Item $($SaveTo + "git-for-windows/etc/profile.d/git-prompt.sh") $($SaveTo + "git-for-windows/etc/profile.d/git-prompt.sh.bak") + Copy-Item $($SaveTo + "git-prompt.sh") $($SaveTo + "git-for-windows/etc/profile.d/git-prompt.sh") +} + Write-Verbose "All good and done!" diff --git a/vendor/git-prompt.sh b/vendor/git-prompt.sh new file mode 100644 index 0000000..81aedb0 --- /dev/null +++ b/vendor/git-prompt.sh @@ -0,0 +1,22 @@ +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" +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 λ From 9b25544c0555e46b631d21374ce99fb4d8ec1cbc Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Tue, 24 Nov 2015 10:58:58 -0600 Subject: [PATCH 08/42] Fixed - Powershell vim/vim alias opening a new tab when editin a file --- vendor/profile.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/profile.ps1 b/vendor/profile.ps1 index 134e4d9..54f929b 100644 --- a/vendor/profile.ps1 +++ b/vendor/profile.ps1 @@ -32,9 +32,9 @@ try { # $env:Path += $(";" + $env:CMDER_ROOT + "\vendor\git-for-windows\usr\bin") # set-alias -name "vi" -value "vim" # # I think the below is safer. - set-alias -name "vim" -value $($ENV:CMDER_ROOT + "\vendor\git-for-windows\usr\bin\vim.exe $1 $2 $3 $4 $5 $6 $7 $8 $9") - set-alias -name "vi" -value $($ENV:CMDER_ROOT + "\vendor\git-for-windows\usr\bin\vim.exe $1 $2 $3 $4 $5 $6 $7 $8 $9") + new-alias -name "vim" -value $($ENV:CMDER_ROOT + "\vendor\git-for-windows\usr\bin\vim.exe") + new-alias -name "vi" -value vim } try { From fd9c8a74b17ca21fc5abf85f47bc0971f94dbc6d Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Tue, 24 Nov 2015 14:45:52 -0600 Subject: [PATCH 09/42] Added Git for Windows icon to mintty tasks to differentiate them from 100% supported Cmder tasks --- config/ConEmu.xml | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/config/ConEmu.xml b/config/ConEmu.xml index 2e6b296..9f8acec 100644 --- a/config/ConEmu.xml +++ b/config/ConEmu.xml @@ -1,7 +1,7 @@ - + @@ -483,9 +483,9 @@ - + - + @@ -494,7 +494,7 @@ - + @@ -503,7 +503,7 @@ - + @@ -512,7 +512,7 @@ - + @@ -522,26 +522,26 @@ - + - + - + - + - + @@ -550,7 +550,7 @@ - + @@ -561,11 +561,11 @@ - + - - + + @@ -666,7 +666,7 @@ - + @@ -844,15 +844,19 @@ + + + - + + From 191316282a680a58072250ecaa8fc8ac0096c5f7 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Tue, 24 Nov 2015 14:52:13 -0600 Subject: [PATCH 10/42] Get 100% supported Cmder task icons from icons\Cmder.ico so tabs have an ico if launched from the cmder.bat file --- config/ConEmu.xml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/config/ConEmu.xml b/config/ConEmu.xml index 9f8acec..ae1fd5d 100644 --- a/config/ConEmu.xml +++ b/config/ConEmu.xml @@ -485,44 +485,44 @@ - + - + - + - + - + - + - + - + - + @@ -531,7 +531,7 @@ - + @@ -541,31 +541,31 @@ - + - + - + - + - + - - + + From 8601b0f9402457db068d01ff3db6f2149e871570 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Tue, 24 Nov 2015 16:06:39 -0600 Subject: [PATCH 11/42] added config/user-* to packignore --- packignore | 1 + 1 file changed, 1 insertion(+) diff --git a/packignore b/packignore index 04025a6..f17a33f 100644 --- a/packignore +++ b/packignore @@ -18,3 +18,4 @@ vendor\tmp appveyor.yml vendor\cmder.sh vendor\git-prompt.sh +config\user-* From 76e14cd26815acefa9ed007b24e3c89c2d13558e Mon Sep 17 00:00:00 2001 From: Chase Miller Date: Tue, 24 Nov 2015 17:26:41 -0500 Subject: [PATCH 12/42] Added check for %USERPROFILE%\AppData\Local\Programs\Git path in init.bat. Installing from https://git-scm.com/download/win seems to put git in this directory. --- vendor/init.bat | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vendor/init.bat b/vendor/init.bat index 9b66cf5..53a0d3a 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -37,6 +37,8 @@ set "GIT_INSTALL_ROOT=%ProgramFiles%\Git" ) else if exist "%ProgramFiles(x86)%\Git" ( set "GIT_INSTALL_ROOT=%ProgramFiles(x86)%\Git" +) else if exist "%USERPROFILE%\AppData\Local\Programs\Git" ( + set "GIT_INSTALL_ROOT=%USERPROFILE%\AppData\Local\Programs\Git" ) else if exist "%CMDER_ROOT%\vendor\git-for-windows" ( set "GIT_INSTALL_ROOT=%CMDER_ROOT%\vendor\git-for-windows" ) From 4154cdf20462d3af1cd85e9b0d359127f9ae4b6f Mon Sep 17 00:00:00 2001 From: Jan Schulz Date: Tue, 24 Nov 2015 23:38:26 +0100 Subject: [PATCH 13/42] Do not overwrite aliases on update --- config/aliases => vendor/aliases.example | 0 vendor/init.bat | 7 +++++++ 2 files changed, 7 insertions(+) rename config/aliases => vendor/aliases.example (100%) diff --git a/config/aliases b/vendor/aliases.example similarity index 100% rename from config/aliases rename to vendor/aliases.example diff --git a/vendor/init.bat b/vendor/init.bat index 9b66cf5..e923d0d 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -51,6 +51,13 @@ :: Enhance Path @set PATH=%CMDER_ROOT%\bin;%PATH%;%CMDER_ROOT%\ + +:: make sure we have an example file +@if not exist "%CMDER_ROOT%\config\aliases" ( + echo Creating intial aliases in %CMDER_ROOT%\config\aliases + copy "%CMDER_ROOT%\vendor\aliases.example" "%CMDER_ROOT%\config\aliases" > null +) + :: Add aliases @doskey /macrofile="%CMDER_ROOT%\config\aliases" From 4bfdf04d59dab80e1ce76d7125c546006273e188 Mon Sep 17 00:00:00 2001 From: Jan Schulz Date: Wed, 25 Nov 2015 00:11:34 +0100 Subject: [PATCH 14/42] Do not overwrite cmder.lua on update --- {config => vendor}/cmder.lua | 10 ++++++++++ vendor/init.bat | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) rename {config => vendor}/cmder.lua (92%) diff --git a/config/cmder.lua b/vendor/cmder.lua similarity index 92% rename from config/cmder.lua rename to vendor/cmder.lua index 836540d..deea404 100644 --- a/config/cmder.lua +++ b/vendor/cmder.lua @@ -189,3 +189,13 @@ for _,lua_module in ipairs(clink.find_files(completions_dir..'*.lua')) do dofile(filename) end end + +-- now do the same for all lua files in config which do not start with '_' +local user_config_dir = clink.get_env('CMDER_ROOT')..'\\config\\' +for _,lua_module in ipairs(clink.find_files(user_config_dir..'*.lua')) do + -- Skip files that starts with _. This could be useful if some files should be ignored + if not string.match(lua_module, '^_.*') then + local filename = user_config_dir..lua_module + dofile(filename) + end +end diff --git a/vendor/init.bat b/vendor/init.bat index 6f14551..36b0a50 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -24,7 +24,7 @@ ) :: Run clink -@"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\config" +@"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\vendor" :: Prepare for git-for-windows From 854cadb18576b43fa5ea15debed6165ed0d90c9c Mon Sep 17 00:00:00 2001 From: Jan Schulz Date: Wed, 25 Nov 2015 00:23:04 +0100 Subject: [PATCH 15/42] Use consistent naming: user-profile.{sh|bat|ps1} --- vendor/cmder.sh | 10 +++++----- vendor/init.bat | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/vendor/cmder.sh b/vendor/cmder.sh index a82ea80..4d1da3a 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-cmder.sh, +# Add portable user customizations ${CMDER_ROOT}/config/user-profile.sh, # these customizations will follow Cmder if $CMDER_ROOT is copied # to another machine. # @@ -35,11 +35,11 @@ PATH=${CMDER_ROOT}/bin:$PATH:${CMDER_ROOT} export PATH -if [ -f ${CMDER_ROOT}/config/user-cmder.sh ] ; then - . ${CMDER_ROOT}/config/user-cmder.sh +if [ -f ${CMDER_ROOT}/config/user-profile.sh ] ; then + . ${CMDER_ROOT}/config/user-profile.sh else - echo Creating user startup file: "${CMDER_ROOT}/config/user-cmder.sh" - cat <<-eof >"${CMDER_ROOT}/config/user-cmder.sh" + echo Creating user startup file: "${CMDER_ROOT}/config/user-profile.sh" + cat <<-eof >"${CMDER_ROOT}/config/user-profile.sh" # 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 6f14551..5df9d68 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -2,7 +2,7 @@ :: Created as part of cmder project :: !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED -:: !!! Use "%CMDER_ROOT%\config\user-startup.cmd" to add your own startup commands +:: !!! Use "%CMDER_ROOT%\config\user-profile.cmd" to add your own startup commands :: Find root dir @if not defined CMDER_ROOT ( @@ -84,11 +84,11 @@ ) ) -@if exist "%CMDER_ROOT%\config\user-startup.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-startup.cmd" + call "%CMDER_ROOT%\config\user-profile.cmd" ) else ( - @echo Creating user startup file: "%CMDER_ROOT%\config\user-startup.cmd" + @echo Creating user startup file: "%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 @@ -96,5 +96,5 @@ @echo :: @call "%%GIT_INSTALL_ROOT%%/cmd/start-ssh-agent.cmd @echo :: @set PATH=%%CMDER_ROOT%%\vendor\whatever;%%PATH%% @echo. - ) > "%CMDER_ROOT%\config\user-startup.cmd" + ) > "%CMDER_ROOT%\config\user-profile.cmd" ) From 105e381e666cc9015c933b8039b5dcc95313db36 Mon Sep 17 00:00:00 2001 From: Jan Schulz Date: Wed, 25 Nov 2015 00:12:04 +0100 Subject: [PATCH 16/42] Document the files in config --- config/Readme.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/config/Readme.md b/config/Readme.md index 77e2326..de140d3 100644 --- a/config/Readme.md +++ b/config/Readme.md @@ -1,3 +1,14 @@ ## Config -All config files must be in this folder. If there is no option to set this folder directly, it has to be hardlinked. \ No newline at end of file +All config files must be in this folder. If there is no option to set this folder +directly, it has to be hardlinked. + +* `aliases`: aliases in cmd; called form vendor\init.bat; autocreated from + `vendor\aliases.example`. +* `*.lua`: clink completitions and prompt filters; called from vendor\cmder.lua after all + other prompt filter and clink completitons are initialized; add your own. +* `user_profile.{sh|bat|ps1}: startup files for bash|cmd|powershell tasks; called from their + respective startup scripts in `vendor\`; autocreated on first start of such a task +* `.history`: the current commandline history; autoupdated on close +* `settings`: settings for readline; overwritten on update +* `ConEmu.xml`: settings from ConEmu (=the UI of cmder -> Preferences); overwritten on update \ No newline at end of file From 630ac0c5713fe4f4925ac7e62573ee635306b419 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Tue, 24 Nov 2015 19:03:46 -0600 Subject: [PATCH 17/42] reverted last change, removed config/user-* from packignore --- packignore | 1 - 1 file changed, 1 deletion(-) diff --git a/packignore b/packignore index f17a33f..04025a6 100644 --- a/packignore +++ b/packignore @@ -18,4 +18,3 @@ vendor\tmp appveyor.yml vendor\cmder.sh vendor\git-prompt.sh -config\user-* From 867910ac9e196769ed57ee58c0ebd54fa86a8fcb Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Tue, 24 Nov 2015 19:08:58 -0600 Subject: [PATCH 18/42] added config\user-* to packignore --- packignore | 1 + 1 file changed, 1 insertion(+) diff --git a/packignore b/packignore index 04025a6..f17a33f 100644 --- a/packignore +++ b/packignore @@ -18,3 +18,4 @@ vendor\tmp appveyor.yml vendor\cmder.sh vendor\git-prompt.sh +config\user-* From d0909f27e1c99512f2b6c72a8c92f48f86f635fe Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Sat, 28 Nov 2015 02:45:05 +0100 Subject: [PATCH 19/42] :arrow_up: ConEmu@151129 Changelog: http://conemu.github.io/blog/2015/11/26/Build-151126.html Skipped http://conemu.github.io/blog/2015/11/22/Build-151122.html --- vendor/sources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/sources.json b/vendor/sources.json index 258235f..0fadaee 100644 --- a/vendor/sources.json +++ b/vendor/sources.json @@ -11,8 +11,8 @@ }, { "name": "conemu-maximus5", - "version": "151119", - "url": "https://github.com/Maximus5/ConEmu/releases/download/v15.11.19/ConEmuPack.151119.7z" + "version": "151126", + "url": "https://github.com/Maximus5/ConEmu/releases/download/v15.11.26/ConEmuPack.151126.7z" }, { "name": "clink-completions", From 73f5cbdc7b01da72b4d250ed2b37ff8a4bb12885 Mon Sep 17 00:00:00 2001 From: "Dax T. Games" Date: Sat, 28 Nov 2015 11:02:44 -0600 Subject: [PATCH 20/42] README.md Updates --- README.md | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a62c6de..51f8b3b 100644 --- a/README.md +++ b/README.md @@ -56,9 +56,16 @@ In a file explorer window right click in or on a directory to see "Cmder Here" i ### Access to multiple shells in one window using tabs You can open multiple tabs each containing one of the following shells: -* Cmder | Cmder as Admin - Enhanced Windows 'cmd.exe' shell. -* Powershell | Powershell as Admin - Enhanced Windows Powershell. -* Bash/mintty | Bash/mintty as Admin - Unix/Linux like bash shell running on Windows. +|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 'powerhell.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. @@ -74,30 +81,41 @@ 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-cmder.sh +echo source \$CMDER_ROOT/vendor/mintty-colors-solarized/mintty-solarized-dark.sh>>$CMDER_ROOT/config/user-profile.sh ``` ### Cmder Portable Shell User Config User specific configuration is possible using the cmder specific shell config files. Edit the below files to add your own configuration: -* Cmder - %CMDER_ROOT%\config\user-startup.cmd -* Powershell - $ENV:CMDER_ROOT\config\user-profile.ps1 -* Bash/Mintty - $CMDER_ROOT/config/user-cmder.sh +|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| -Bash and Mintty sessions will also source the '$HOME/.bashrc' file it it exists before it sources '$CMDER_ROOT/config/user-cmder.sh'. +Note: Bash and Mintty sessions will also source the '$HOME/.bashrc' file it it exists after it sources '$CMDER_ROOT/config/user-profile.sh'. ### Aliases -You can define simple aliases with command `alias name=command`. +#### 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`. -For example there is one defined for you `alias e.=explorer .` +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' -All aliases will be saved in `/config/aliases` file +Aliases defined using the `alias.bat` command will automatically be saved in the `%CMDER_ROOT%\config\aliases` file + +#### 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`. + +If you add bash aliases to `$CMDER_ROOT/config/user-profile.sh` they will 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. ### SSH Agent To start 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 `/config/user-startup.bat` (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). ## Todo From 567889e69fb00d7a3f7f661b8552916cb7e03a3d Mon Sep 17 00:00:00 2001 From: Jan Schulz Date: Fri, 4 Dec 2015 19:57:08 +0100 Subject: [PATCH 21/42] Fix: don't garble the input line for long lines in git projects If having a long line of input in histroy, which went on into the second row and using to get back to it, you got the effect that the input was split over three lines: "text, empty, text", but using the arrows do move to the front of the first line was moving the cursor in the second (empty) row. You could change the text, but you needed to do it "in the dark". No idea why s/os.execute/is.popen/ fixes this, but it does. Partly adresses https://github.com/cmderdev/cmder/issues/749 --- vendor/cmder.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/cmder.lua b/vendor/cmder.lua index deea404..0579050 100644 --- a/vendor/cmder.lua +++ b/vendor/cmder.lua @@ -142,7 +142,7 @@ end -- @return {bool} --- function get_git_status() - return os.execute("git diff --quiet --ignore-submodules HEAD 2>nul") + return io.popen("git diff --quiet --ignore-submodules HEAD 2>nul") end function git_prompt_filter() From 5f68e4e9872128a9e21d7ccc592bdf774500c671 Mon Sep 17 00:00:00 2001 From: Vladimir Kotikov Date: Thu, 10 Dec 2015 22:09:12 +0300 Subject: [PATCH 22/42] :arrow_up: Bump clink-completions to 0.2.2 --- vendor/sources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/sources.json b/vendor/sources.json index 0fadaee..bd44149 100644 --- a/vendor/sources.json +++ b/vendor/sources.json @@ -16,7 +16,7 @@ }, { "name": "clink-completions", - "version": "0.2.1", - "url": "https://github.com/vladimir-kotikov/clink-completions/archive/0.2.1.zip" + "version": "0.2.2", + "url": "https://github.com/vladimir-kotikov/clink-completions/archive/0.2.2.zip" } ] From 41836e669b158c5d11cc6357456f69b80867d108 Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Fri, 11 Dec 2015 18:48:27 +0100 Subject: [PATCH 23/42] :arrow_up: ConEmu@151210 Changelog: https://conemu.github.io/blog/2015/12/10/Build-151210.html Skipped: * https://conemu.github.io/blog/2015/12/08/Build-151208.html * https://conemu.github.io/blog/2015/12/07/Build-151207.html * https://conemu.github.io/blog/2015/12/05/Build-151205.html * https://conemu.github.io/blog/2015/12/02/Build-151202.html * https://conemu.github.io/blog/2015/11/29/Build-151129.html --- vendor/sources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/sources.json b/vendor/sources.json index bd44149..62bc8d7 100644 --- a/vendor/sources.json +++ b/vendor/sources.json @@ -11,8 +11,8 @@ }, { "name": "conemu-maximus5", - "version": "151126", - "url": "https://github.com/Maximus5/ConEmu/releases/download/v15.11.26/ConEmuPack.151126.7z" + "version": "151210", + "url": "https://github.com/Maximus5/ConEmu/releases/download/v15.12.10/ConEmuPack.151210.7z" }, { "name": "clink-completions", From 6879a94c1056df9c5af47636c3a1360f3bf5efce Mon Sep 17 00:00:00 2001 From: Gregory Lureau Date: Tue, 15 Dec 2015 18:56:22 +0100 Subject: [PATCH 24/42] Fix vendor/init.bat when the PATH contains spaces. --- vendor/init.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/init.bat b/vendor/init.bat index 4364300..c03a7a6 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -51,7 +51,7 @@ ) :: Enhance Path -@set PATH=%CMDER_ROOT%\bin;%PATH%;%CMDER_ROOT%\ +@set "PATH=%CMDER_ROOT%\bin;%PATH%;%CMDER_ROOT%\" :: make sure we have an example file From add52c0ee6cef7517788a36e503f1091d02dc435 Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Wed, 16 Dec 2015 06:13:53 +0100 Subject: [PATCH 25/42] :arrow_up: Git for Windows@2.6.4 Changelog: https://github.com/git-for-windows/git/releases/tag/v2.6.4.windows.1 --- vendor/sources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/sources.json b/vendor/sources.json index 62bc8d7..f4e374f 100644 --- a/vendor/sources.json +++ b/vendor/sources.json @@ -1,8 +1,8 @@ [ { "name": "git-for-windows", - "version": "v2.6.3.windows.1", - "url": "https://github.com/git-for-windows/git/releases/download/v2.6.3.windows.1/PortableGit-2.6.3-32-bit.7z.exe" + "version": "v2.6.4.windows.1", + "url": "https://github.com/git-for-windows/git/releases/download/v2.6.4.windows.1/PortableGit-2.6.4-32-bit.7z.exe" }, { "name": "clink", From 1389fe0c4d81512215880037e9281bac6df3492b Mon Sep 17 00:00:00 2001 From: Vladimir Kotikov Date: Tue, 29 Dec 2015 00:23:30 +0300 Subject: [PATCH 26/42] :arrow_up: Bump clink to 0.4.6 --- vendor/sources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/sources.json b/vendor/sources.json index f4e374f..8a7850c 100644 --- a/vendor/sources.json +++ b/vendor/sources.json @@ -6,8 +6,8 @@ }, { "name": "clink", - "version": "0.4.5", - "url": "https://github.com/mridgers/clink/releases/download/0.4.5/clink_0.4.5.zip" + "version": "0.4.6", + "url": "https://github.com/mridgers/clink/releases/download/0.4.6/clink_0.4.6.zip" }, { "name": "conemu-maximus5", From c77641cf035ec033add13e56a2081c0eb3ecd835 Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Thu, 7 Jan 2016 01:50:52 +0100 Subject: [PATCH 27/42] :arrow_up: Git@2.7.0.windows1 Changelog: https://github.com/git-for-windows/git/releases/tag/v2.7.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 8a7850c..eef2624 100644 --- a/vendor/sources.json +++ b/vendor/sources.json @@ -1,8 +1,8 @@ [ { "name": "git-for-windows", - "version": "v2.6.4.windows.1", - "url": "https://github.com/git-for-windows/git/releases/download/v2.6.4.windows.1/PortableGit-2.6.4-32-bit.7z.exe" + "version": "v2.7.0.windows.1", + "url": "https://github.com/git-for-windows/git/releases/download/v2.7.0.windows.1/PortableGit-2.7.0-32-bit.7z.exe" }, { "name": "clink", From 2c0c6ed416738be76af70c978b8866493087f6ca Mon Sep 17 00:00:00 2001 From: Jan Schulz Date: Mon, 11 Jan 2016 22:09:23 +0100 Subject: [PATCH 28/42] Make "cmder here" work again The new system works by setting "CMDER_START" if a cmder.exe gets a startup path. The rest is then implemented in the profile.ps1 and init.bat. The new system works as follows: 1.If a startup path is given, cmder.exe sets this as `CMDER_START` and the startup scripts change to that directory. 2.If the usere sets a `CMDER_START` environment variable and this is not overwritten by cmder.exe, this variable is taken as the startup directory by the startup scripts. 3.If not such path is give, the conemu startup dirs is the winner, as the startup scripts don't change anything. --- launcher/src/CmderLauncher.cpp | 14 ++++++-------- vendor/init.bat | 8 +++----- vendor/profile.ps1 | 29 +++++------------------------ 3 files changed, 14 insertions(+), 37 deletions(-) diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index 330ced5..a29617e 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -63,10 +63,12 @@ optpair GetOption() if (argc == 1) { + // no commandline argument... pair = optpair(L"/START", L""); } else if (argc == 2 && argv[1][0] != L'/') { + // only a single argument: this should be a path... pair = optpair(L"/START", argv[1]); } else @@ -152,7 +154,10 @@ void StartCmder(std::wstring path, bool is_single_mode) } SetEnvironmentVariable(L"CMDER_ROOT", exeDir); - //SetEnvironmentVariable(L"CMDER_START", path.c_str()); + if (!streqi(path.c_str(), L"")) + { + SetEnvironmentVariable(L"CMDER_START", path.c_str()); + } // Send out the Settings Changed message - Once using ANSII... //SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment", SMTO_ABORTIFHUNG, 5000, NULL); @@ -160,13 +165,6 @@ void StartCmder(std::wstring path, bool is_single_mode) // ...and once using UniCode (because Windows 8 likes it that way). //SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM) L"Environment", SMTO_ABORTIFHUNG, 5000, NULL); - HKEY cmderStartRegistryKey; - if (RegCreateKeyEx(HKEY_CURRENT_USER, L"Software\\cmder", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &cmderStartRegistryKey, 0) == ERROR_SUCCESS) - { - RegSetValueEx(cmderStartRegistryKey, L"CMDER_START", 0, REG_SZ, (const BYTE*) path.c_str(), path.size() * 2); - RegCloseKey(cmderStartRegistryKey); - } - STARTUPINFO si = { 0 }; si.cb = sizeof(STARTUPINFO); #if USE_TASKBAR_API diff --git a/vendor/init.bat b/vendor/init.bat index c03a7a6..ffb4881 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -58,7 +58,7 @@ @if not exist "%CMDER_ROOT%\config\aliases" ( echo Creating intial aliases in %CMDER_ROOT%\config\aliases copy "%CMDER_ROOT%\vendor\aliases.example" "%CMDER_ROOT%\config\aliases" > null -) +) :: Add aliases @doskey /macrofile="%CMDER_ROOT%\config\aliases" @@ -76,12 +76,10 @@ :: Set home path @if not defined HOME set HOME=%USERPROFILE% +:: This is either a env variable set by the user or the result of +:: cmder.exe setting this variable due to a commandline argument or a "cmder here" @if defined CMDER_START ( @cd /d "%CMDER_START%" -) else ( - @if "%CD%\" == "%CMDER_ROOT%\" ( - @cd /d "%HOME%" - ) ) @if exist "%CMDER_ROOT%\config\user-profile.cmd" ( diff --git a/vendor/profile.ps1 b/vendor/profile.ps1 index 54f929b..6ed8a04 100644 --- a/vendor/profile.ps1 +++ b/vendor/profile.ps1 @@ -32,7 +32,7 @@ try { # $env:Path += $(";" + $env:CMDER_ROOT + "\vendor\git-for-windows\usr\bin") # set-alias -name "vi" -value "vim" # # I think the below is safer. - + new-alias -name "vim" -value $($ENV:CMDER_ROOT + "\vendor\git-for-windows\usr\bin\vim.exe") new-alias -name "vi" -value vim } @@ -82,34 +82,15 @@ if ($gitStatus) { } # Move to the wanted location -$cmderStartKey = 'HKCU:\Software\cmder' -$cmderStartSubKey = 'CMDER_START' - -$cmderStart = (Get-Item -Path $cmderStartKey -ErrorAction SilentlyContinue) - -if ( $cmderStart ) { - $cmderStart = $cmderStart.GetValue($cmderStartSubKey) - $cmderStart = ($cmderStart).Trim('"').Trim("'") - if ( $cmderStart.EndsWith(':') ) { - $cmderStart += '\' - } - - if ( ( Get-Item $cmderStart -Force ) -is [System.IO.FileInfo] ) { - $cmderStart = Split-Path $cmderStart - } - - Set-Location -Path "${cmderStart}" - - Set-ItemProperty -Path $cmderStartKey -Name $cmderStartSubKey -Value $null -} else { - Set-Location -Path "${env:HOME}" +# This is either a env variable set by the user or the result of +# cmder.exe setting this variable due to a commandline argument or a "cmder here" +if ( $ENV:CMDER_START ) { + Set-Location -Path "$ENV:CMDER_START" } - # Enhance Path $env:Path = "$Env:CMDER_ROOT\bin;$env:Path;$Env:CMDER_ROOT" - $CmderUserProfilePath = Join-Path $env:CMDER_ROOT "config\user-profile.ps1" if(Test-Path $CmderUserProfilePath) { # Create this file and place your own command in there. From 724b9a25da788ae0074d8b16bfd98fd10f0e783b Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Fri, 15 Jan 2016 00:16:18 +0100 Subject: [PATCH 29/42] :arrow_up: Bump clink to 0.4.7 --- vendor/sources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/sources.json b/vendor/sources.json index eef2624..f84387f 100644 --- a/vendor/sources.json +++ b/vendor/sources.json @@ -6,8 +6,8 @@ }, { "name": "clink", - "version": "0.4.6", - "url": "https://github.com/mridgers/clink/releases/download/0.4.6/clink_0.4.6.zip" + "version": "0.4.7", + "url": "https://github.com/mridgers/clink/releases/download/0.4.7/clink_0.4.7.zip" }, { "name": "conemu-maximus5", From 4dc1249881f5ad3e2c5c64f685e7a9320f3840fc Mon Sep 17 00:00:00 2001 From: Martin Kemp Date: Fri, 15 Jan 2016 11:47:54 +0000 Subject: [PATCH 30/42] Set tasks to always user CMDER_START CMDER_START should always be set as a result of either: 1. The user passes a directory to cmder.exe using `/START $DIR` - or - 2. Sets CMDER_START as a default environment variable. Fixes #772 --- config/ConEmu.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/config/ConEmu.xml b/config/ConEmu.xml index ae1fd5d..979a469 100644 --- a/config/ConEmu.xml +++ b/config/ConEmu.xml @@ -488,7 +488,7 @@ - + @@ -497,7 +497,7 @@ - + @@ -507,7 +507,7 @@ - + @@ -516,7 +516,7 @@ - + @@ -527,7 +527,7 @@ - + @@ -536,10 +536,10 @@ - + - + @@ -548,14 +548,14 @@ - + - + From 9c7a0379485946e120db841ed10d75c578a5224b Mon Sep 17 00:00:00 2001 From: Martin Kemp Date: Fri, 15 Jan 2016 12:10:24 +0000 Subject: [PATCH 31/42] Set CMDER_START to USER_PROFILE if no path given. --- launcher/src/CmderLauncher.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index a29617e..bf616ad 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -153,17 +153,15 @@ void StartCmder(std::wstring path, bool is_single_mode) swprintf_s(args, L"/Icon \"%s\" /Title Cmder", icoPath); } - SetEnvironmentVariable(L"CMDER_ROOT", exeDir); - if (!streqi(path.c_str(), L"")) - { - SetEnvironmentVariable(L"CMDER_START", path.c_str()); - } - - // Send out the Settings Changed message - Once using ANSII... - //SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment", SMTO_ABORTIFHUNG, 5000, NULL); - - // ...and once using UniCode (because Windows 8 likes it that way). - //SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM) L"Environment", SMTO_ABORTIFHUNG, 5000, NULL); + SetEnvironmentVariable(L"CMDER_ROOT", exeDir); + if (!streqi(path.c_str(), L"")) + { + SetEnvironmentVariable(L"CMDER_START", path.c_str()); + } + else + { + SetEnvironmentVariable(L"CMDER_START", GetEnvironmentVariable(L"USER_PROFILE")); + } STARTUPINFO si = { 0 }; si.cb = sizeof(STARTUPINFO); From e7243efce274436a9544290048fe9d6823662115 Mon Sep 17 00:00:00 2001 From: Martin Kemp Date: Fri, 15 Jan 2016 12:28:24 +0000 Subject: [PATCH 32/42] Fix build script not exiting on msbuild failure. --- scripts/build.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 998c442..473cfbe 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -105,6 +105,9 @@ Pop-Location if($Compile) { Push-Location -Path $launcher msbuild CmderLauncher.vcxproj /p:configuration=Release + if ($LastExitCode -ne 0) { + throw "msbuild failed to build the executable." + } Pop-Location } else { Write-Warning "You are not building a launcher, Use -Compile" From df7a6629659ece3c9af23ef8076f964e9a49c866 Mon Sep 17 00:00:00 2001 From: Martin Kemp Date: Fri, 15 Jan 2016 12:44:10 +0000 Subject: [PATCH 33/42] Get the environment variable correctly. --- launcher/src/CmderLauncher.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index bf616ad..eeff868 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -160,7 +160,9 @@ void StartCmder(std::wstring path, bool is_single_mode) } else { - SetEnvironmentVariable(L"CMDER_START", GetEnvironmentVariable(L"USER_PROFILE")); + static char buff[MAX_PATH]; + GetEnvironmentVariable(L"USER_PROFILE", buff, MAX_PATH); + SetEnvironmentVariable(L"CMDER_START", buff); } STARTUPINFO si = { 0 }; From fabcd468a797937a670c906b4e78442c9374529e Mon Sep 17 00:00:00 2001 From: Martin Kemp Date: Fri, 15 Jan 2016 13:01:55 +0000 Subject: [PATCH 34/42] Use the correct type and initialise it. --- 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 eeff868..be99de7 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -160,7 +160,7 @@ void StartCmder(std::wstring path, bool is_single_mode) } else { - static char buff[MAX_PATH]; + static wchar_t buff[MAX_PATH] = { 0 }; GetEnvironmentVariable(L"USER_PROFILE", buff, MAX_PATH); SetEnvironmentVariable(L"CMDER_START", buff); } From 73e1eb2a8bea93d4759f07cbb3a3145203c682fe Mon Sep 17 00:00:00 2001 From: Martin Kemp Date: Fri, 15 Jan 2016 13:13:16 +0000 Subject: [PATCH 35/42] Ensure Environment Variables are propagated. --- launcher/src/CmderLauncher.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index be99de7..6ac22e5 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -164,6 +164,10 @@ void StartCmder(std::wstring path, bool is_single_mode) GetEnvironmentVariable(L"USER_PROFILE", buff, MAX_PATH); SetEnvironmentVariable(L"CMDER_START", buff); } + + // Ensure EnvironmentVariables are propagated. + SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment", SMTO_ABORTIFHUNG, 5000, NULL); + SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM) L"Environment", SMTO_ABORTIFHUNG, 5000, NULL); // For Windows >= 8 STARTUPINFO si = { 0 }; si.cb = sizeof(STARTUPINFO); From 788b5262b4d71e1643f328a5eb84912453844b2a Mon Sep 17 00:00:00 2001 From: Jan Schulz Date: Sat, 9 Jan 2016 12:43:52 +0100 Subject: [PATCH 36/42] Reorganize how clink settings are loaded 4bfdf04d59dab80e1ce76d7125c546006273e188 moved all clink config files to vendor/ and therefore the files in config/ were not used and .history was also moved to vendor/. The new arrangement uses `--script` to load our own clink.lua file which in turn as the first thing loads the original clink.lua file. The user defined files are again in config/. As clink regenerates these files, if they are not present, this also means that we don't need to include the settings file in the git repo and therefore don't overwrite it on updates. --- config/settings | 43 --------------------------------- vendor/{cmder.lua => clink.lua} | 17 ++++++------- vendor/init.bat | 8 +++++- 3 files changed, 15 insertions(+), 53 deletions(-) delete mode 100644 config/settings rename vendor/{cmder.lua => clink.lua} (92%) diff --git a/config/settings b/config/settings deleted file mode 100644 index ea1bd7e..0000000 --- a/config/settings +++ /dev/null @@ -1,43 +0,0 @@ -# name: Ctrl-D exits -# type: bool -# Ctrl-D exits the process when it is pressed on an empty line. -ctrld_exits = 1 - -# name: Ctrl-C raises exception -# type: bool -# When Ctrl-C is pressed Clink will pass it thourgh to the parent by raising the -# appropriate exception. -passthrough_ctrlc = 1 - -# name: Esc clears line -# type: bool -# Clink clears the current line when Esc is pressed (unless Readline's Vi mode -# is enabled). -esc_clears_line = 1 - -# name: Match display colour -# type: int -# Colour to use when displaying matches. A value less than 0 will be the -# opposite brightness of the default colour. -match_colour = -1 - -# name: Executable match style -# type: enum -# Changes how Clink will match executables when there is no path separator on -# the line. 0 = PATH only, 1 = PATH and CWD, 2 = PATH, CWD, and directories. In -# all cases both executables and directories are matched when there is a path -# separator present. -exec_match_style = 2 - -# name: Prompt colour -# type: int -# Surrounds the prompt in ANSI escape codes to set the prompt's colour. Disabled -# when the value is less than 0. -prompt_colour = -1 - -# name: Auto-answer terminate prompt -# type: enum -# Automatically answers cmd.exe's 'Terminate batch job (Y/N)?' prompts. 0 = -# disabled, 1 = answer 'Y', 2 = answer 'N'. -terminate_autoanswer = 0 - diff --git a/vendor/cmder.lua b/vendor/clink.lua similarity index 92% rename from vendor/cmder.lua rename to vendor/clink.lua index 0579050..f993702 100644 --- a/vendor/cmder.lua +++ b/vendor/clink.lua @@ -1,3 +1,11 @@ +-- At first, load the original clink.lua file +-- this is needed as we set the script path to this dir and therefore the original +-- clink.lua is not loaded. +local clink_lua_file = clink.get_env('CMDER_ROOT')..'\\vendor\\clink\\clink.lua' +dofile(clink_lua_file) + +-- now add our own things... + function lambda_prompt_filter() clink.prompt.value = string.gsub(clink.prompt.value, "{lamb}", "λ") end @@ -190,12 +198,3 @@ for _,lua_module in ipairs(clink.find_files(completions_dir..'*.lua')) do end end --- now do the same for all lua files in config which do not start with '_' -local user_config_dir = clink.get_env('CMDER_ROOT')..'\\config\\' -for _,lua_module in ipairs(clink.find_files(user_config_dir..'*.lua')) do - -- Skip files that starts with _. This could be useful if some files should be ignored - if not string.match(lua_module, '^_.*') then - local filename = user_config_dir..lua_module - dofile(filename) - end -end diff --git a/vendor/init.bat b/vendor/init.bat index ffb4881..89e27c0 100644 --- a/vendor/init.bat +++ b/vendor/init.bat @@ -23,8 +23,14 @@ set architecture=64 ) +:: Tell the user about the clink config files... +@if not exist "%CMDER_ROOT%\config\settings" ( + echo Generating clink initial settings in %CMDER_ROOT%\config\settings + echo Additional *.lua files in %CMDER_ROOT%\config are loaded on startup. +) + :: Run clink -@"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\vendor" +@"%CMDER_ROOT%\vendor\clink\clink_x%architecture%.exe" inject --quiet --profile "%CMDER_ROOT%\config" --scripts "%CMDER_ROOT%\vendor" :: Prepare for git-for-windows From fe45b186e0fec48181ad078f98c1a3d8e5086255 Mon Sep 17 00:00:00 2001 From: Jan Schulz Date: Fri, 15 Jan 2016 18:06:35 +0100 Subject: [PATCH 37/42] clink.lua: add header Introduce a header like in the rest of the scripts that this file is overwritten on updates and should not be modified. --- vendor/clink.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vendor/clink.lua b/vendor/clink.lua index f993702..fed2baf 100644 --- a/vendor/clink.lua +++ b/vendor/clink.lua @@ -1,3 +1,9 @@ +-- default script for clink, called by init.bat when injecting clink + +-- !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED +-- !!! Use "%CMDER_ROOT%\config\.lua" to add your lua startup scripts + + -- At first, load the original clink.lua file -- this is needed as we set the script path to this dir and therefore the original -- clink.lua is not loaded. From c055ce1c13ac25565673b81a8fdb44172b059fa8 Mon Sep 17 00:00:00 2001 From: Martin Kemp Date: Sun, 31 Jan 2016 21:35:57 +0000 Subject: [PATCH 38/42] Get USER_PROFILE differently USER_PROFILE is a known folder, so use that functionality to get it. --- launcher/src/CmderLauncher.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/launcher/src/CmderLauncher.cpp b/launcher/src/CmderLauncher.cpp index 6ac22e5..510d8ad 100644 --- a/launcher/src/CmderLauncher.cpp +++ b/launcher/src/CmderLauncher.cpp @@ -3,6 +3,8 @@ #include #include "resource.h" #include +#include + #pragma comment(lib, "Shlwapi.lib") @@ -156,13 +158,18 @@ void StartCmder(std::wstring path, bool is_single_mode) SetEnvironmentVariable(L"CMDER_ROOT", exeDir); if (!streqi(path.c_str(), L"")) { - SetEnvironmentVariable(L"CMDER_START", path.c_str()); + if (!SetEnvironmentVariable(L"CMDER_START", path.c_str())) { + MessageBox(NULL, _T("Error trying to set CMDER_START to given path!"), _T("Error"), MB_OK); + } } else { - static wchar_t buff[MAX_PATH] = { 0 }; - GetEnvironmentVariable(L"USER_PROFILE", buff, MAX_PATH); - SetEnvironmentVariable(L"CMDER_START", buff); + wchar_t* homeProfile = 0; + SHGetKnownFolderPath(FOLDERID_Profile, 0, NULL, &homeProfile); + if (!SetEnvironmentVariable(L"CMDER_START", homeProfile)) { + MessageBox(NULL, _T("Error trying to set CMDER_START to USER_PROFILE!"), _T("Error"), MB_OK); + } + CoTaskMemFree(static_cast(homeProfile)); } // Ensure EnvironmentVariables are propagated. @@ -177,8 +184,10 @@ void StartCmder(std::wstring path, bool is_single_mode) #endif PROCESS_INFORMATION pi; - - CreateProcess(conEmuPath, args, NULL, NULL, false, 0, NULL, NULL, &si, &pi); + if (!CreateProcess(conEmuPath, args, NULL, NULL, false, 0, NULL, NULL, &si, &pi)) { + MessageBox(NULL, _T("Unable to create the ConEmu Process!"), _T("Error"), MB_OK); + return; + } } bool IsUserOnly(std::wstring opt) From 07b426355eb650057f0daee081304f3931ebf432 Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Wed, 3 Feb 2016 03:13:43 +0100 Subject: [PATCH 39/42] :arrow_up: Git@2.7.0.windows.2 Changelog: https://github.com/git-for-windows/git/releases/tag/v2.7.0.windows.2 --- vendor/sources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/sources.json b/vendor/sources.json index f84387f..4ab95db 100644 --- a/vendor/sources.json +++ b/vendor/sources.json @@ -1,8 +1,8 @@ [ { "name": "git-for-windows", - "version": "v2.7.0.windows.1", - "url": "https://github.com/git-for-windows/git/releases/download/v2.7.0.windows.1/PortableGit-2.7.0-32-bit.7z.exe" + "version": "v2.7.0.windows.2", + "url": "https://github.com/git-for-windows/git/releases/download/v2.7.0.windows.2/PortableGit-2.7.0.2-32-bit.7z.exe" }, { "name": "clink", From fccba9269ddc286a2d272ecd6ea30a61b52000d8 Mon Sep 17 00:00:00 2001 From: Benjamin Staneck Date: Wed, 3 Feb 2016 03:15:56 +0100 Subject: [PATCH 40/42] :arrow_up: ConEmu@160202 Changelog: 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 4ab95db..23c56e4 100644 --- a/vendor/sources.json +++ b/vendor/sources.json @@ -11,8 +11,8 @@ }, { "name": "conemu-maximus5", - "version": "151210", - "url": "https://github.com/Maximus5/ConEmu/releases/download/v15.12.10/ConEmuPack.151210.7z" + "version": "160202", + "url": "https://github.com/Maximus5/ConEmu/releases/download/v16.02.02/ConEmuPack.160202.7z" }, { "name": "clink-completions", From 6bb07d9b196623a2472427b63fd027e900a4f0b2 Mon Sep 17 00:00:00 2001 From: Martin Kemp Date: Mon, 8 Feb 2016 18:19:58 +0000 Subject: [PATCH 41/42] Revert "Set tasks to always user CMDER_START" This reverts commit 4dc1249881f5ad3e2c5c64f685e7a9320f3840fc. --- config/ConEmu.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/config/ConEmu.xml b/config/ConEmu.xml index 979a469..ae1fd5d 100644 --- a/config/ConEmu.xml +++ b/config/ConEmu.xml @@ -488,7 +488,7 @@ - + @@ -497,7 +497,7 @@ - + @@ -507,7 +507,7 @@ - + @@ -516,7 +516,7 @@ - + @@ -527,7 +527,7 @@ - + @@ -536,10 +536,10 @@ - + - + @@ -548,14 +548,14 @@ - + - + From 97cae2bdc7970558708903851a25d14bc82442f1 Mon Sep 17 00:00:00 2001 From: Martin Kemp Date: Mon, 8 Feb 2016 18:26:57 +0000 Subject: [PATCH 42/42] Bring variable into line --- config/ConEmu.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/ConEmu.xml b/config/ConEmu.xml index ae1fd5d..bd520e2 100644 --- a/config/ConEmu.xml +++ b/config/ConEmu.xml @@ -527,7 +527,7 @@ - +