mirror of
https://github.com/cmderdev/cmder.git
synced 2025-07-17 04:59:09 +08:00
Compare commits
28 Commits
Author | SHA1 | Date | |
---|---|---|---|
524fce25ab | |||
46bde1af8b | |||
9a47bce6ac | |||
0a3be464be | |||
b2723d6f6a | |||
4f2ced57df | |||
88169b8721 | |||
f6db922732 | |||
e822d55aa5 | |||
ccb6cb80e5 | |||
e56ed810a0 | |||
7e8d67caa8 | |||
4e4f050374 | |||
51e75d4bb5 | |||
f4389fc552 | |||
8101923242 | |||
7e1bc4297a | |||
0f30329e38 | |||
25820ae4d4 | |||
528a69dab9 | |||
0c9e0e2f8c | |||
20eb7b8e81 | |||
ab02c4ce46 | |||
f9f06a5595 | |||
8ac540ebb6 | |||
fcab51da2b | |||
dc492c836f | |||
1eb03dd1b8 |
168
CHANGELOG.md
168
CHANGELOG.md
@ -1,5 +1,173 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## [1.3.11](https://github.com/cmderdev/cmder/tree/v1.3.11) (2018-12-22)
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Fix uncommenting `call ssh-agent` in `user_profile.cmd` breaks Cmder prompt. [#1990](https://github.com/cmderdev/cmder/issues/1990), [#1807](https://github.com/cmderdev/cmder/issues/1807), [#1785](https://github.com/cmderdev/cmder/issues/1785), [#1885](https://github.com/cmderdev/cmder/issues/1885)
|
||||||
|
* Pull Request: [#1999](https://github.com/cmderdev/cmder/issues/1999) fix ssh-agent call in user_profile.cmd.default
|
||||||
|
* Unable to use '%' character in git branch names [#1779](https://github.com/cmderdev/cmder/issues/1779)
|
||||||
|
* Pull Request: [#1991](https://github.com/cmderdev/cmder/issues/1991) add percent escaping for string.gsub
|
||||||
|
* sort command, unix vs windows (/usr/bin/sort vs sort.exe) [#1931](https://github.com/cmderdev/cmder/issues/1931)
|
||||||
|
* Pull Request: [#1988](https://github.com/cmderdev/cmder/issues/1988) Prefer /nix_tools option
|
||||||
|
|
||||||
|
### Adds
|
||||||
|
|
||||||
|
* [#1988](https://github.com/cmderdev/cmder/issues/1988) Prefer /nix_tools option
|
||||||
|
* [#1982](https://github.com/cmderdev/cmder/issues/1982) make /register work with /single
|
||||||
|
* [#1975](https://github.com/cmderdev/cmder/issues/1975) Add `/nix_tools 0` option to init.bat to prevent adding !GIT_INSTALL_ROOT!\usr\bin to PATH
|
||||||
|
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
|
||||||
|
* [#1987](https://github.com/cmderdev/cmder/issues/1987) Use default files for default user profiles
|
||||||
|
|
||||||
|
## [1.3.10](https://github.com/cmderdev/cmder/tree/v1.3.10) (2018-11-30)
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Replaces Cmder Release v1.3.9 which has been removed.
|
||||||
|
* /c now completely separates user config including Conemu configuration. This enables true multi-user Cmder with no configuration collisions. See PR #1949.
|
||||||
|
* Fix #1959 Start cmder "find" errors. See PR #1961.
|
||||||
|
* Fix #1956 Git detection should use env from git install root. See PR #1969
|
||||||
|
|
||||||
|
### Adds
|
||||||
|
|
||||||
|
* /m initially creates %cmder_root%/config/conemu-%computername%.xml for users that want per computer Conemu configuration with shared init scripts. See PR #1949.
|
||||||
|
* /register now recognizes /c [path] and creates an appropriate Cmder Here shell context menu. See PR #1949.
|
||||||
|
|
||||||
|
## [1.3.8](https://github.com/cmderdev/cmder/tree/v1.3.8) (2018-11-10)
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Fix \vendor\bin\timer.cmd was unexpected at this time. on session start.
|
||||||
|
|
||||||
|
## [1.3.7](https://github.com/cmderdev/cmder/tree/v1.3.7) (2018-11-10)
|
||||||
|
## Updated components
|
||||||
|
|
||||||
|
* ConEmu to 180626
|
||||||
|
* Update Git to 2.19.0
|
||||||
|
|
||||||
|
## Fixes:
|
||||||
|
|
||||||
|
* Cmder now opens in the in the current working dir
|
||||||
|
|
||||||
|
## Commits
|
||||||
|
### Aaron Arney (1):
|
||||||
|
|
||||||
|
* Update README
|
||||||
|
|
||||||
|
### Arion Roberto Krause (1):
|
||||||
|
|
||||||
|
* Fixed typo
|
||||||
|
|
||||||
|
### Benjamin Staneck (8):
|
||||||
|
|
||||||
|
* Revert "replace user-aliases with user_aliases"
|
||||||
|
* replace user-aliases with user_aliases
|
||||||
|
* better fix for #1265
|
||||||
|
* Revert "sanitize dir before assigning to prompt"
|
||||||
|
* sanitize dir before assigning to prompt
|
||||||
|
* Update CHANGELOG.md
|
||||||
|
|
||||||
|
### Bob Hood (1):
|
||||||
|
|
||||||
|
* Refactored the Mercurial prompt code to be more efficient.
|
||||||
|
|
||||||
|
### David Refoua (1):
|
||||||
|
|
||||||
|
* fix some spelling issues
|
||||||
|
|
||||||
|
### Dax T Games (30):
|
||||||
|
|
||||||
|
* Revert "Ignore %cmder_root%\config (#1945)"
|
||||||
|
* Ignore %cmder_root%\config (#1945)
|
||||||
|
* Add /f for fast init. (#1942)
|
||||||
|
* add diag helper scripts and adds to the path (#1918)
|
||||||
|
* Fix #1806 #1675 (#1870)
|
||||||
|
* Profile.ps1 (#1796)
|
||||||
|
* Fix lib base (#1794)
|
||||||
|
* Little Changes
|
||||||
|
* Fixed move of default conemu.xml to the vendor folder
|
||||||
|
* ignore all of config folder
|
||||||
|
* move default comemu.xml to vendor folder
|
||||||
|
* fixes
|
||||||
|
* more headers
|
||||||
|
* init.bat update for cexec
|
||||||
|
* git prompt yellow
|
||||||
|
* fix user lua and git detection
|
||||||
|
* allow conditionally setting environment variables
|
||||||
|
* added exit codes
|
||||||
|
* flag_exists.cmd to flag_exec.cmd, also to lib as an option
|
||||||
|
* fixed
|
||||||
|
* handle start dir args with trailing "
|
||||||
|
* cleanup
|
||||||
|
* '.gitignore'
|
||||||
|
* verbose output
|
||||||
|
* cmder_shell settings
|
||||||
|
* add cmder_shell method
|
||||||
|
* replace - with \_ in debug-output and verbose-output
|
||||||
|
* Trying to get tcc working
|
||||||
|
* move user-aliases.cmd to user_aliases.cmd
|
||||||
|
* move bin\alias.bat to vendor\bin\alias.cmd
|
||||||
|
* fix /unregister
|
||||||
|
|
||||||
|
### Dmitri S. Guskov (2):
|
||||||
|
|
||||||
|
* Powershell 5.1 compatibility
|
||||||
|
* Update profile.ps1
|
||||||
|
|
||||||
|
### Gregory Lucas (1):
|
||||||
|
|
||||||
|
* Initialize time_init to fix init error message
|
||||||
|
|
||||||
|
### Josef Pihrt (2):
|
||||||
|
|
||||||
|
* Fix typos, remove escaping inside inline code, replace single quote with backtick
|
||||||
|
* Fix typo and broken link
|
||||||
|
|
||||||
|
### Merlin (1):
|
||||||
|
|
||||||
|
* Remove duplicate Install-Module detection
|
||||||
|
|
||||||
|
### Nicolas Arnaud-Cormos (1):
|
||||||
|
|
||||||
|
* Ensure the right git path is found in case of shim.
|
||||||
|
|
||||||
|
### Thorsten Sommer (1):
|
||||||
|
|
||||||
|
* Fixed spelling
|
||||||
|
|
||||||
|
### gaoslin (1):
|
||||||
|
|
||||||
|
* Update init.bat
|
||||||
|
|
||||||
|
### leochien0102 (1):
|
||||||
|
|
||||||
|
* fix the 'was unexpected at this time.'
|
||||||
|
|
||||||
|
### xiazeyu (4):
|
||||||
|
|
||||||
|
* chore: unite slash
|
||||||
|
* docs: update to latest useage
|
||||||
|
* refactor: reduce global varible useage, fixed quote issue, added parameters support
|
||||||
|
* doc: fix typo
|
||||||
|
|
||||||
|
### xiazeyu_2011 (8):
|
||||||
|
|
||||||
|
* docs: migrated instructions to the wiki pages
|
||||||
|
* rename /bin/have.bat to /vendor/lib/flag_exists.cmd
|
||||||
|
* fix: bug when no argument is passed in
|
||||||
|
* docs: update doc for have.bat
|
||||||
|
* feat: add have.bat as a wrapper
|
||||||
|
* Optimize comments of using arguments in user-profile.cmd
|
||||||
|
* fix conflict with init.bat build-in command parser, update user-profile.cmd
|
||||||
|
* Pass arguments to user-profile.cmd
|
||||||
|
|
||||||
|
刘祺 (1):
|
||||||
|
|
||||||
|
* add LANG support
|
||||||
|
|
||||||
## [1.3.6](https://github.com/cmderdev/cmder/tree/v1.3.6) (2018-05-30)
|
## [1.3.6](https://github.com/cmderdev/cmder/tree/v1.3.6) (2018-05-30)
|
||||||
**Updated components:**
|
**Updated components:**
|
||||||
|
|
||||||
|
@ -149,6 +149,7 @@ You may find some Monokai color schemes for mintty to match Cmder [here](https:/
|
|||||||
| `/git_install_root [file path]` | User specified Git installation root path. | `%CMDER_ROOT%\vendor\Git-for-Windows` |
|
| `/git_install_root [file path]` | User specified Git installation root path. | `%CMDER_ROOT%\vendor\Git-for-Windows` |
|
||||||
| `/home [home folder]` | User specified folder path to set `%HOME%` environment variable. | `%userprofile%` |
|
| `/home [home folder]` | User specified folder path to set `%HOME%` environment variable. | `%userprofile%` |
|
||||||
| `/max_depth [1-5]` | Define max recurse depth when adding to the path for `%cmder_root%\bin` and `%cmder_user_bin%` | 1 |
|
| `/max_depth [1-5]` | Define max recurse depth when adding to the path for `%cmder_root%\bin` and `%cmder_user_bin%` | 1 |
|
||||||
|
| `/nix_tools [0-2]` | Define how `*nix` tools are added to the path. Prefer Windows Tools: 1, Prefer *nix Tools: 2, No `/usr/bin` in `%PATH%`: 0 | 1 |
|
||||||
| `/svn_ssh [path to ssh.exe]` | Define `%SVN_SSH%` so we can use git svn with ssh svn repositories. | `%GIT_INSTALL_ROOT%\bin\ssh.exe` |
|
| `/svn_ssh [path to ssh.exe]` | Define `%SVN_SSH%` so we can use git svn with ssh svn repositories. | `%GIT_INSTALL_ROOT%\bin\ssh.exe` |
|
||||||
| `/user_aliases [file path]` | File path pointing to user aliases. | `%CMDER_ROOT%\config\user-aliases.cmd` |
|
| `/user_aliases [file path]` | File path pointing to user aliases. | `%CMDER_ROOT%\config\user-aliases.cmd` |
|
||||||
| `/v` | Enables verbose output. | not set |
|
| `/v` | Enables verbose output. | not set |
|
||||||
|
@ -4,11 +4,12 @@ All config files must be in this folder. If there is no option to set this folde
|
|||||||
directly, it has to be hardlinked.
|
directly, it has to be hardlinked.
|
||||||
|
|
||||||
* `user-aliases.cmd`: aliases in cmd; called from vendor\init.bat; autocreated from
|
* `user-aliases.cmd`: aliases in cmd; called from vendor\init.bat; autocreated from
|
||||||
`vendor\user-aliases.cmd.example`.
|
`vendor\user-aliases.cmd.default`.
|
||||||
* `*.lua`: clink completions and prompt filters; autoloaded after all
|
* `*.lua`: clink completions and prompt filters; autoloaded after all
|
||||||
prompt filter and clink completions are initialized; add your own.
|
prompt filter and clink completions are initialized; add your own.
|
||||||
* `user-profile.{sh|cmd|ps1}`: startup files for bash|cmd|powershell tasks; called from their
|
* `user-profile.{sh|cmd|ps1}`: startup files for bash|cmd|powershell tasks; called from their
|
||||||
respective startup scripts in `vendor\`; autocreated on first start of such a task.
|
respective startup scripts in `vendor\`; autocreated from
|
||||||
|
`vendor\user-profile.{sh|cmd|ps1}.default` on first start of such a task.
|
||||||
* `.history`: the current commandline history; autoupdated on close.
|
* `.history`: the current commandline history; autoupdated on close.
|
||||||
* `settings`: settings for readline; overwritten on update.
|
* `settings`: settings for readline; overwritten on update.
|
||||||
* `ConEmu.xml`: settings from ConEmu (=the UI of cmder -> Preferences); overwritten on update.
|
* `ConEmu.xml`: settings from ConEmu (=the UI of cmder -> Preferences); overwritten on update.
|
||||||
|
@ -452,7 +452,7 @@ HKEY GetRootKey(std::wstring opt)
|
|||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegisterShellMenu(std::wstring opt, wchar_t* keyBaseName, std::wstring cfgRoot = L"")
|
void RegisterShellMenu(std::wstring opt, wchar_t* keyBaseName, std::wstring cfgRoot, bool single)
|
||||||
{
|
{
|
||||||
wchar_t userConfigDirPath[MAX_PATH] = { 0 };
|
wchar_t userConfigDirPath[MAX_PATH] = { 0 };
|
||||||
|
|
||||||
@ -464,15 +464,22 @@ void RegisterShellMenu(std::wstring opt, wchar_t* keyBaseName, std::wstring cfgR
|
|||||||
GetModuleFileName(NULL, exePath, sizeof(exePath));
|
GetModuleFileName(NULL, exePath, sizeof(exePath));
|
||||||
|
|
||||||
wchar_t commandStr[MAX_PATH + 20] = { 0 };
|
wchar_t commandStr[MAX_PATH + 20] = { 0 };
|
||||||
|
wchar_t baseCommandStr[MAX_PATH + 20] = { 0 };
|
||||||
|
if (!single) {
|
||||||
|
swprintf_s(baseCommandStr, L"\"%s\"", exePath);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
swprintf_s(baseCommandStr, L"\"%s\" /single", exePath);
|
||||||
|
}
|
||||||
|
|
||||||
if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
|
if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
|
||||||
{
|
{
|
||||||
swprintf_s(commandStr, L"\"%s\" \"%%V\"", exePath);
|
swprintf_s(commandStr, L"%s \"%%V\"", baseCommandStr);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
std::copy(cfgRoot.begin(), cfgRoot.end(), userConfigDirPath);
|
std::copy(cfgRoot.begin(), cfgRoot.end(), userConfigDirPath);
|
||||||
userConfigDirPath[cfgRoot.length()] = 0;
|
userConfigDirPath[cfgRoot.length()] = 0;
|
||||||
swprintf_s(commandStr, L"\"%s\" /c \"%s\" \"%%V\"", exePath, userConfigDirPath);
|
swprintf_s(commandStr, L"%s /c \"%s\" \"%%V\"", baseCommandStr, userConfigDirPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now that we have `commandStr`, it's OK to change `exePath`...
|
// Now that we have `commandStr`, it's OK to change `exePath`...
|
||||||
@ -656,8 +663,8 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
|||||||
|
|
||||||
if (cmderOptions.registerApp == true)
|
if (cmderOptions.registerApp == true)
|
||||||
{
|
{
|
||||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_BACKGROUND, cmderOptions.cmderCfgRoot);
|
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
||||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_LISTITEM, cmderOptions.cmderCfgRoot);
|
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_LISTITEM, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
||||||
}
|
}
|
||||||
else if (cmderOptions.unRegisterApp == true)
|
else if (cmderOptions.unRegisterApp == true)
|
||||||
{
|
{
|
||||||
|
19
vendor/clink.lua
vendored
19
vendor/clink.lua
vendored
@ -13,6 +13,14 @@ dofile(clink_lua_file)
|
|||||||
|
|
||||||
-- now add our own things...
|
-- now add our own things...
|
||||||
|
|
||||||
|
---
|
||||||
|
-- Makes a string safe to use as the replacement in string.gsub
|
||||||
|
---
|
||||||
|
local function verbatim(s)
|
||||||
|
s = string.gsub(s, "%%", "%%%%")
|
||||||
|
return s
|
||||||
|
end
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Setting the prompt in clink means that commands which rewrite the prompt do
|
-- Setting the prompt in clink means that commands which rewrite the prompt do
|
||||||
-- 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
|
||||||
@ -41,13 +49,12 @@ local function set_prompt_filter()
|
|||||||
-- 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;39;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 = "λ"
|
local lambda = "λ"
|
||||||
cwd = string.gsub(cwd, "%%", "{percent}")
|
cmder_prompt = string.gsub(cmder_prompt, "{cwd}", verbatim(cwd))
|
||||||
cmder_prompt = string.gsub(cmder_prompt, "{cwd}", cwd)
|
|
||||||
|
|
||||||
if env ~= nil then
|
if env ~= nil then
|
||||||
lambda = "("..env..") "..lambda
|
lambda = "("..env..") "..lambda
|
||||||
end
|
end
|
||||||
clink.prompt.value = string.gsub(cmder_prompt, "{lamb}", lambda)
|
clink.prompt.value = string.gsub(cmder_prompt, "{lamb}", verbatim(lambda))
|
||||||
end
|
end
|
||||||
|
|
||||||
local function percent_prompt_filter()
|
local function percent_prompt_filter()
|
||||||
@ -295,7 +302,7 @@ local function git_prompt_filter()
|
|||||||
color = colors.conflict
|
color = colors.conflict
|
||||||
end
|
end
|
||||||
|
|
||||||
clink.prompt.value = string.gsub(clink.prompt.value, "{git}", color.."("..branch..")")
|
clink.prompt.value = string.gsub(clink.prompt.value, "{git}", color.."("..verbatim(branch)..")")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -340,7 +347,7 @@ local function hg_prompt_filter()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
clink.prompt.value = string.gsub(clink.prompt.value, "{hg}", result)
|
clink.prompt.value = string.gsub(clink.prompt.value, "{hg}", verbatim(result))
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -362,7 +369,7 @@ local function svn_prompt_filter()
|
|||||||
color = colors.dirty
|
color = colors.dirty
|
||||||
end
|
end
|
||||||
|
|
||||||
clink.prompt.value = string.gsub(clink.prompt.value, "{svn}", color.."("..branch..")")
|
clink.prompt.value = string.gsub(clink.prompt.value, "{svn}", color.."("..verbatim(branch)..")")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
7
vendor/cmder.sh
vendored
7
vendor/cmder.sh
vendored
@ -90,12 +90,7 @@ fi
|
|||||||
|
|
||||||
if [ ! -f "${CmderUserProfilePath}" ] ; then
|
if [ ! -f "${CmderUserProfilePath}" ] ; then
|
||||||
echo Creating user startup file: "${CmderUserProfilePath}"
|
echo Creating user startup file: "${CmderUserProfilePath}"
|
||||||
cat <<-eof >"${CmderUserProfilePath}"
|
cp "${CMDER_ROOT}/vendor/user_profile.sh.default" "${CmderUserProfilePath}"
|
||||||
# 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
|
fi
|
||||||
|
|
||||||
# Source the users .bashrc file if it exists
|
# Source the users .bashrc file if it exists
|
||||||
|
7
vendor/cmder_exinit
vendored
7
vendor/cmder_exinit
vendored
@ -108,11 +108,6 @@ if [ ! "$CMDER_ROOT" = "" ] ; then
|
|||||||
|
|
||||||
if [ ! -f "${CmderUserProfilePath}" ] ; then
|
if [ ! -f "${CmderUserProfilePath}" ] ; then
|
||||||
echo Creating user startup file: "${CmderUserProfilePath}"
|
echo Creating user startup file: "${CmderUserProfilePath}"
|
||||||
cat <<-eof >"${CmderUserProfilePath}"
|
cp "${CMDER_ROOT}/vendor/user_profile.sh.default" "${CmderUserProfilePath}"
|
||||||
# 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
|
fi
|
||||||
fi
|
fi
|
||||||
|
69
vendor/init.bat
vendored
69
vendor/init.bat
vendored
@ -14,6 +14,8 @@ set debug_output=0
|
|||||||
set time_init=0
|
set time_init=0
|
||||||
set fast_init=0
|
set fast_init=0
|
||||||
set max_depth=1
|
set max_depth=1
|
||||||
|
:: Add *nix tools to end of path. 0 turns off *nix tools.
|
||||||
|
set nix_tools=1
|
||||||
set "CMDER_USER_FLAGS= "
|
set "CMDER_USER_FLAGS= "
|
||||||
|
|
||||||
:: Find root dir
|
:: Find root dir
|
||||||
@ -79,6 +81,20 @@ call "%cmder_root%\vendor\lib\lib_profile"
|
|||||||
%lib_console% show_error "The Git install root folder "%~2", you specified does not exist!"
|
%lib_console% show_error "The Git install root folder "%~2", you specified does not exist!"
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
|
) else if /i "%1"=="/nix_tools" (
|
||||||
|
if "%2" equ "0" (
|
||||||
|
REM Do not add *nix tools to path
|
||||||
|
set nix_tools=0
|
||||||
|
shift
|
||||||
|
) else if "%2" equ "1" (
|
||||||
|
REM Add *nix tools to end of path
|
||||||
|
set nix_tools=1
|
||||||
|
shift
|
||||||
|
) else if "%2" equ "2" (
|
||||||
|
REM Add *nix tools to front of path
|
||||||
|
set nix_tools=2
|
||||||
|
shift
|
||||||
|
)
|
||||||
) else if /i "%1" == "/home" (
|
) else if /i "%1" == "/home" (
|
||||||
if exist "%~2" (
|
if exist "%~2" (
|
||||||
set "HOME=%~2"
|
set "HOME=%~2"
|
||||||
@ -233,13 +249,24 @@ goto :CONFIGURE_GIT
|
|||||||
:: Add git to the path
|
:: Add git to the path
|
||||||
if defined GIT_INSTALL_ROOT (
|
if defined GIT_INSTALL_ROOT (
|
||||||
rem add the unix commands at the end to not shadow windows commands like more
|
rem add the unix commands at the end to not shadow windows commands like more
|
||||||
if exist "!GIT_INSTALL_ROOT!\cmd\git.exe" %lib_path% enhance_path "!GIT_INSTALL_ROOT!\cmd" append
|
if %nix_tools% equ 1 (
|
||||||
if exist "!GIT_INSTALL_ROOT!\mingw32" (
|
%lib_console% debug_output init.bat "Preferring Windows commands"
|
||||||
%lib_path% enhance_path "!GIT_INSTALL_ROOT!\mingw32\bin" append
|
set "path_position=append"
|
||||||
) else if exist "!GIT_INSTALL_ROOT!\mingw64" (
|
) else (
|
||||||
%lib_path% enhance_path "!GIT_INSTALL_ROOT!\mingw64\bin" append
|
%lib_console% debug_output init.bat "Preferring *nix commands"
|
||||||
|
set "path_position="
|
||||||
|
)
|
||||||
|
|
||||||
|
if exist "!GIT_INSTALL_ROOT!\cmd\git.exe" %lib_path% enhance_path "!GIT_INSTALL_ROOT!\cmd" !path_position!
|
||||||
|
if exist "!GIT_INSTALL_ROOT!\mingw32" (
|
||||||
|
%lib_path% enhance_path "!GIT_INSTALL_ROOT!\mingw32\bin" !path_position!
|
||||||
|
) else if exist "!GIT_INSTALL_ROOT!\mingw64" (
|
||||||
|
%lib_path% enhance_path "!GIT_INSTALL_ROOT!\mingw64\bin" !path_position!
|
||||||
|
)
|
||||||
|
|
||||||
|
if %nix_tools% geq 1 (
|
||||||
|
%lib_path% enhance_path "!GIT_INSTALL_ROOT!\usr\bin" !path_position!
|
||||||
)
|
)
|
||||||
%lib_path% enhance_path "!GIT_INSTALL_ROOT!\usr\bin" append
|
|
||||||
|
|
||||||
:: define SVN_SSH so we can use git svn with ssh svn repositories
|
:: define SVN_SSH so we can use git svn with ssh svn repositories
|
||||||
if not defined SVN_SSH set "SVN_SSH=%GIT_INSTALL_ROOT:\=\\%\\bin\\ssh.exe"
|
if not defined SVN_SSH set "SVN_SSH=%GIT_INSTALL_ROOT:\=\\%\\bin\\ssh.exe"
|
||||||
@ -284,7 +311,7 @@ if defined CMDER_USER_CONFIG (
|
|||||||
:: scripts run above by setting the 'aliases' env variable.
|
:: scripts run above by setting the 'aliases' env variable.
|
||||||
::
|
::
|
||||||
:: Note: If overriding default aliases store file the aliases
|
:: Note: If overriding default aliases store file the aliases
|
||||||
:: must also be self executing, see '.\user_aliases.cmd.example',
|
:: must also be self executing, see '.\user_aliases.cmd.default',
|
||||||
:: and be in profile.d folder.
|
:: and be in profile.d folder.
|
||||||
if not defined user_aliases (
|
if not defined user_aliases (
|
||||||
if defined CMDER_USER_CONFIG (
|
if defined CMDER_USER_CONFIG (
|
||||||
@ -305,17 +332,17 @@ if "%CMDER_ALIASES%" == "1" (
|
|||||||
setlocal enabledelayedexpansion
|
setlocal enabledelayedexpansion
|
||||||
if not exist "%user_aliases%" (
|
if not exist "%user_aliases%" (
|
||||||
echo Creating initial user_aliases store in "%user_aliases%"...
|
echo Creating initial user_aliases store in "%user_aliases%"...
|
||||||
copy "%CMDER_ROOT%\vendor\user_aliases.cmd.example" "%user_aliases%"
|
copy "%CMDER_ROOT%\vendor\user_aliases.cmd.default" "%user_aliases%"
|
||||||
) else (
|
) else (
|
||||||
type "%user_aliases%" | %WINDIR%\System32\findstr /i ";= Add aliases below here" >nul
|
type "%user_aliases%" | %WINDIR%\System32\findstr /i ";= Add aliases below here" >nul
|
||||||
if "!errorlevel!" == "1" (
|
if "!errorlevel!" == "1" (
|
||||||
echo Creating initial user_aliases store in "%user_aliases%"...
|
echo Creating initial user_aliases store in "%user_aliases%"...
|
||||||
if defined CMDER_USER_CONFIG (
|
if defined CMDER_USER_CONFIG (
|
||||||
copy "%user_aliases%" "%user_aliases%.old_format"
|
copy "%user_aliases%" "%user_aliases%.old_format"
|
||||||
copy "%CMDER_ROOT%\vendor\user_aliases.cmd.example" "%user_aliases%"
|
copy "%CMDER_ROOT%\vendor\user_aliases.cmd.default" "%user_aliases%"
|
||||||
) else (
|
) else (
|
||||||
copy "%user_aliases%" "%user_aliases%.old_format"
|
copy "%user_aliases%" "%user_aliases%.old_format"
|
||||||
copy "%CMDER_ROOT%\vendor\user_aliases.cmd.example" "%user_aliases%"
|
copy "%CMDER_ROOT%\vendor\user_aliases.cmd.default" "%user_aliases%"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -368,27 +395,7 @@ if defined CMDER_USER_CONFIG (
|
|||||||
|
|
||||||
if not exist "%initialConfig%" (
|
if not exist "%initialConfig%" (
|
||||||
echo Creating user startup file: "%initialConfig%"
|
echo Creating user startup file: "%initialConfig%"
|
||||||
(
|
copy "%CMDER_ROOT%\vendor\user_profile.cmd.default" "%initialConfig%"
|
||||||
echo :: use this file to run your own startup commands
|
|
||||||
echo :: use in front of the command to prevent printing the command
|
|
||||||
echo.
|
|
||||||
echo :: uncomment this to have the ssh agent load when cmder starts
|
|
||||||
echo :: call "%%GIT_INSTALL_ROOT%%/cmd/start-ssh-agent.cmd"
|
|
||||||
echo.
|
|
||||||
echo :: uncomment the next two lines to use pageant as the ssh authentication agent
|
|
||||||
echo :: SET SSH_AUTH_SOCK=/tmp/.ssh-pageant-auth-sock
|
|
||||||
echo :: call "%%GIT_INSTALL_ROOT%%/cmd/start-ssh-pageant.cmd"
|
|
||||||
echo.
|
|
||||||
echo :: you can add your plugins to the cmder path like so
|
|
||||||
echo :: set "PATH=%%CMDER_ROOT%%\vendor\whatever;%%PATH%%"
|
|
||||||
echo.
|
|
||||||
echo :: arguments in this batch are passed from init.bat, you can quickly parse them like so:
|
|
||||||
echo :: more useage can be seen by typing "cexec /?"
|
|
||||||
echo.
|
|
||||||
echo :: %%ccall%% "/customOption" "command/program"
|
|
||||||
echo.
|
|
||||||
echo @echo off
|
|
||||||
) >"%initialConfig%"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if "%CMDER_ALIASES%" == "1" if exist "%CMDER_ROOT%\bin\alias.bat" if exist "%CMDER_ROOT%\vendor\bin\alias.cmd" (
|
if "%CMDER_ALIASES%" == "1" if exist "%CMDER_ROOT%\bin\alias.bat" if exist "%CMDER_ROOT%\vendor\bin\alias.cmd" (
|
||||||
|
22
vendor/lib/start-ssh-agent.sh
vendored
Normal file
22
vendor/lib/start-ssh-agent.sh
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# Copied from https://help.github.com/articles/working-with-ssh-key-passphrases
|
||||||
|
env=~/.ssh/agent.env
|
||||||
|
|
||||||
|
agent_load_env () { test -f "$env" && . "$env" >| /dev/null ; }
|
||||||
|
|
||||||
|
agent_start () {
|
||||||
|
(umask 077; ssh-agent >| "$env")
|
||||||
|
. "$env" >| /dev/null ; }
|
||||||
|
|
||||||
|
agent_load_env
|
||||||
|
|
||||||
|
# agent_run_state: 0=agent running w/ key; 1=agent w/o key; 2= agent not running
|
||||||
|
agent_run_state=$(ssh-add -l >| /dev/null 2>&1; echo $?)
|
||||||
|
|
||||||
|
if [ ! "$SSH_AUTH_SOCK" ] || [ $agent_run_state = 2 ]; then
|
||||||
|
agent_start
|
||||||
|
ssh-add
|
||||||
|
elif [ "$SSH_AUTH_SOCK" ] && [ $agent_run_state = 1 ]; then
|
||||||
|
ssh-add
|
||||||
|
fi
|
||||||
|
|
||||||
|
unset env
|
37
vendor/profile.ps1
vendored
37
vendor/profile.ps1
vendored
@ -181,41 +181,8 @@ if ($ENV:CMDER_USER_CONFIG) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! (Test-Path $CmderUserProfilePath) ) {
|
if (! (Test-Path $CmderUserProfilePath) ) {
|
||||||
# This multiline string cannot be indented, for this reason I've not indented the whole block
|
Write-Host -BackgroundColor Darkgreen -ForegroundColor White "First Run: Creating user startup file: $CmderUserProfilePath"
|
||||||
|
Copy-Item "$env:CMDER_ROOT\vendor\user_profile.ps1.default" -Destination $CmderUserProfilePath
|
||||||
Write-Host -BackgroundColor Darkgreen -ForegroundColor White "First Run: Creating user startup file: $CmderUserProfilePath"
|
|
||||||
|
|
||||||
$UserProfileTemplate = @'
|
|
||||||
# Use this file to run your own startup commands
|
|
||||||
|
|
||||||
## Prompt Customization
|
|
||||||
<#
|
|
||||||
.SYNTAX
|
|
||||||
<PrePrompt><CMDER DEFAULT>
|
|
||||||
λ <PostPrompt> <repl input>
|
|
||||||
.EXAMPLE
|
|
||||||
<PrePrompt>N:\Documents\src\cmder [master]
|
|
||||||
λ <PostPrompt> |
|
|
||||||
#>
|
|
||||||
|
|
||||||
[ScriptBlock]$PrePrompt = {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
# Replace the cmder prompt entirely with this.
|
|
||||||
# [ScriptBlock]$CmderPrompt = {}
|
|
||||||
|
|
||||||
[ScriptBlock]$PostPrompt = {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
## <Continue to add your own>
|
|
||||||
|
|
||||||
|
|
||||||
'@
|
|
||||||
|
|
||||||
New-Item -ItemType File -Path $CmderUserProfilePath -Value $UserProfileTemplate > $null
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Once Created these code blocks cannot be overwritten
|
# Once Created these code blocks cannot be overwritten
|
||||||
|
19
vendor/user_profile.cmd.default
vendored
Normal file
19
vendor/user_profile.cmd.default
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
:: use this file to run your own startup commands
|
||||||
|
:: use in front of the command to prevent printing the command
|
||||||
|
|
||||||
|
:: uncomment this to have the ssh agent load when cmder starts
|
||||||
|
:: call "%GIT_INSTALL_ROOT%/cmd/start-ssh-agent.cmd" /k exit
|
||||||
|
|
||||||
|
:: uncomment the next two lines to use pageant as the ssh authentication agent
|
||||||
|
:: SET SSH_AUTH_SOCK=/tmp/.ssh-pageant-auth-sock
|
||||||
|
:: call "%GIT_INSTALL_ROOT%/cmd/start-ssh-pageant.cmd"
|
||||||
|
|
||||||
|
:: you can add your plugins to the cmder path like so
|
||||||
|
:: set "PATH=%CMDER_ROOT%\vendor\whatever;%PATH%"
|
||||||
|
|
||||||
|
:: arguments in this batch are passed from init.bat, you can quickly parse them like so:
|
||||||
|
:: more useage can be seen by typing "cexec /?"
|
||||||
|
|
||||||
|
:: %ccall% "/customOption" "command/program"
|
||||||
|
|
||||||
|
@echo off
|
25
vendor/user_profile.ps1.default
vendored
Normal file
25
vendor/user_profile.ps1.default
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Use this file to run your own startup commands
|
||||||
|
|
||||||
|
## Prompt Customization
|
||||||
|
<#
|
||||||
|
.SYNTAX
|
||||||
|
<PrePrompt><CMDER DEFAULT>
|
||||||
|
λ <PostPrompt> <repl input>
|
||||||
|
.EXAMPLE
|
||||||
|
<PrePrompt>N:\Documents\src\cmder [master]
|
||||||
|
λ <PostPrompt> |
|
||||||
|
#>
|
||||||
|
|
||||||
|
[ScriptBlock]$PrePrompt = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
# Replace the cmder prompt entirely with this.
|
||||||
|
# [ScriptBlock]$CmderPrompt = {}
|
||||||
|
|
||||||
|
[ScriptBlock]$PostPrompt = {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
## <Continue to add your own>
|
||||||
|
|
7
vendor/user_profile.sh.default
vendored
Normal file
7
vendor/user_profile.sh.default
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# 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}
|
||||||
|
|
||||||
|
# Uncomment this to have the ssh agent load with the first bash terminal
|
||||||
|
# . "${CMDER_ROOT}/vendor/lib/start-ssh-agent.sh"
|
Reference in New Issue
Block a user