mirror of
https://github.com/cmderdev/cmder.git
synced 2025-07-17 21:19:41 +08:00
Compare commits
34 Commits
Author | SHA1 | Date | |
---|---|---|---|
a49c1b3f3d | |||
fff6e4506c | |||
a71c6a50ad | |||
5e703796c9 | |||
b88a01822f | |||
3bf07c088d | |||
724930d69d | |||
badb027c24 | |||
145a1b144b | |||
29c5e83975 | |||
1c02c55c2f | |||
74fc14eadf | |||
0729c06c20 | |||
6da96fb7ec | |||
ba610f5f7b | |||
7930c9bfe5 | |||
bafaf7cba4 | |||
3c14d19a27 | |||
13941a44ec | |||
ee4f85de85 | |||
9d6e5c12a2 | |||
da27f9be9f | |||
124565f36a | |||
46d468aea0 | |||
dc27c53739 | |||
7479d620b1 | |||
a8d32611a9 | |||
b6042a7ca1 | |||
dcf22af3c8 | |||
b58ff9bb53 | |||
68d9425c89 | |||
7ca2f5503a | |||
a7237370e3 | |||
25005930ba |
1
.gitignore
vendored
1
.gitignore
vendored
@ -13,6 +13,7 @@ build/
|
|||||||
Version v*
|
Version v*
|
||||||
*.bak
|
*.bak
|
||||||
config/user-*
|
config/user-*
|
||||||
|
config/settings
|
||||||
config/aliases
|
config/aliases
|
||||||
config/profile.d
|
config/profile.d
|
||||||
.github_changelog_generator
|
.github_changelog_generator
|
||||||
|
21
LICENSE
Normal file
21
LICENSE
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2017 Samuel Vasko
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
30
README.md
30
README.md
@ -157,7 +157,7 @@ If you want to run SSH agent on startup, include the line `@call "%GIT_INSTALL_R
|
|||||||
1. Click the '+' button to add a task.
|
1. Click the '+' button to add a task.
|
||||||
1. Name the new task in the top text box.
|
1. Name the new task in the top text box.
|
||||||
1. Provide task parameters, this is optional.
|
1. Provide task parameters, this is optional.
|
||||||
1. Add ```cmd /c "[path_to_external_env]\bin\bash --login -i" -new_console:d:%USERPROFILE%``` to the `Commands` text box.
|
1. Add ```cmd /c "[path_to_external_env]\bin\bash --login -i" -new_console``` to the `Commands` text box.
|
||||||
|
|
||||||
Recommended Optional Steps:
|
Recommended Optional Steps:
|
||||||
|
|
||||||
@ -176,6 +176,34 @@ Uncomment and edit the below line in the script to use Cmder config even when la
|
|||||||
# CMDER_ROOT=${USERPROFILE}/cmder # This is not required if launched from Cmder.
|
# CMDER_ROOT=${USERPROFILE}/cmder # This is not required if launched from Cmder.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Upgrading
|
||||||
|
|
||||||
|
The process of upgrading Cmder depends on the version/build you are currently running
|
||||||
|
|
||||||
|
If you have a `[cmder_root]/config/user-conemu.xml`, you are running a newer version of Cmder, follow the below process:
|
||||||
|
|
||||||
|
1. Exit all Cmder sessions and relaunch `[cmder_root]/cmder.exe`, this backs up your existing `[cmder_root]/vendor/conemu-maximus5/conemu.xml` to `[cmder_root]/config/user-conemu.xml`.
|
||||||
|
|
||||||
|
* The `[cmder_root]/config/user-conemu.xml` contains any custom settings you have made using the 'Setup Tasks' settings dialog.
|
||||||
|
|
||||||
|
2. Exit all Cmder sessions and backup any files you have manually edited under `[cmder_root]/vendor`.
|
||||||
|
|
||||||
|
* Editing files under `[cmder_root]/vendor` is not recommended since you will need to re-apply these changes after any upgrade. All user customizations should go in '[cmder_root]/config' folder.
|
||||||
|
|
||||||
|
3. Delete the `[cmder_root]/vendor` folder.
|
||||||
|
4. Extract the new `cmder.zip` or `cmder_mini.zip` into `[cmder_root]/` overwriting all files when prompted.
|
||||||
|
|
||||||
|
If you do not have a `[cmder_root]/config/user-conemu.xml`, you are running an older version of cmder, follow the below process:
|
||||||
|
|
||||||
|
1. Exit all Cmder sessions and backup `[cmder_root]/vendor/conemu-maximus5/conemu.xml` to `[cmder_root]/config/user-conemu.xml`.
|
||||||
|
|
||||||
|
2. Backup any files you have manually edited under `[cmder_root]/vendor`.
|
||||||
|
|
||||||
|
* Editing files under `[cmder_root]/vendor` is not recommended since you will need to re-apply these changes after any upgrade. All user customizations should go in '[cmder_root]/config' folder.
|
||||||
|
|
||||||
|
3. Delete the `[cmder_root]/vendor` folder.
|
||||||
|
4. Extract the new `cmder.zip` or `cmder_mini.zip` into `[cmder_root]/` overwriting all files when prompted.
|
||||||
|
|
||||||
## Current development builds
|
## Current development builds
|
||||||
|
|
||||||
You can download builds of the current development branch by going to AppVeyor via the following link:
|
You can download builds of the current development branch by going to AppVeyor via the following link:
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
|
|
||||||
if "%aliases%" == "" (
|
if "%ALIASES%" == "" (
|
||||||
set ALIASES=%CMDER_ROOT%\config\user-aliases.cmd
|
set ALIASES="%CMDER_ROOT%\config\user-aliases.cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
setlocal enabledelayedexpansion
|
setlocal enabledelayedexpansion
|
||||||
@ -21,7 +21,7 @@ goto parseargument
|
|||||||
set currentarg=%~1
|
set currentarg=%~1
|
||||||
|
|
||||||
if /i "%currentarg%" equ "/f" (
|
if /i "%currentarg%" equ "/f" (
|
||||||
set aliases=%~2
|
set ALIASES=%~2
|
||||||
shift
|
shift
|
||||||
goto :do_shift
|
goto :do_shift
|
||||||
) else if /i "%currentarg%" == "/reload" (
|
) else if /i "%currentarg%" == "/reload" (
|
||||||
@ -50,16 +50,16 @@ goto parseargument
|
|||||||
)
|
)
|
||||||
rem #endregion parseargument
|
rem #endregion parseargument
|
||||||
|
|
||||||
if "%aliases%" neq "%CMDER_ROOT%\config\user-aliases.cmd" (
|
if "%ALIASES%" neq "%CMDER_ROOT%\config\user-aliases.cmd" (
|
||||||
set _x=!_x:/f %aliases% =!
|
set _x=!_x:/f "%ALIASES%" =!
|
||||||
|
|
||||||
if not exist "%aliases%" (
|
if not exist "%ALIASES%" (
|
||||||
echo ;= @echo off>"%aliases%"
|
echo ;= @echo off>"%ALIASES%"
|
||||||
echo ;= rem Call DOSKEY and use this file as the macrofile>>"%aliases%"
|
echo ;= rem Call DOSKEY and use this file as the macrofile>>"%ALIASES%"
|
||||||
echo ;= %%SystemRoot%%\system32\doskey /listsize=1000 /macrofile=%%0%%>>"%aliases%"
|
echo ;= %%SystemRoot%%\system32\doskey /listsize=1000 /macrofile=%%0%%>>"%ALIASES%"
|
||||||
echo ;= rem In batch mode, jump to the end of the file>>"%aliases%"
|
echo ;= rem In batch mode, jump to the end of the file>>"%ALIASES%"
|
||||||
echo ;= goto:eof>>"%aliases%"
|
echo ;= goto:eof>>"%ALIASES%"
|
||||||
echo ;= Add aliases below here>>"%aliases%"
|
echo ;= Add aliases below here>>"%ALIASES%"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -488,7 +488,7 @@
|
|||||||
<key name="Task1" modified="2015-11-24 14:49:10" build="151119">
|
<key name="Task1" modified="2015-11-24 14:49:10" build="151119">
|
||||||
<value name="Name" type="string" data="{cmd::Cmder as Admin}"/>
|
<value name="Name" type="string" data="{cmd::Cmder as Admin}"/>
|
||||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
||||||
<value name="Cmd1" type="string" data="*cmd /k "%ConEmuDir%\..\init.bat" -new_console:d:%USERPROFILE%"/>
|
<value name="Cmd1" type="string" data="*cmd /k "%ConEmuDir%\..\init.bat""/>
|
||||||
<value name="Active" type="dword" data="00000000"/>
|
<value name="Active" type="dword" data="00000000"/>
|
||||||
<value name="Count" type="dword" data="00000001"/>
|
<value name="Count" type="dword" data="00000001"/>
|
||||||
<value name="Hotkey" type="dword" data="00000000"/>
|
<value name="Hotkey" type="dword" data="00000000"/>
|
||||||
@ -497,7 +497,7 @@
|
|||||||
<key name="Task2" modified="2015-11-24 14:49:10" build="151119">
|
<key name="Task2" modified="2015-11-24 14:49:10" build="151119">
|
||||||
<value name="Name" type="string" data="{cmd::Cmder}"/>
|
<value name="Name" type="string" data="{cmd::Cmder}"/>
|
||||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
||||||
<value name="Cmd1" type="string" data="cmd /k "%ConEmuDir%\..\init.bat" -new_console:d:%USERPROFILE%"/>
|
<value name="Cmd1" type="string" data="cmd /k "%ConEmuDir%\..\init.bat""/>
|
||||||
<value name="Active" type="dword" data="00000000"/>
|
<value name="Active" type="dword" data="00000000"/>
|
||||||
<value name="Count" type="dword" data="00000001"/>
|
<value name="Count" type="dword" data="00000001"/>
|
||||||
<value name="Hotkey" type="dword" data="00000000"/>
|
<value name="Hotkey" type="dword" data="00000000"/>
|
||||||
@ -507,7 +507,7 @@
|
|||||||
<value name="Name" type="string" data="{Powershell::PowerShell as Admin}"/>
|
<value name="Name" type="string" data="{Powershell::PowerShell as Admin}"/>
|
||||||
<value name="Hotkey" type="dword" data="00000000"/>
|
<value name="Hotkey" type="dword" data="00000000"/>
|
||||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
||||||
<value name="Cmd1" type="string" data="*PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''" -new_console:d:"%USERPROFILE%""/>
|
<value name="Cmd1" type="string" data="*PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''""/>
|
||||||
<value name="Active" type="dword" data="00000000"/>
|
<value name="Active" type="dword" data="00000000"/>
|
||||||
<value name="Count" type="dword" data="00000001"/>
|
<value name="Count" type="dword" data="00000001"/>
|
||||||
<value name="Flags" type="dword" data="00000000"/>
|
<value name="Flags" type="dword" data="00000000"/>
|
||||||
@ -516,7 +516,7 @@
|
|||||||
<value name="Name" type="string" data="{Powershell::Powershell}"/>
|
<value name="Name" type="string" data="{Powershell::Powershell}"/>
|
||||||
<value name="Hotkey" type="dword" data="00000000"/>
|
<value name="Hotkey" type="dword" data="00000000"/>
|
||||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
||||||
<value name="Cmd1" type="string" data="PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''" -new_console:d:"%USERPROFILE%""/>
|
<value name="Cmd1" type="string" data="PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression '. ''%ConEmuDir%\..\profile.ps1'''""/>
|
||||||
<value name="Cmd2" type="string" data="%CMDER_ROOT%\vendor\git-for-windows\git-bash.exe"/>
|
<value name="Cmd2" type="string" data="%CMDER_ROOT%\vendor\git-for-windows\git-bash.exe"/>
|
||||||
<value name="Active" type="dword" data="00000000"/>
|
<value name="Active" type="dword" data="00000000"/>
|
||||||
<value name="Count" type="dword" data="00000001"/>
|
<value name="Count" type="dword" data="00000001"/>
|
||||||
@ -527,7 +527,7 @@
|
|||||||
<value name="Flags" type="dword" data="00000000"/>
|
<value name="Flags" type="dword" data="00000000"/>
|
||||||
<value name="Hotkey" type="dword" data="00000000"/>
|
<value name="Hotkey" type="dword" data="00000000"/>
|
||||||
<value name="GuiArgs" type="string" data="/icon "%ConEmuDir%\..\git-for-windows\usr\share\git\git-for-windows.ico""/>
|
<value name="GuiArgs" type="string" data="/icon "%ConEmuDir%\..\git-for-windows\usr\share\git\git-for-windows.ico""/>
|
||||||
<value name="Cmd1" type="string" data="*%ConEmuDir%\..\git-for-windows\usr\bin\mintty.exe /bin/bash -l -new_console:d:%USERPROFILE%"/>
|
<value name="Cmd1" type="string" data="*%ConEmuDir%\..\git-for-windows\usr\bin\mintty.exe /bin/bash -l"/>
|
||||||
<value name="Active" type="dword" data="00000000"/>
|
<value name="Active" type="dword" data="00000000"/>
|
||||||
<value name="Count" type="dword" data="00000001"/>
|
<value name="Count" type="dword" data="00000001"/>
|
||||||
</key>
|
</key>
|
||||||
@ -536,10 +536,10 @@
|
|||||||
<value name="Flags" type="dword" data="00000000"/>
|
<value name="Flags" type="dword" data="00000000"/>
|
||||||
<value name="Hotkey" type="dword" data="00000000"/>
|
<value name="Hotkey" type="dword" data="00000000"/>
|
||||||
<value name="GuiArgs" type="string" data="/icon "%ConEmuDir%\..\git-for-windows\usr\share\git\git-for-windows.ico""/>
|
<value name="GuiArgs" type="string" data="/icon "%ConEmuDir%\..\git-for-windows\usr\share\git\git-for-windows.ico""/>
|
||||||
<value name="Cmd1" type="string" data="%ConEmuDir%\..\git-for-windows\usr\bin\mintty.exe /bin/bash -l -new_console:d:%userProfile%"/>
|
<value name="Cmd1" type="string" data="%ConEmuDir%\..\git-for-windows\usr\bin\mintty.exe /bin/bash -l"/>
|
||||||
<value name="Active" type="dword" data="00000000"/>
|
<value name="Active" type="dword" data="00000000"/>
|
||||||
<value name="Count" type="dword" data="00000001"/>
|
<value name="Count" type="dword" data="00000001"/>
|
||||||
<value name="Cmd2" type="string" data="%CMDER_ROOT%vendor\git-for-windows\usr\bin\mintty.exe /bin/bash -l -new_console:d:%userProfile%"/>
|
<value name="Cmd2" type="string" data="%CMDER_ROOT%vendor\git-for-windows\usr\bin\mintty.exe /bin/bash -l"/>
|
||||||
</key>
|
</key>
|
||||||
<key name="Task7" modified="2015-11-24 14:49:10" build="151119">
|
<key name="Task7" modified="2015-11-24 14:49:10" build="151119">
|
||||||
<value name="Name" type="string" data="{bash::bash as Admin}"/>
|
<value name="Name" type="string" data="{bash::bash as Admin}"/>
|
||||||
@ -548,14 +548,14 @@
|
|||||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
||||||
<value name="Active" type="dword" data="00000000"/>
|
<value name="Active" type="dword" data="00000000"/>
|
||||||
<value name="Count" type="dword" data="00000001"/>
|
<value name="Count" type="dword" data="00000001"/>
|
||||||
<value name="Cmd1" type="string" data="*cmd /c "%ConEmuDir%\..\git-for-windows\bin\bash" --login -i -new_console:d:%USERPROFILE%"/>
|
<value name="Cmd1" type="string" data="*cmd /c "%ConEmuDir%\..\git-for-windows\bin\bash --login -i""/>
|
||||||
</key>
|
</key>
|
||||||
<key name="Task8" modified="2015-11-24 14:49:10" build="151119">
|
<key name="Task8" modified="2015-11-24 14:49:10" build="151119">
|
||||||
<value name="Name" type="string" data="{bash::bash}"/>
|
<value name="Name" type="string" data="{bash::bash}"/>
|
||||||
<value name="Flags" type="dword" data="00000000"/>
|
<value name="Flags" type="dword" data="00000000"/>
|
||||||
<value name="Hotkey" type="dword" data="00000000"/>
|
<value name="Hotkey" type="dword" data="00000000"/>
|
||||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
||||||
<value name="Cmd1" type="string" data="cmd /c "%ConEmuDir%\..\git-for-windows\bin\bash" --login -i -new_console:d:%USERPROFILE%"/>
|
<value name="Cmd1" type="string" data="cmd /c "%ConEmuDir%\..\git-for-windows\bin\bash --login -i""/>
|
||||||
<value name="Active" type="dword" data="00000000"/>
|
<value name="Active" type="dword" data="00000000"/>
|
||||||
<value name="Count" type="dword" data="00000001"/>
|
<value name="Count" type="dword" data="00000001"/>
|
||||||
</key>
|
</key>
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
#pragma comment(lib, "Shlwapi.lib")
|
#pragma comment(lib, "Shlwapi.lib")
|
||||||
|
|
||||||
#ifndef UNICODE
|
#ifndef UNICODE
|
||||||
@ -54,7 +53,6 @@ typedef struct _option
|
|||||||
|
|
||||||
typedef std::pair<std::wstring, std::wstring> optpair;
|
typedef std::pair<std::wstring, std::wstring> optpair;
|
||||||
|
|
||||||
|
|
||||||
optpair GetOption()
|
optpair GetOption()
|
||||||
{
|
{
|
||||||
wchar_t * cmd = GetCommandLine();
|
wchar_t * cmd = GetCommandLine();
|
||||||
@ -157,7 +155,7 @@ void StartCmder(std::wstring path, bool is_single_mode, std::wstring taskName =
|
|||||||
{
|
{
|
||||||
MessageBox(NULL,
|
MessageBox(NULL,
|
||||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||||
? L"Failed to copy ConEmu.xml file to new location! Restart cmder as administrator."
|
? L"Failed to copy ConEmu.xml file to new location! Restart Cmder as administrator."
|
||||||
: L"Failed to copy ConEmu.xml file to new location!", MB_TITLE, MB_ICONSTOP);
|
: L"Failed to copy ConEmu.xml file to new location!", MB_TITLE, MB_ICONSTOP);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -171,13 +169,20 @@ void StartCmder(std::wstring path, bool is_single_mode, std::wstring taskName =
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (streqi(path.c_str(), L""))
|
||||||
|
{
|
||||||
|
TCHAR buff[MAX_PATH];
|
||||||
|
const DWORD ret = GetEnvironmentVariable(L"USERPROFILE", buff, MAX_PATH);
|
||||||
|
path = buff;
|
||||||
|
}
|
||||||
|
|
||||||
if (is_single_mode)
|
if (is_single_mode)
|
||||||
{
|
{
|
||||||
swprintf_s(args, L"/single /Icon \"%s\" /Title Cmder", icoPath);
|
swprintf_s(args, L"/single /Icon \"%s\" /Title Cmder /dir \"%s\"", icoPath, path.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
swprintf_s(args, L"/Icon \"%s\" /Title Cmder", icoPath);
|
swprintf_s(args, L"/Icon \"%s\" /Title Cmder /dir \"%s\"", icoPath, path.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!taskName.empty()) {
|
if (!taskName.empty()) {
|
||||||
@ -185,14 +190,8 @@ void StartCmder(std::wstring path, bool is_single_mode, std::wstring taskName =
|
|||||||
}
|
}
|
||||||
|
|
||||||
SetEnvironmentVariable(L"CMDER_ROOT", exeDir);
|
SetEnvironmentVariable(L"CMDER_ROOT", exeDir);
|
||||||
if (!streqi(path.c_str(), L""))
|
|
||||||
{
|
|
||||||
if (!SetEnvironmentVariable(L"CMDER_START", path.c_str())) {
|
|
||||||
MessageBox(NULL, _T("Error trying to set CMDER_START to given path!"), _T("Error"), MB_OK);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Ensure EnvironmentVariables are propagated.
|
|
||||||
|
|
||||||
|
// Ensure EnvironmentVariables are propagated.
|
||||||
|
|
||||||
STARTUPINFO si = { 0 };
|
STARTUPINFO si = { 0 };
|
||||||
si.cb = sizeof(STARTUPINFO);
|
si.cb = sizeof(STARTUPINFO);
|
||||||
@ -202,13 +201,12 @@ void StartCmder(std::wstring path, bool is_single_mode, std::wstring taskName =
|
|||||||
#endif
|
#endif
|
||||||
PROCESS_INFORMATION pi;
|
PROCESS_INFORMATION pi;
|
||||||
if (!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);
|
MessageBox(NULL, _T("Unable to create the ConEmu process!"), _T("Error"), MB_OK);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LRESULT lr = SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment", SMTO_ABORTIFHUNG | SMTO_NOTIMEOUTIFNOTHUNG, 5000, NULL);
|
LRESULT lr = SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment", SMTO_ABORTIFHUNG | SMTO_NOTIMEOUTIFNOTHUNG, 5000, NULL);
|
||||||
lr = SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)L"Environment", SMTO_ABORTIFHUNG | SMTO_NOTIMEOUTIFNOTHUNG, 5000, NULL); // For Windows >= 8
|
lr = SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)L"Environment", SMTO_ABORTIFHUNG | SMTO_NOTIMEOUTIFNOTHUNG, 5000, NULL); // For Windows >= 8
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsUserOnly(std::wstring opt)
|
bool IsUserOnly(std::wstring opt)
|
||||||
@ -238,8 +236,7 @@ HKEY GetRootKey(std::wstring opt)
|
|||||||
|
|
||||||
if (IsUserOnly(opt))
|
if (IsUserOnly(opt))
|
||||||
{
|
{
|
||||||
FAIL_ON_ERROR(RegCreateKeyEx(HKEY_CURRENT_USER, L"Software\\Classes", 0, NULL,
|
FAIL_ON_ERROR(RegCreateKeyEx(HKEY_CURRENT_USER, L"Software\\Classes", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &root, NULL));
|
||||||
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &root, NULL));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -271,9 +268,7 @@ void RegisterShellMenu(std::wstring opt, wchar_t* keyBaseName)
|
|||||||
HKEY root = GetRootKey(opt);
|
HKEY root = GetRootKey(opt);
|
||||||
|
|
||||||
HKEY cmderKey;
|
HKEY cmderKey;
|
||||||
FAIL_ON_ERROR(
|
FAIL_ON_ERROR(RegCreateKeyEx(root, keyBaseName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL));
|
||||||
RegCreateKeyEx(root, keyBaseName, 0, NULL,
|
|
||||||
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL));
|
|
||||||
|
|
||||||
FAIL_ON_ERROR(RegSetValue(cmderKey, L"", REG_SZ, L"Cmder Here", NULL));
|
FAIL_ON_ERROR(RegSetValue(cmderKey, L"", REG_SZ, L"Cmder Here", NULL));
|
||||||
FAIL_ON_ERROR(RegSetValueEx(cmderKey, L"NoWorkingDirectory", 0, REG_SZ, (BYTE *)L"", 2));
|
FAIL_ON_ERROR(RegSetValueEx(cmderKey, L"NoWorkingDirectory", 0, REG_SZ, (BYTE *)L"", 2));
|
||||||
@ -281,9 +276,7 @@ void RegisterShellMenu(std::wstring opt, wchar_t* keyBaseName)
|
|||||||
FAIL_ON_ERROR(RegSetValueEx(cmderKey, L"Icon", 0, REG_SZ, (BYTE *)icoPath, wcslen(icoPath) * sizeof(wchar_t)));
|
FAIL_ON_ERROR(RegSetValueEx(cmderKey, L"Icon", 0, REG_SZ, (BYTE *)icoPath, wcslen(icoPath) * sizeof(wchar_t)));
|
||||||
|
|
||||||
HKEY command;
|
HKEY command;
|
||||||
FAIL_ON_ERROR(
|
FAIL_ON_ERROR(RegCreateKeyEx(cmderKey, L"command", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &command, NULL));
|
||||||
RegCreateKeyEx(cmderKey, L"command", 0, NULL,
|
|
||||||
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &command, NULL));
|
|
||||||
|
|
||||||
FAIL_ON_ERROR(RegSetValue(command, L"", REG_SZ, commandStr, NULL));
|
FAIL_ON_ERROR(RegSetValue(command, L"", REG_SZ, commandStr, NULL));
|
||||||
|
|
||||||
@ -296,9 +289,7 @@ void UnregisterShellMenu(std::wstring opt, wchar_t* keyBaseName)
|
|||||||
{
|
{
|
||||||
HKEY root = GetRootKey(opt);
|
HKEY root = GetRootKey(opt);
|
||||||
HKEY cmderKey;
|
HKEY cmderKey;
|
||||||
FAIL_ON_ERROR(
|
FAIL_ON_ERROR(RegCreateKeyEx(root, keyBaseName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL));
|
||||||
RegCreateKeyEx(root, keyBaseName, 0, NULL,
|
|
||||||
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &cmderKey, NULL));
|
|
||||||
#if XP
|
#if XP
|
||||||
FAIL_ON_ERROR(SHDeleteKey(cmderKey, NULL));
|
FAIL_ON_ERROR(SHDeleteKey(cmderKey, NULL));
|
||||||
#else
|
#else
|
||||||
|
Binary file not shown.
Binary file not shown.
195
vendor/clink.lua
vendored
195
vendor/clink.lua
vendored
@ -3,6 +3,7 @@
|
|||||||
-- !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
|
-- !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
|
||||||
-- !!! Use "%CMDER_ROOT%\config\<whatever>.lua" to add your lua startup scripts
|
-- !!! Use "%CMDER_ROOT%\config\<whatever>.lua" to add your lua startup scripts
|
||||||
|
|
||||||
|
-- luacheck: globals clink
|
||||||
|
|
||||||
-- At first, load the original clink.lua file
|
-- At first, load the original clink.lua file
|
||||||
-- this is needed as we set the script path to this dir and therefore the original
|
-- this is needed as we set the script path to this dir and therefore the original
|
||||||
@ -17,7 +18,7 @@ dofile(clink_lua_file)
|
|||||||
-- not destroy our own prompt. It also means that started cmds (or batch files
|
-- not destroy our own prompt. It also means that started cmds (or batch files
|
||||||
-- which echo) don't get the ugly '{lamb}' shown.
|
-- which echo) don't get the ugly '{lamb}' shown.
|
||||||
---
|
---
|
||||||
function set_prompt_filter()
|
local function set_prompt_filter()
|
||||||
-- get_cwd() is differently encoded than the clink.prompt.value, so everything other than
|
-- get_cwd() is differently encoded than the clink.prompt.value, so everything other than
|
||||||
-- pure ASCII will get garbled. So try to parse the current directory from the original prompt
|
-- pure ASCII will get garbled. So try to parse the current directory from the original prompt
|
||||||
-- and only if that doesn't work, use get_cwd() directly.
|
-- and only if that doesn't work, use get_cwd() directly.
|
||||||
@ -38,7 +39,8 @@ function set_prompt_filter()
|
|||||||
-- build our own prompt
|
-- build our own prompt
|
||||||
-- orig: $E[1;32;40m$P$S{git}{hg}$S$_$E[1;30;40m{lamb}$S$E[0m
|
-- orig: $E[1;32;40m$P$S{git}{hg}$S$_$E[1;30;40m{lamb}$S$E[0m
|
||||||
-- color codes: "\x1b[1;37;40m"
|
-- color codes: "\x1b[1;37;40m"
|
||||||
local cmder_prompt = "\x1b[1;32;40m{cwd} {git}{hg}{svn} \n\x1b[1;30;40m{lamb} \x1b[0m"
|
local cmder_prompt = "\x1b[1;32;40m{cwd} {git}{hg}{svn} \n\x1b[1;39;40m{lamb} \x1b[0m"
|
||||||
|
local lambda
|
||||||
cmder_prompt = string.gsub(cmder_prompt, "{cwd}", cwd)
|
cmder_prompt = string.gsub(cmder_prompt, "{cwd}", cwd)
|
||||||
if env == nil then
|
if env == nil then
|
||||||
lambda = "λ"
|
lambda = "λ"
|
||||||
@ -99,24 +101,6 @@ local function get_dir_contains(path, dirname)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_hg_dir(path)
|
|
||||||
return get_dir_contains(path, '.hg')
|
|
||||||
end
|
|
||||||
|
|
||||||
local function get_svn_dir(path)
|
|
||||||
return get_dir_contains(path, '.svn')
|
|
||||||
end
|
|
||||||
function get_svn_branch(svn_dir)
|
|
||||||
for line in io.popen("svn info 2>nul"):lines() do
|
|
||||||
local m = line:match("^Relative URL:")
|
|
||||||
if m then
|
|
||||||
return line:sub(line:find("/")+1,line:len())
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
-- adapted from from clink-completions' git.lua
|
-- adapted from from clink-completions' git.lua
|
||||||
local function get_git_dir(path)
|
local function get_git_dir(path)
|
||||||
|
|
||||||
@ -127,6 +111,7 @@ local function get_git_dir(path)
|
|||||||
if i then
|
if i then
|
||||||
prefix = path:sub(1, i-1)
|
prefix = path:sub(1, i-1)
|
||||||
end
|
end
|
||||||
|
|
||||||
return prefix
|
return prefix
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -158,74 +143,20 @@ local function get_git_dir(path)
|
|||||||
or (parent_path ~= path and get_git_dir(parent_path) or nil)
|
or (parent_path ~= path and get_git_dir(parent_path) or nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
---
|
local function get_hg_dir(path)
|
||||||
-- Find out current branch
|
return get_dir_contains(path, '.hg')
|
||||||
-- @return {false|mercurial branch name}
|
|
||||||
---
|
|
||||||
function get_hg_branch()
|
|
||||||
for line in io.popen("hg branch 2>nul"):lines() do
|
|
||||||
local m = line:match("(.+)$")
|
|
||||||
if m then
|
|
||||||
return m
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return false
|
local function get_svn_dir(path)
|
||||||
end
|
return get_dir_contains(path, '.svn')
|
||||||
|
|
||||||
---
|
|
||||||
-- Get the status of working dir
|
|
||||||
-- @return {bool}
|
|
||||||
---
|
|
||||||
function get_hg_status()
|
|
||||||
for line in io.popen("hg status -0"):lines() do
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
function get_svn_status()
|
|
||||||
for line in io.popen("svn status -q"):lines() do
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
function hg_prompt_filter()
|
|
||||||
|
|
||||||
-- Colors for mercurial status
|
|
||||||
local colors = {
|
|
||||||
clean = "\x1b[1;37;40m",
|
|
||||||
dirty = "\x1b[31;1m",
|
|
||||||
}
|
|
||||||
|
|
||||||
if get_hg_dir() then
|
|
||||||
-- if we're inside of mercurial repo then try to detect current branch
|
|
||||||
local branch = get_hg_branch()
|
|
||||||
if branch then
|
|
||||||
-- Has branch => therefore it is a mercurial folder, now figure out status
|
|
||||||
if get_hg_status() then
|
|
||||||
color = colors.clean
|
|
||||||
else
|
|
||||||
color = colors.dirty
|
|
||||||
end
|
|
||||||
|
|
||||||
clink.prompt.value = string.gsub(clink.prompt.value, "{hg}", color.."("..branch..")")
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- No mercurial present or not in mercurial file
|
|
||||||
clink.prompt.value = string.gsub(clink.prompt.value, "{hg}", "")
|
|
||||||
return false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Find out current branch
|
-- Find out current branch
|
||||||
-- @return {nil|git branch name}
|
-- @return {nil|git branch name}
|
||||||
---
|
---
|
||||||
function get_git_branch(git_dir)
|
local function get_git_branch(git_dir)
|
||||||
local git_dir = git_dir or get_git_dir()
|
git_dir = git_dir or get_git_dir()
|
||||||
|
|
||||||
-- If git directory not found then we're probably outside of repo
|
-- If git directory not found then we're probably outside of repo
|
||||||
-- or something went wrong. The same is when head_file is nil
|
-- or something went wrong. The same is when head_file is nil
|
||||||
@ -238,24 +169,86 @@ function get_git_branch(git_dir)
|
|||||||
-- if HEAD matches branch expression, then we're on named branch
|
-- if HEAD matches branch expression, then we're on named branch
|
||||||
-- otherwise it is a detached commit
|
-- otherwise it is a detached commit
|
||||||
local branch_name = HEAD:match('ref: refs/heads/(.+)')
|
local branch_name = HEAD:match('ref: refs/heads/(.+)')
|
||||||
|
|
||||||
return branch_name or 'HEAD detached at '..HEAD:sub(1, 7)
|
return branch_name or 'HEAD detached at '..HEAD:sub(1, 7)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---
|
||||||
|
-- Find out current branch
|
||||||
|
-- @return {false|mercurial branch name}
|
||||||
|
---
|
||||||
|
local function get_hg_branch()
|
||||||
|
for line in io.popen("hg branch 2>nul"):lines() do
|
||||||
|
local m = line:match("(.+)$")
|
||||||
|
if m then
|
||||||
|
return m
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
---
|
||||||
|
-- Find out current branch
|
||||||
|
-- @return {false|svn branch name}
|
||||||
|
---
|
||||||
|
local function get_svn_branch(svn_dir)
|
||||||
|
for line in io.popen("svn info 2>nul"):lines() do
|
||||||
|
local m = line:match("^Relative URL:")
|
||||||
|
if m then
|
||||||
|
return line:sub(line:find("/")+1,line:len())
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Get the status of working dir
|
-- Get the status of working dir
|
||||||
-- @return {bool}
|
-- @return {bool}
|
||||||
---
|
---
|
||||||
function get_git_status()
|
local function get_git_status()
|
||||||
local file = io.popen("git status --no-lock-index --porcelain 2>nul")
|
local file = io.popen("git --no-optional-locks status --porcelain 2>nul")
|
||||||
for line in file:lines() do
|
for line in file:lines() do
|
||||||
file:close()
|
file:close()
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
file:close()
|
file:close()
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
function git_prompt_filter()
|
---
|
||||||
|
-- Get the status of working dir
|
||||||
|
-- @return {bool}
|
||||||
|
---
|
||||||
|
local function get_hg_status()
|
||||||
|
local file = io.popen("hg status -0")
|
||||||
|
for line in file:lines() do
|
||||||
|
file:close()
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
file:close()
|
||||||
|
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
---
|
||||||
|
-- Get the status of working dir
|
||||||
|
-- @return {bool}
|
||||||
|
---
|
||||||
|
function get_svn_status()
|
||||||
|
local file = io.popen("svn status -q")
|
||||||
|
for line in file:lines() do
|
||||||
|
file:close()
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
file:close()
|
||||||
|
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
local function git_prompt_filter()
|
||||||
|
|
||||||
-- Colors for git status
|
-- Colors for git status
|
||||||
local colors = {
|
local colors = {
|
||||||
@ -267,6 +260,7 @@ function git_prompt_filter()
|
|||||||
if git_dir then
|
if git_dir then
|
||||||
-- if we're inside of git repo then try to detect current branch
|
-- if we're inside of git repo then try to detect current branch
|
||||||
local branch = get_git_branch(git_dir)
|
local branch = get_git_branch(git_dir)
|
||||||
|
local color
|
||||||
if branch then
|
if branch then
|
||||||
-- Has branch => therefore it is a git folder, now figure out status
|
-- Has branch => therefore it is a git folder, now figure out status
|
||||||
if get_git_status() then
|
if get_git_status() then
|
||||||
@ -285,7 +279,37 @@ function git_prompt_filter()
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
function svn_prompt_filter()
|
local function hg_prompt_filter()
|
||||||
|
|
||||||
|
-- Colors for mercurial status
|
||||||
|
local colors = {
|
||||||
|
clean = "\x1b[1;37;40m",
|
||||||
|
dirty = "\x1b[31;1m",
|
||||||
|
}
|
||||||
|
|
||||||
|
if get_hg_dir() then
|
||||||
|
-- if we're inside of mercurial repo then try to detect current branch
|
||||||
|
local branch = get_hg_branch()
|
||||||
|
local color
|
||||||
|
if branch then
|
||||||
|
-- Has branch => therefore it is a mercurial folder, now figure out status
|
||||||
|
if get_hg_status() then
|
||||||
|
color = colors.clean
|
||||||
|
else
|
||||||
|
color = colors.dirty
|
||||||
|
end
|
||||||
|
|
||||||
|
clink.prompt.value = string.gsub(clink.prompt.value, "{hg}", color.."("..branch..")")
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- No mercurial present or not in mercurial file
|
||||||
|
clink.prompt.value = string.gsub(clink.prompt.value, "{hg}", "")
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
local function svn_prompt_filter()
|
||||||
-- Colors for svn status
|
-- Colors for svn status
|
||||||
local colors = {
|
local colors = {
|
||||||
clean = "\x1b[1;37;40m",
|
clean = "\x1b[1;37;40m",
|
||||||
@ -295,6 +319,7 @@ function svn_prompt_filter()
|
|||||||
if get_svn_dir() then
|
if get_svn_dir() then
|
||||||
-- if we're inside of svn repo then try to detect current branch
|
-- if we're inside of svn repo then try to detect current branch
|
||||||
local branch = get_svn_branch()
|
local branch = get_svn_branch()
|
||||||
|
local color
|
||||||
if branch then
|
if branch then
|
||||||
if get_svn_status() then
|
if get_svn_status() then
|
||||||
color = colors.clean
|
color = colors.clean
|
||||||
@ -311,6 +336,7 @@ function svn_prompt_filter()
|
|||||||
clink.prompt.value = string.gsub(clink.prompt.value, "{svn}", "")
|
clink.prompt.value = string.gsub(clink.prompt.value, "{svn}", "")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
-- insert the set_prompt at the very beginning so that it runs first
|
-- insert the set_prompt at the very beginning so that it runs first
|
||||||
clink.prompt.register_filter(set_prompt_filter, 1)
|
clink.prompt.register_filter(set_prompt_filter, 1)
|
||||||
clink.prompt.register_filter(hg_prompt_filter, 50)
|
clink.prompt.register_filter(hg_prompt_filter, 50)
|
||||||
@ -327,4 +353,3 @@ for _,lua_module in ipairs(clink.find_files(completions_dir..'*.lua')) do
|
|||||||
dofile(filename)
|
dofile(filename)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
12
vendor/init.bat
vendored
12
vendor/init.bat
vendored
@ -11,7 +11,11 @@ if not defined verbose-output ( set verbose-output=0 )
|
|||||||
|
|
||||||
:: Find root dir
|
:: Find root dir
|
||||||
if not defined CMDER_ROOT (
|
if not defined CMDER_ROOT (
|
||||||
|
if defined ConEmuDir (
|
||||||
for /f "delims=" %%i in ("%ConEmuDir%\..\..") do set "CMDER_ROOT=%%~fi"
|
for /f "delims=" %%i in ("%ConEmuDir%\..\..") do set "CMDER_ROOT=%%~fi"
|
||||||
|
) else (
|
||||||
|
for /f "delims=" %%i in ("%~dp0\..") do set "CMDER_ROOT=%%~fi"
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
:: Remove trailing '\'
|
:: Remove trailing '\'
|
||||||
@ -151,18 +155,12 @@ if exist "%CMDER_ROOT%\vendor\git-for-windows\post-install.bat" (
|
|||||||
call :verbose-output Running Git for Windows one time Post Install....
|
call :verbose-output Running Git for Windows one time Post Install....
|
||||||
pushd "%CMDER_ROOT%\vendor\git-for-windows\"
|
pushd "%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
|
"%CMDER_ROOT%\vendor\git-for-windows\git-bash.exe" --no-needs-console --hide --no-cd --command=post-install.bat
|
||||||
pushd "%USERPROFILE%"
|
popd
|
||||||
)
|
)
|
||||||
|
|
||||||
:: Set home path
|
:: Set home path
|
||||||
if not defined HOME set "HOME=%USERPROFILE%"
|
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 (
|
|
||||||
pushd "%CMDER_START%"
|
|
||||||
)
|
|
||||||
|
|
||||||
if exist "%CMDER_ROOT%\config\user-profile.cmd" (
|
if exist "%CMDER_ROOT%\config\user-profile.cmd" (
|
||||||
REM Create this file and place your own command in there
|
REM Create this file and place your own command in there
|
||||||
call "%CMDER_ROOT%\config\user-profile.cmd"
|
call "%CMDER_ROOT%\config\user-profile.cmd"
|
||||||
|
29
vendor/profile.ps1
vendored
29
vendor/profile.ps1
vendored
@ -4,19 +4,23 @@
|
|||||||
# !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
|
# !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
|
||||||
# !!! Use "%CMDER_ROOT%\config\user-profile.ps1" to add your own startup commands
|
# !!! Use "%CMDER_ROOT%\config\user-profile.ps1" to add your own startup commands
|
||||||
|
|
||||||
# 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
|
# Compatibility with PS major versions <= 2
|
||||||
if(!$PSScriptRoot) {
|
if(!$PSScriptRoot) {
|
||||||
$PSScriptRoot = Split-Path $Script:MyInvocation.MyCommand.Path
|
$PSScriptRoot = Split-Path $Script:MyInvocation.MyCommand.Path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# We do this for Powershell as Admin Sessions because CMDER_ROOT is not beng set.
|
||||||
|
if (! $ENV:CMDER_ROOT ) {
|
||||||
|
if ( $ENV:ConEmuDir ) {
|
||||||
|
$ENV:CMDER_ROOT = resolve-path( $ENV:ConEmuDir + "\..\.." )
|
||||||
|
} else {
|
||||||
|
$ENV:CMDER_ROOT = resolve-path( $PSScriptRoot + "\.." )
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# 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
|
# -> 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 | Out-Null)
|
||||||
@ -76,13 +80,6 @@ function checkGit($Path) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Move to the wanted location
|
|
||||||
# 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"
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Get-Module PSReadline -ErrorAction "SilentlyContinue") {
|
if (Get-Module PSReadline -ErrorAction "SilentlyContinue") {
|
||||||
Set-PSReadlineOption -ExtraPromptLineCount 1
|
Set-PSReadlineOption -ExtraPromptLineCount 1
|
||||||
}
|
}
|
||||||
@ -127,7 +124,7 @@ if (-not (test-path "$ENV:CMDER_ROOT\config\profile.d")) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pushd $ENV:CMDER_ROOT\config\profile.d
|
pushd $ENV:CMDER_ROOT\config\profile.d
|
||||||
foreach ($x in ls *.ps1) {
|
foreach ($x in Get-ChildItem *.ps1) {
|
||||||
# write-host write-host Sourcing $x
|
# write-host write-host Sourcing $x
|
||||||
. $x
|
. $x
|
||||||
}
|
}
|
||||||
|
10
vendor/sources.json
vendored
10
vendor/sources.json
vendored
@ -1,18 +1,18 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "git-for-windows",
|
"name": "git-for-windows",
|
||||||
"version": "v2.14.3.windows.1",
|
"version": "v2.16.1.windows.4",
|
||||||
"url": "https://github.com/git-for-windows/git/releases/download/v2.14.3.windows.1/PortableGit-2.14.3-32-bit.7z.exe"
|
"url": "https://github.com/git-for-windows/git/releases/download/v2.16.1.windows.4/PortableGit-2.16.1.4-64-bit.7z.exe"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "clink",
|
"name": "clink",
|
||||||
"version": "0.4.9",
|
"version": "0.4.9",
|
||||||
"url": "https://github.com/Stanzilla/clink/releases/download/0.4.9/clink_DEV.zip"
|
"url": "https://github.com/mridgers/clink/releases/download/0.4.9/clink_0.4.9.zip"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "conemu-maximus5",
|
"name": "conemu-maximus5",
|
||||||
"version": "171025",
|
"version": "180206",
|
||||||
"url": "https://github.com/Maximus5/ConEmu/releases/download/v17.10.25/ConEmuPack.171025.7z"
|
"url": "https://github.com/Maximus5/ConEmu/releases/download/v18.02.06/ConEmuPack.180206.7z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "clink-completions",
|
"name": "clink-completions",
|
||||||
|
Reference in New Issue
Block a user