Skip to content

Commit 1e0e219

Browse files
committed
Merge branch 'master' into alias
2 parents 38fd346 + ea531cd commit 1e0e219

File tree

10 files changed

+117
-49
lines changed

10 files changed

+117
-49
lines changed

.github/issue_template.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,86 +2,86 @@
22
33
Thank you for reporting a bug for the Cmder project!
44
------------------------------------------------------------------
5-
5+
66
Please make sure you read and follow the following instructions
77
carefully before reporting bugs, and/or requesting new features.
8-
8+
99
Make sure that you have:
10-
10+
1111
• Searched for existing issues (including the **closed** ones)
1212
for the similar problems here:
13-
13+
1414
https://github.com/cmderdev/cmder/issues?q=is:issue
15-
15+
1616
• Read both the README.md and the Wiki:
17-
17+
1818
- https://github.com/cmderdev/cmder/blob/master/README.md
1919
- https://github.com/cmderdev/cmder/wiki
20-
20+
2121
(What you may be asking here could already be explained there!)
22-
22+
2323
• Please understand that Cmder uses ConEmu as the default
2424
underlying Terminal Emulator. If your issue is regarding
2525
the **Terminal Emulator**, please visit the ConEmu issues page:
26-
26+
2727
https://github.com/Maximus5/ConEmu/issues?q=is:issue
28-
28+
2929
If there isn't an existing issue, you may open a new one there.
30-
31-
(We don't resolve issues regarding ConEmu here, so please
30+
31+
(We don't resolve issues regarding ConEmu here, so please
3232
make sure you open the issue in the correct place.)
3333
3434
more info: https://conemu.github.io/en/ThirdPartyProblems.html
35-
35+
3636
• If you would like to ask for guides on how to integrate Cmder with
3737
your favorite IDE of choice, or how to perform a specific task
3838
with Cmder, make sure you visit our label section first.
39-
39+
4040
You may already have an answer under the Guides or Questions section.
4141
4242
For a list of labels, visit:
4343
- https://github.com/cmderdev/cmder/labels
4444
4545
(Be sure to also check “Closed” issues in the labels section!)
46-
46+
4747
• If you have a request to provide auto-complete support for a new tool,
4848
please post your request here:
49-
49+
5050
https://github.com/vladimir-kotikov/clink-completions/issues
51-
51+
5252
• If you are having an issue with any of the **upstream technologies**
5353
that are used by Cmder, please make sure that the issue is reproducible
5454
_only_ when used in combination with Cmder.
55-
55+
5656
We may not directly address the issues related to the following tools:
5757
- Clink, the default shell in Cmder
5858
- ConEmu, the terminal emulator
5959
- Git/MinGW, which also provide *NIX tools
6060
- clink-completions, which provide autocompletion
61-
61+
6262
The issues related to upstream technologies are labeled as 👆 [name].
63-
63+
6464
We'll try our best to help you -- but we recommend creating an issue
6565
specifically at each of the corresponding repositories for the best
6666
result.
67-
67+
6868
► Try to reproduce the bug you're reporting, on a stand-alone edition
6969
of each tool, without using Cmder. If the bug applies when the
7070
mentioned tools are NOT used within Cmder, there's a good chance that
7171
you should open the bug at the corresponding repo instead.
72-
72+
7373
• Lastly, have a look at official documentation for Cmder over
7474
our website, and our wiki.
7575
7676
Read more on about Cmder on ConEmu docs:
7777
https://conemu.github.io/en/cmder.html
78-
79-
78+
79+
8080
Thank you for making sure you are opening a new valid issue! ♥
81-
81+
8282
-->
8383

84-
<!--
84+
<!--
8585
Some tips on how to write a better report:
8686
- Put an `x` into all the boxes [ ] relevant to your issue (correct example: [x] -- not like this: [ x] or [x ]).
8787
- Use the *Preview* tab to see how your issue will actually look like, before sending it.
@@ -105,5 +105,5 @@
105105

106106
<!-- If applicable, write down your Windows edition too (e.g. Windows 10 Pro 1809) -->
107107

108-
### Description of the issue
108+
### Description of the issue
109109
<!-- Provide a clear, simple description of your issue here -->

.github/stale.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Number of days of inactivity before an issue becomes stale
2+
daysUntilStale: 30
3+
# Number of days of inactivity before a stale issue is closed
4+
daysUntilClose: 7
5+
# Issues with these labels will never be considered stale
6+
exemptLabels:
7+
- "📌 Pinned"
8+
# Label to use when marking an issue as stale
9+
staleLabel: "👀 Awaiting Response"
10+
# Comment to post when marking an issue as stale. Set to `false` to disable
11+
markComment: >
12+
This issue has been automatically marked as stale because it has not had
13+
recent activity. It will be closed in a week if no further activity occurs.
14+
Thank you for your contribution.
15+
# Comment to post when closing a stale issue. Set to `false` to disable
16+
closeComment: >
17+
This issue has been automatically closed due to it not having any
18+
activity since it was marked as stale. Thank you for your contribution.

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,17 @@
22

33
## [Unreleased]
44

5+
* Question issue: [#2094](https://github.com/cmderdev/cmder/issues/2094)
6+
* Pull Request : [#2096](https://github.com/cmderdev/cmder/pull/2096)
7+
* New argument created to ConEmu forwarding arguments.
8+
* Syntax: `/x [ConEmu extras arguments]`
9+
* e.g.: `Cmder.exe /x "-min -tsa"`
10+
511
### Fixes
612

13+
* Pull Request: [#2106](https://github.com/cmderdev/cmder/pull/2106)
14+
* Portable Git requires running `post-install.bat` which deletes itself when done. This was not happening.
15+
* Resolves [#2105](https://github.com/cmderdev/cmder/issues/2105)
716
* Pull Request: [#2002](https://github.com/cmderdev/cmder/pull/2002)
817
* 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
918

@@ -14,6 +23,16 @@
1423
* Provide default settings for Clink that updates the history file in real time
1524
* Turn this on in existing Cmder using `clink set history_io 1`
1625
* Allow clink disable by setting CMDER_CLINK=0 before starting task
26+
* Pull Request: [#2068](https://github.com/cmderdev/cmder/pull/2068)
27+
* Print Index in History Command Output.
28+
* Sets default `history_expand_mode = 3` in initial Clink Settings.
29+
30+
### Adds
31+
32+
* Pull Request: [#2072](https://github.com/cmderdev/cmder/pull/2072)
33+
* New alias create [alias] [alias command] syntax
34+
* Based on [#1750](https://github.com/cmderdev/cmder/pull/1750)
35+
* Syntax: `alias create [alias] [alias command]`
1736

1837
## [1.3.11](https://github.com/cmderdev/cmder/tree/v1.3.11) (2018-12-22)
1938

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ The Cmder's user interface is also designed to be more eye pleasing, and you can
5050
| `/SINGLE` | Start Cmder in single mode. |
5151
| `/START [start_path]` | Folder path to start in. |
5252
| `/TASK [task_name]` | Task to start after launch. |
53+
| `/X [ConEmu extras pars]` | Forwads parameters to ConEmu |
5354
5455
## Context Menu Integration
5556
@@ -146,6 +147,7 @@ You may find some Monokai color schemes for mintty to match Cmder [here](https:/
146147
| `/c [user cmder root]` | Enables user bin and config folders for 'Cmder as admin' sessions due to non-shared environment. | not set |
147148
| `/d` | Enables debug output. | not set |
148149
| `/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 |
150+
| `/t` | Enables Cmder Timed Init Mode. This displays the time taken run init scripts | not set |
149151
| `/git_install_root [file path]` | User specified Git installation root path. | `%CMDER_ROOT%\vendor\Git-for-Windows` |
150152
| `/home [home folder]` | User specified folder path to set `%HOME%` environment variable. | `%userprofile%` |
151153
| `/max_depth [1-5]` | Define max recurse depth when adding to the path for `%cmder_root%\bin` and `%cmder_user_bin%` | 1 |

launcher/src/CmderLauncher.cpp

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ bool FileExists(const wchar_t * filePath)
7171
return false;
7272
}
7373

74-
void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstring taskName = L"", std::wstring cfgRoot = L"", bool use_user_cfg = true)
74+
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"")
7575
{
7676
#if USE_TASKBAR_API
7777
wchar_t appId[MAX_PATH] = { 0 };
@@ -98,6 +98,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
9898

9999
std::wstring cmderStart = path;
100100
std::wstring cmderTask = taskName;
101+
std::wstring cmderConEmuArgs = conemu_args;
101102

102103
std::copy(cfgRoot.begin(), cfgRoot.end(), userConfigDirPath);
103104
userConfigDirPath[cfgRoot.length()] = 0;
@@ -391,6 +392,11 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
391392
swprintf_s(args, L"%s -loadcfgfile \"%s\"", args, userConEmuCfgPath);
392393
}
393394

395+
if (!streqi(cmderConEmuArgs.c_str(), L""))
396+
{
397+
swprintf_s(args, L"%s %s", args, cmderConEmuArgs.c_str());
398+
}
399+
394400
SetEnvironmentVariable(L"CMDER_ROOT", exeDir);
395401
if (wcscmp(userConfigDirPath, configDirPath) != 0)
396402
{
@@ -527,6 +533,7 @@ struct cmderOptions
527533
std::wstring cmderStart = L"";
528534
std::wstring cmderTask = L"";
529535
std::wstring cmderRegScope = L"USER";
536+
std::wstring cmderConEmuArgs = L"";
530537
bool cmderSingle = false;
531538
bool cmderUserCfg = true;
532539
bool registerApp = false;
@@ -620,6 +627,12 @@ cmderOptions GetOption()
620627
}
621628
}
622629
}
630+
/* Used for passing arguments to conemu prog */
631+
else if (_wcsicmp(L"/x", szArgList[i]) == 0)
632+
{
633+
cmderOptions.cmderConEmuArgs = szArgList[i + 1];
634+
i++;
635+
}
623636
else if (cmderOptions.cmderStart == L"")
624637
{
625638
int len = wcslen(szArgList[i]);
@@ -635,13 +648,13 @@ cmderOptions GetOption()
635648
}
636649
else
637650
{
638-
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);
651+
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);
639652
cmderOptions.error = true;
640653
}
641654
}
642655
else
643656
{
644-
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);
657+
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);
645658
cmderOptions.error = true;
646659
}
647660
}
@@ -683,7 +696,7 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
683696
}
684697
else
685698
{
686-
StartCmder(cmderOptions.cmderStart, cmderOptions.cmderSingle, cmderOptions.cmderTask, cmderOptions.cmderCfgRoot, cmderOptions.cmderUserCfg);
699+
StartCmder(cmderOptions.cmderStart, cmderOptions.cmderSingle, cmderOptions.cmderTask, cmderOptions.cmderCfgRoot, cmderOptions.cmderUserCfg, cmderOptions.cmderConEmuArgs);
687700
}
688701

689702
return 0;

vendor/bin/alias.cmd

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,26 +117,36 @@ exit /b
117117
:p_help
118118
echo.Usage:
119119
echo.
120-
echo. alias [options] [alias=alias command] or [[create [alias] [alias command]]]
120+
echo. alias [options] [alias=alias command]
121+
echo.
122+
echo OR
123+
echo.
124+
echo. alias create [alias] [alias command]
121125
echo.
122126
echo.Options:
123127
echo.
124-
echo. Note: Options MUST precede the alias definition.
128+
echo. Note: Options MUST precede the alias definition.
125129
echo.
126-
echo. /d [alias] Delete an [alias].
127-
echo. /f [macrofile] Path to the [macrofile] you want to store the new alias in.
128-
echo. Default: %cmder_root%\config\user_aliases.cmd
129-
echo. /reload Reload the aliases file. Can be used with /f argument.
130-
echo. Default: %cmder_root%\config\user_aliases.cmd
130+
echo. /d [alias] Delete an [alias].
131+
echo. /f [macrofile] Path to the [macrofile] you want to store the new alias in.
132+
echo. Default: %cmder_root%\config\user_aliases.cmd
133+
echo. /reload Reload the aliases file. Can be used with /f argument.
134+
echo. Default: %cmder_root%\config\user_aliases.cmd
131135
echo.
132-
echo. If alias is called with no parameters, it will display the list of existing aliases.
136+
echo. If alias is called with no parameters, it will display the list of existing
137+
echo. aliases.
133138
echo.
134139
echo. In the alias command, you can use the following notations:
135140
echo.
136-
echo. ^^^^^^^^%% - '%%' in env vars must be escaped if preserving the variable in the alias is desired.
137-
echo. $* - allows the alias to assume all the parameters of the supplied command.
138-
echo. $1-$9 - Allows you to seperate parameter by number, much like %%1 in batch.
139-
echo. $T - Command seperator, allowing you to string several commands together into one alias.
141+
echo. ^^^^^^^^%% - %% signs in env vars must be escaped if preserving the variable
142+
echo. in he alias is desired. Variables in aliases surrounded by double
143+
echo. quotes only require '^^%%' vs '^^^^^^^^%%'
144+
echo. $* - allows the alias to assume all the parameters of the supplied
145+
echo. command.
146+
echo. $1-$9 - Allows you to seperate parameter by number, much like %%1 in
147+
echo. batch.
148+
echo. $T - Command seperator, allowing you to string several commands
149+
echo. together into one alias.
140150
echo.
141151
echo. For more information, read DOSKEY /?
142152
exit /b

vendor/clink.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,15 @@ end
189189
-- @return {false|mercurial branch name}
190190
---
191191
local function get_hg_branch()
192-
for line in io.popen("hg branch 2>nul"):lines() do
192+
local file = io.popen("hg branch 2>nul")
193+
for line in file:lines() do
193194
local m = line:match("(.+)$")
194195
if m then
196+
file:close()
195197
return m
196198
end
197199
end
200+
file:close()
198201

199202
return false
200203
end
@@ -204,12 +207,15 @@ end
204207
-- @return {false|svn branch name}
205208
---
206209
local function get_svn_branch(svn_dir)
207-
for line in io.popen("svn info 2>nul"):lines() do
210+
local file = io.popen("svn info 2>nul")
211+
for line in file:lines() do
208212
local m = line:match("^Relative URL:")
209213
if m then
214+
file:close()
210215
return line:sub(line:find("/")+1,line:len())
211216
end
212217
end
218+
file:close()
213219

214220
return false
215221
end

vendor/clink_settings.default

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ history_io = 1
8787
# from the history. This can be enabled and disable by setting this value to 1
8888
# or 0. Values or 2, 3 or 4 will skip any ! character quoted in single, double,
8989
# or both quotes respectively.
90-
history_expand_mode = 4
90+
history_expand_mode = 3
9191

9292
# name: Support Windows' Ctrl-Alt substitute for AltGr
9393
# type: bool

vendor/init.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,9 +369,9 @@ call "%user_aliases%"
369369
:: Basically we need to execute this post-install.bat because we are
370370
:: manually extracting the archive rather than executing the 7z sfx
371371
if exist "%GIT_INSTALL_ROOT%\post-install.bat" (
372-
%lib_console% verbose_output "Running Git for Windows one time Post Install...."
372+
echo Running Git for Windows one time Post Install....
373373
pushd "%GIT_INSTALL_ROOT%\"
374-
"%GIT_INSTALL_ROOT%\git-bash.exe" --no-needs-console --hide --no-cd --command=post-install.bat
374+
"%GIT_INSTALL_ROOT%\git-cmd.exe" --no-needs-console --no-cd --command=post-install.bat
375375
popd
376376
)
377377

vendor/user_aliases.cmd.default

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ gl=git log --oneline --all --graph --decorate $*
99
ls=ls --show-control-chars -F --color $*
1010
pwd=cd
1111
clear=cls
12-
history=cat "%CMDER_ROOT%\config\.history"
12+
history=cat -n "%CMDER_ROOT%\config\.history"
1313
unalias=alias /d $1
1414
vi=vim $*
1515
cmderr=cd /d "%CMDER_ROOT%"

0 commit comments

Comments
 (0)