mirror of
https://github.com/cmderdev/cmder.git
synced 2025-03-12 13:44:39 +08:00
Merge branch 'master' into alias
This commit is contained in:
commit
1e0e2193e0
54
.github/issue_template.md
vendored
54
.github/issue_template.md
vendored
@ -2,86 +2,86 @@
|
||||
|
||||
Thank you for reporting a bug for the Cmder project!
|
||||
------------------------------------------------------------------
|
||||
|
||||
|
||||
Please make sure you read and follow the following instructions
|
||||
carefully before reporting bugs, and/or requesting new features.
|
||||
|
||||
|
||||
Make sure that you have:
|
||||
|
||||
|
||||
• Searched for existing issues (including the **closed** ones)
|
||||
for the similar problems here:
|
||||
|
||||
|
||||
https://github.com/cmderdev/cmder/issues?q=is:issue
|
||||
|
||||
|
||||
• Read both the README.md and the Wiki:
|
||||
|
||||
|
||||
- https://github.com/cmderdev/cmder/blob/master/README.md
|
||||
- https://github.com/cmderdev/cmder/wiki
|
||||
|
||||
|
||||
(What you may be asking here could already be explained there!)
|
||||
|
||||
|
||||
• Please understand that Cmder uses ConEmu as the default
|
||||
underlying Terminal Emulator. If your issue is regarding
|
||||
the **Terminal Emulator**, please visit the ConEmu issues page:
|
||||
|
||||
|
||||
https://github.com/Maximus5/ConEmu/issues?q=is:issue
|
||||
|
||||
|
||||
If there isn't an existing issue, you may open a new one there.
|
||||
|
||||
(We don't resolve issues regarding ConEmu here, so please
|
||||
|
||||
(We don't resolve issues regarding ConEmu here, so please
|
||||
make sure you open the issue in the correct place.)
|
||||
|
||||
more info: https://conemu.github.io/en/ThirdPartyProblems.html
|
||||
|
||||
|
||||
• If you would like to ask for guides on how to integrate Cmder with
|
||||
your favorite IDE of choice, or how to perform a specific task
|
||||
with Cmder, make sure you visit our label section first.
|
||||
|
||||
|
||||
You may already have an answer under the Guides or Questions section.
|
||||
|
||||
For a list of labels, visit:
|
||||
- https://github.com/cmderdev/cmder/labels
|
||||
|
||||
(Be sure to also check “Closed” issues in the labels section!)
|
||||
|
||||
|
||||
• If you have a request to provide auto-complete support for a new tool,
|
||||
please post your request here:
|
||||
|
||||
|
||||
https://github.com/vladimir-kotikov/clink-completions/issues
|
||||
|
||||
|
||||
• If you are having an issue with any of the **upstream technologies**
|
||||
that are used by Cmder, please make sure that the issue is reproducible
|
||||
_only_ when used in combination with Cmder.
|
||||
|
||||
|
||||
We may not directly address the issues related to the following tools:
|
||||
- Clink, the default shell in Cmder
|
||||
- ConEmu, the terminal emulator
|
||||
- Git/MinGW, which also provide *NIX tools
|
||||
- clink-completions, which provide autocompletion
|
||||
|
||||
|
||||
The issues related to upstream technologies are labeled as 👆 [name].
|
||||
|
||||
|
||||
We'll try our best to help you -- but we recommend creating an issue
|
||||
specifically at each of the corresponding repositories for the best
|
||||
result.
|
||||
|
||||
|
||||
► Try to reproduce the bug you're reporting, on a stand-alone edition
|
||||
of each tool, without using Cmder. If the bug applies when the
|
||||
mentioned tools are NOT used within Cmder, there's a good chance that
|
||||
you should open the bug at the corresponding repo instead.
|
||||
|
||||
|
||||
• Lastly, have a look at official documentation for Cmder over
|
||||
our website, and our wiki.
|
||||
|
||||
Read more on about Cmder on ConEmu docs:
|
||||
https://conemu.github.io/en/cmder.html
|
||||
|
||||
|
||||
|
||||
|
||||
Thank you for making sure you are opening a new valid issue! ♥
|
||||
|
||||
|
||||
-->
|
||||
|
||||
<!--
|
||||
<!--
|
||||
Some tips on how to write a better report:
|
||||
- Put an `x` into all the boxes [ ] relevant to your issue (correct example: [x] -- not like this: [ x] or [x ]).
|
||||
- Use the *Preview* tab to see how your issue will actually look like, before sending it.
|
||||
@ -105,5 +105,5 @@
|
||||
|
||||
<!-- If applicable, write down your Windows edition too (e.g. Windows 10 Pro 1809) -->
|
||||
|
||||
### Description of the issue
|
||||
### Description of the issue
|
||||
<!-- Provide a clear, simple description of your issue here -->
|
||||
|
18
.github/stale.yml
vendored
Normal file
18
.github/stale.yml
vendored
Normal 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.
|
19
CHANGELOG.md
19
CHANGELOG.md
@ -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)
|
||||
|
||||
|
@ -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 |
|
||||
|
@ -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;
|
||||
|
34
vendor/bin/alias.cmd
vendored
34
vendor/bin/alias.cmd
vendored
@ -117,26 +117,36 @@ 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.
|
||||
echo. Note: Options MUST precede the alias definition.
|
||||
echo. Note: Options MUST precede the alias definition.
|
||||
echo.
|
||||
echo. /d [alias] Delete an [alias].
|
||||
echo. /f [macrofile] Path to the [macrofile] you want to store the new alias in.
|
||||
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. /d [alias] Delete an [alias].
|
||||
echo. /f [macrofile] Path to the [macrofile] you want to store the new alias in.
|
||||
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
10
vendor/clink.lua
vendored
@ -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
|
||||
|
2
vendor/clink_settings.default
vendored
2
vendor/clink_settings.default
vendored
@ -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
4
vendor/init.bat
vendored
@ -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
|
||||
)
|
||||
|
||||
|
2
vendor/user_aliases.cmd.default
vendored
2
vendor/user_aliases.cmd.default
vendored
@ -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%"
|
||||
|
Loading…
x
Reference in New Issue
Block a user