Merge branch 'master' into alias

This commit is contained in:
Dax T. Games 2019-07-07 13:31:13 -04:00
commit 1e0e2193e0
10 changed files with 117 additions and 49 deletions

18
.github/stale.yml vendored Normal file
View File

@ -0,0 +1,18 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 30
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- "📌 Pinned"
# Label to use when marking an issue as stale
staleLabel: "👀 Awaiting Response"
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed in a week if no further activity occurs.
Thank you for your contribution.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: >
This issue has been automatically closed due to it not having any
activity since it was marked as stale. Thank you for your contribution.

View File

@ -2,8 +2,17 @@
## [Unreleased]
* Question issue: [#2094](https://github.com/cmderdev/cmder/issues/2094)
* Pull Request : [#2096](https://github.com/cmderdev/cmder/pull/2096)
* New argument created to ConEmu forwarding arguments.
* Syntax: `/x [ConEmu extras arguments]`
* e.g.: `Cmder.exe /x "-min -tsa"`
### Fixes
* Pull Request: [#2106](https://github.com/cmderdev/cmder/pull/2106)
* Portable Git requires running `post-install.bat` which deletes itself when done. This was not happening.
* Resolves [#2105](https://github.com/cmderdev/cmder/issues/2105)
* Pull Request: [#2002](https://github.com/cmderdev/cmder/pull/2002)
* Updated the HG prompt code to use the '-ib' option to 'hg id' so the branch name is always available, regardless of the state of the working copy
@ -14,6 +23,16 @@
* Provide default settings for Clink that updates the history file in real time
* Turn this on in existing Cmder using `clink set history_io 1`
* Allow clink disable by setting CMDER_CLINK=0 before starting task
* Pull Request: [#2068](https://github.com/cmderdev/cmder/pull/2068)
* Print Index in History Command Output.
* Sets default `history_expand_mode = 3` in initial Clink Settings.
### Adds
* Pull Request: [#2072](https://github.com/cmderdev/cmder/pull/2072)
* New alias create [alias] [alias command] syntax
* Based on [#1750](https://github.com/cmderdev/cmder/pull/1750)
* Syntax: `alias create [alias] [alias command]`
## [1.3.11](https://github.com/cmderdev/cmder/tree/v1.3.11) (2018-12-22)

View File

@ -50,6 +50,7 @@ The Cmder's user interface is also designed to be more eye pleasing, and you can
| `/SINGLE` | Start Cmder in single mode. |
| `/START [start_path]` | Folder path to start in. |
| `/TASK [task_name]` | Task to start after launch. |
| `/X [ConEmu extras pars]` | Forwads parameters to ConEmu |
## Context Menu Integration
@ -146,6 +147,7 @@ You may find some Monokai color schemes for mintty to match Cmder [here](https:/
| `/c [user cmder root]` | Enables user bin and config folders for 'Cmder as admin' sessions due to non-shared environment. | not set |
| `/d` | Enables debug output. | not set |
| `/f` | Enables Cmder Fast Init Mode. This disables some features, see pull request [#1492](https://github.com/cmderdev/cmder/pull/1942) for more details. | not set |
| `/t` | Enables Cmder Timed Init Mode. This displays the time taken run init scripts | not set |
| `/git_install_root [file path]` | User specified Git installation root path. | `%CMDER_ROOT%\vendor\Git-for-Windows` |
| `/home [home folder]` | User specified folder path to set `%HOME%` environment variable. | `%userprofile%` |
| `/max_depth [1-5]` | Define max recurse depth when adding to the path for `%cmder_root%\bin` and `%cmder_user_bin%` | 1 |

View File

@ -71,7 +71,7 @@ bool FileExists(const wchar_t * filePath)
return false;
}
void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstring taskName = L"", std::wstring cfgRoot = L"", bool use_user_cfg = true)
void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstring taskName = L"", std::wstring cfgRoot = L"", bool use_user_cfg = true, std::wstring conemu_args = L"")
{
#if USE_TASKBAR_API
wchar_t appId[MAX_PATH] = { 0 };
@ -98,6 +98,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
std::wstring cmderStart = path;
std::wstring cmderTask = taskName;
std::wstring cmderConEmuArgs = conemu_args;
std::copy(cfgRoot.begin(), cfgRoot.end(), userConfigDirPath);
userConfigDirPath[cfgRoot.length()] = 0;
@ -391,6 +392,11 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
swprintf_s(args, L"%s -loadcfgfile \"%s\"", args, userConEmuCfgPath);
}
if (!streqi(cmderConEmuArgs.c_str(), L""))
{
swprintf_s(args, L"%s %s", args, cmderConEmuArgs.c_str());
}
SetEnvironmentVariable(L"CMDER_ROOT", exeDir);
if (wcscmp(userConfigDirPath, configDirPath) != 0)
{
@ -527,6 +533,7 @@ struct cmderOptions
std::wstring cmderStart = L"";
std::wstring cmderTask = L"";
std::wstring cmderRegScope = L"USER";
std::wstring cmderConEmuArgs = L"";
bool cmderSingle = false;
bool cmderUserCfg = true;
bool registerApp = false;
@ -620,6 +627,12 @@ cmderOptions GetOption()
}
}
}
/* Used for passing arguments to conemu prog */
else if (_wcsicmp(L"/x", szArgList[i]) == 0)
{
cmderOptions.cmderConEmuArgs = szArgList[i + 1];
i++;
}
else if (cmderOptions.cmderStart == L"")
{
int len = wcslen(szArgList[i]);
@ -635,13 +648,13 @@ cmderOptions GetOption()
}
else
{
MessageBox(NULL, L"Unrecognized parameter.\n\nValid options:\n\n /c [CMDER User Root Path]\n\n /task [ConEmu Task Name]\n\n [/start [Start in Path] | [Start in Path]]\n\n /single\n\n /m\n\nor\n\n /register [USER | ALL]\n\nor\n\n /unregister [USER | ALL]\n", MB_TITLE, MB_OK);
MessageBox(NULL, L"Unrecognized parameter.\n\nValid options:\n\n /c [CMDER User Root Path]\n\n /task [ConEmu Task Name]\n\n [/start [Start in Path] | [Start in Path]]\n\n /single\n\n /m\n\n /x [ConEmu extra arguments]\n\nor\n\n /register [USER | ALL]\n\nor\n\n /unregister [USER | ALL]\n", MB_TITLE, MB_OK);
cmderOptions.error = true;
}
}
else
{
MessageBox(NULL, L"Unrecognized parameter.\n\nValid options:\n\n /c [CMDER User Root Path]\n\n /task [ConEmu Task Name]\n\n [/start [Start in Path] | [Start in Path]]\n\n /single\n\n /m\n\nor\n\n /register [USER | ALL]\n\nor\n\n /unregister [USER | ALL]\n", MB_TITLE, MB_OK);
MessageBox(NULL, L"Unrecognized parameter.\n\nValid options:\n\n /c [CMDER User Root Path]\n\n /task [ConEmu Task Name]\n\n [/start [Start in Path] | [Start in Path]]\n\n /single\n\n /m\n\n /x [ConEmu extra arguments]\n\nor\n\n /register [USER | ALL]\n\nor\n\n /unregister [USER | ALL]\n", MB_TITLE, MB_OK);
cmderOptions.error = true;
}
}
@ -683,7 +696,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
}
else
{
StartCmder(cmderOptions.cmderStart, cmderOptions.cmderSingle, cmderOptions.cmderTask, cmderOptions.cmderCfgRoot, cmderOptions.cmderUserCfg);
StartCmder(cmderOptions.cmderStart, cmderOptions.cmderSingle, cmderOptions.cmderTask, cmderOptions.cmderCfgRoot, cmderOptions.cmderUserCfg, cmderOptions.cmderConEmuArgs);
}
return 0;

22
vendor/bin/alias.cmd vendored
View File

@ -117,7 +117,11 @@ exit /b
:p_help
echo.Usage:
echo.
echo. alias [options] [alias=alias command] or [[create [alias] [alias command]]]
echo. alias [options] [alias=alias command]
echo.
echo OR
echo.
echo. alias create [alias] [alias command]
echo.
echo.Options:
echo.
@ -129,14 +133,20 @@ echo. Default: %cmder_root%\config\user_aliases.cmd
echo. /reload Reload the aliases file. Can be used with /f argument.
echo. Default: %cmder_root%\config\user_aliases.cmd
echo.
echo. If alias is called with no parameters, it will display the list of existing aliases.
echo. If alias is called with no parameters, it will display the list of existing
echo. aliases.
echo.
echo. In the alias command, you can use the following notations:
echo.
echo. ^^^^^^^^%% - '%%' in env vars must be escaped if preserving the variable in the alias is desired.
echo. $* - allows the alias to assume all the parameters of the supplied command.
echo. $1-$9 - Allows you to seperate parameter by number, much like %%1 in batch.
echo. $T - Command seperator, allowing you to string several commands together into one alias.
echo. ^^^^^^^^%% - %% signs in env vars must be escaped if preserving the variable
echo. in he alias is desired. Variables in aliases surrounded by double
echo. quotes only require '^^%%' vs '^^^^^^^^%%'
echo. $* - allows the alias to assume all the parameters of the supplied
echo. command.
echo. $1-$9 - Allows you to seperate parameter by number, much like %%1 in
echo. batch.
echo. $T - Command seperator, allowing you to string several commands
echo. together into one alias.
echo.
echo. For more information, read DOSKEY /?
exit /b

10
vendor/clink.lua vendored
View File

@ -189,12 +189,15 @@ end
-- @return {false|mercurial branch name}
---
local function get_hg_branch()
for line in io.popen("hg branch 2>nul"):lines() do
local file = io.popen("hg branch 2>nul")
for line in file:lines() do
local m = line:match("(.+)$")
if m then
file:close()
return m
end
end
file:close()
return false
end
@ -204,12 +207,15 @@ end
-- @return {false|svn branch name}
---
local function get_svn_branch(svn_dir)
for line in io.popen("svn info 2>nul"):lines() do
local file = io.popen("svn info 2>nul")
for line in file:lines() do
local m = line:match("^Relative URL:")
if m then
file:close()
return line:sub(line:find("/")+1,line:len())
end
end
file:close()
return false
end

View File

@ -87,7 +87,7 @@ history_io = 1
# from the history. This can be enabled and disable by setting this value to 1
# or 0. Values or 2, 3 or 4 will skip any ! character quoted in single, double,
# or both quotes respectively.
history_expand_mode = 4
history_expand_mode = 3
# name: Support Windows' Ctrl-Alt substitute for AltGr
# type: bool

4
vendor/init.bat vendored
View File

@ -369,9 +369,9 @@ call "%user_aliases%"
:: Basically we need to execute this post-install.bat because we are
:: manually extracting the archive rather than executing the 7z sfx
if exist "%GIT_INSTALL_ROOT%\post-install.bat" (
%lib_console% verbose_output "Running Git for Windows one time Post Install...."
echo Running Git for Windows one time Post Install....
pushd "%GIT_INSTALL_ROOT%\"
"%GIT_INSTALL_ROOT%\git-bash.exe" --no-needs-console --hide --no-cd --command=post-install.bat
"%GIT_INSTALL_ROOT%\git-cmd.exe" --no-needs-console --no-cd --command=post-install.bat
popd
)

View File

@ -9,7 +9,7 @@ gl=git log --oneline --all --graph --decorate $*
ls=ls --show-control-chars -F --color $*
pwd=cd
clear=cls
history=cat "%CMDER_ROOT%\config\.history"
history=cat -n "%CMDER_ROOT%\config\.history"
unalias=alias /d $1
vi=vim $*
cmderr=cd /d "%CMDER_ROOT%"