Skip to content

Commit 8fa1d2e

Browse files
committed
Merge remote-tracking branch 'upstream/development' into development-dax
* upstream/development: (84 commits) update profile.ps1's debug output Make PowerShell profile.ps1's debug and verbose working correctly Redirect Verbose and Debug stream ignore git commit fix line endings adjust comments Update PowerShell test to set CMDER_DEBUG env variable inline improve CI PowrShell profile test debug/verbose output Modify PowerShell test command for debug output fix incorrect comment adjust comments adjust comments adjust comments Avoid duplicating cmd.exe prompt definition Consolidate terminal conditionals and add shell integration for bash and cmd.exe Add OSC 133;D support for command exit code tracking Initial plan adjust comments simplify regex adjust comments ...
2 parents a9f8707 + 480b638 commit 8fa1d2e

29 files changed

+643
-386
lines changed

.git-blame-ignore-revs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# List of whitespace-only commits to ignore in the Git blame;
2+
# to improve tracking changes and avoid noise
3+
58db4e3419bf1e5cc1bb61fcd7ce2ebbca89243a
4+
efb3338f5cf0eec21e8a75abc62ee14965cb4a7e
5+
3859f6ffc088b2ae78748abc84986f4adcadcd41
6+
d6569192fc91167f555c3eff58402ff01f1197ea
7+
67de97a492c9389f95499db38f9474a1c20ec585
8+
a0d085f93eaa69c22449d0217e8daf9eaea2b180
9+
1cfba25beb46c74bb1debca2bcfe7ac470e96172
10+
f6bc623284914489e891bbac923feb774c862b99
11+
abbab3f8b477e917d0a175d0de23cce121096631
12+
126347025f9cade241beff182738b2527da7535e
13+
4740b836f300658b27e6ad4d79efac63c9c24c24
14+
be44bac95670b1cbbc91bd657882d985989846f9
15+
f67e5704eda60526d495be758572181f01a6cac8

.github/workflows/branches.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
# Steps represent a sequence of tasks that will be executed as part of the job
2020
steps:
2121
# Checks-out the repository under $GITHUB_WORKSPACE, so the job can access it
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@v5
2323
with:
2424
fetch-depth: 0 # fetch all history for all branches and tags
2525

.github/workflows/build.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
discussions: write
3636
steps:
3737
- name: Check out repository code (Action from GitHub)
38-
uses: actions/checkout@v4
38+
uses: actions/checkout@v5
3939
with:
4040
fetch-depth: 0
4141

@@ -53,66 +53,66 @@ jobs:
5353
run: .\pack.ps1 -verbose -terminal all
5454

5555
- name: Upload artifact (cmder_win_mini.zip)
56-
uses: actions/upload-artifact@v3
56+
uses: actions/upload-artifact@v4
5757
with:
5858
path: build/cmder_win_mini.zip
5959
name: cmder_win_mini.zip
6060
if-no-files-found: error
6161

6262
- name: Upload artifact (cmder_win.7z)
63-
uses: actions/upload-artifact@v3
63+
uses: actions/upload-artifact@v4
6464
with:
6565
path: build/cmder_win.7z
6666
name: cmder_win.7z
6767
if-no-files-found: error
6868

6969
- name: Upload artifact (cmder_win.zip)
70-
uses: actions/upload-artifact@v3
70+
uses: actions/upload-artifact@v4
7171
with:
7272
path: build/cmder_win.zip
7373
name: cmder_win.zip
7474
if-no-files-found: error
7575

7676
- name: Upload artifact (cmder_wt.zip)
77-
uses: actions/upload-artifact@v3
77+
uses: actions/upload-artifact@v4
7878
with:
7979
path: build/cmder_wt.zip
8080
name: cmder_wt.zip
8181
if-no-files-found: error
8282

8383
- name: Upload artifact (cmder_wt.7z)
84-
uses: actions/upload-artifact@v3
84+
uses: actions/upload-artifact@v4
8585
with:
8686
path: build/cmder_wt.7z
8787
name: cmder_wt.7z
8888

8989
- name: Upload artifact (cmder_wt_mini.zip)
90-
uses: actions/upload-artifact@v3
90+
uses: actions/upload-artifact@v4
9191
with:
9292
path: build/cmder_wt_mini.zip
9393
name: cmder_wt_mini.zip
9494

9595
- name: Upload artifact (cmder.zip)
96-
uses: actions/upload-artifact@v4
96+
uses: actions/upload-artifact@v5
9797
with:
9898
path: build/cmder.zip
9999
name: cmder.zip
100100
if-no-files-found: error
101101

102102
- name: Upload artifact (cmder.7z)
103-
uses: actions/upload-artifact@v4
103+
uses: actions/upload-artifact@v5
104104
with:
105105
path: build/cmder.7z
106106
name: cmder.7z
107107

108108
- name: Upload artifact (cmder_mini.zip)
109-
uses: actions/upload-artifact@v4
109+
uses: actions/upload-artifact@v5
110110
with:
111111
path: build/cmder_mini.zip
112112
name: cmder_mini.zip
113113

114114
- name: Upload artifact (hashes.txt)
115-
uses: actions/upload-artifact@v4
115+
uses: actions/upload-artifact@v5
116116
with:
117117
path: build/hashes.txt
118118
name: hashes.txt

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ jobs:
4545

4646
steps:
4747
- name: Checkout repository
48-
uses: actions/checkout@v4
48+
uses: actions/checkout@v5
4949

5050
# Initializes the CodeQL tools for scanning.
5151
- name: Initialize CodeQL
52-
uses: github/codeql-action/init@v3
52+
uses: github/codeql-action/init@v4
5353
with:
5454
languages: ${{ matrix.language }}
5555
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -68,6 +68,6 @@ jobs:
6868
run: .\build.ps1 -Compile -verbose
6969

7070
- name: Perform CodeQL Analysis
71-
uses: github/codeql-action/analyze@v3
71+
uses: github/codeql-action/analyze@v4
7272
with:
7373
category: "/language:${{matrix.language}}"

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
continue-on-error: false
3939

4040
steps:
41-
- uses: actions/checkout@v4
41+
- uses: actions/checkout@v5
4242
- name: Initialize vendors
4343
shell: pwsh
4444
working-directory: scripts
@@ -48,7 +48,7 @@ jobs:
4848
cmd /c vendor\init.bat /v /d /t
4949
- name: Testing PowerShell
5050
run: |
51-
PowerShell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile -Command "Invoke-Expression '. ''vendor\profile.ps1'''"
51+
PowerShell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile -Command "$env:CMDER_DEBUG='1'; . 'vendor\profile.ps1'"
5252
- name: Testing Bash
5353
run: |
5454
bash vendor/cmder.sh

.github/workflows/vendor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
pull-requests: write
2525

2626
steps:
27-
- uses: actions/checkout@v4
27+
- uses: actions/checkout@v5
2828
with:
2929
fetch-depth: 0
3030

@@ -51,7 +51,7 @@ jobs:
5151
Set-GHVariable -Name LIST_UPDATED -Value $listUpdated.Trim(', ')
5252
echo "UPDATE_MESSAGE<<<EOF`n$updateMessage`n<EOF" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
5353
54-
- uses: peter-evans/create-pull-request@v6
54+
- uses: peter-evans/create-pull-request@v7
5555
if: env.COUNT_UPDATED > 0
5656
with:
5757
title: 'Updates to `${{ env.COUNT_UPDATED }}` vendored dependencies'

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Change Log
22

3+
## Unreleased
4+
5+
### Fixes
6+
7+
- Fixes #2940
8+
9+
### Adds
10+
11+
- Cmder for Windows
12+
- Uses Windows and Git for Windows Native Terminals.
13+
- Does not contain a terminal emulator like ConEmu or Windows Terminal.
14+
315
## [1.3.20](https://github.com/cmderdev/cmder/tree/v1.3.20) (2022-03-18)
416

517
### Changes

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,10 @@ Cmder by default comes with a vendored ConEmu installation as the underlying ter
352352

353353
However, Cmder can in fact run in a variety of other terminal emulators, and even integrated IDEs. Assuming you have the latest version of Cmder, follow the following instructions to get Cmder working with your own terminal emulator.
354354

355+
*Note:* Cmder includes built-in support for Windows Terminal directory tracking via OSC 9;9 sequences. This enables "Duplicate Tab" and "Split Pane" features to preserve the current working directory for both `cmd.exe` and PowerShell sessions.
356+
357+
*Note:* Cmder also includes built-in support for [Windows Terminal shell integration](https://learn.microsoft.com/en-us/windows/terminal/tutorials/shell-integration) via OSC 133 sequences (A, B, C, D) for PowerShell sessions. This enables features like command navigation (jump between commands), command selection, visual command separators, command exit code tracking, and improved command history management in Windows Terminal.
358+
355359
For instructions on how to integrate Cmder with your IDE, please read our [Wiki section](https://github.com/cmderdev/cmder/wiki#cmder-integration).
356360

357361
## Upgrading

launcher/CmderLauncher.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@
188188
<ItemGroup>
189189
<ClCompile Include="src\CmderLauncher.cpp" />
190190
</ItemGroup>
191+
<ItemGroup>
192+
<Image Include="..\icons\cmder.ico" />
193+
</ItemGroup>
191194
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
192195
<ImportGroup Label="ExtensionTargets">
193196
</ImportGroup>

launcher/src/CmderLauncher.cpp

Lines changed: 17 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ bool FileExists(const wchar_t * filePath)
105105
return false;
106106
}
107107

108-
void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstring taskName = L"", std::wstring title = L"", std::wstring iconPath = L"", std::wstring cfgRoot = L"", bool use_user_cfg = true, std::wstring conemu_args = L"", bool admin = false)
108+
void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstring taskName = L"", std::wstring title = L"", std::wstring iconPath = L"", std::wstring cfgRoot = L"", bool use_user_cfg = true, std::wstring conemu_args = L"")
109109
{
110-
#if USE_TASKBAR_API
111-
wchar_t appId[MAX_PATH] = { 0 };
112-
#endif
110+
#if USE_TASKBAR_API
111+
wchar_t appId[MAX_PATH] = { 0 };
112+
#endif
113113
wchar_t exeDir[MAX_PATH] = { 0 };
114114
wchar_t icoPath[MAX_PATH] = { 0 };
115115
wchar_t cfgPath[MAX_PATH] = { 0 };
@@ -153,9 +153,9 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
153153

154154
GetModuleFileName(NULL, exeDir, sizeof(exeDir));
155155

156-
#if USE_TASKBAR_API
157-
wcscpy_s(appId, exeDir);
158-
#endif
156+
#if USE_TASKBAR_API
157+
wcscpy_s(appId, exeDir);
158+
#endif
159159

160160
PathRemoveFileSpec(exeDir);
161161

@@ -312,7 +312,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
312312
MessageBox(NULL,
313313
(GetLastError() == ERROR_ACCESS_DENIED)
314314
? L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_terminal_%COMPUTERNAME%_settings.json! Access Denied."
315-
: L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_teerminal_%COMPUTERNAME%_settigns.json!", MB_TITLE, MB_ICONSTOP);
315+
: L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_terminal_%COMPUTERNAME%_settigns.json!", MB_TITLE, MB_ICONSTOP);
316316
exit(1);
317317
}
318318
else if (PathFileExists(conEmuDir))
@@ -329,7 +329,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
329329
{
330330
if (!CopyFile(cpuCfgPath, cfgPath, FALSE))
331331
{
332-
if (PathFileExists(windowsTerminalDir)) {
332+
if (PathFileExists(windowsTerminalDir)) {
333333
MessageBox(NULL,
334334
(GetLastError() == ERROR_ACCESS_DENIED)
335335
? L"Failed to copy config/windows_terminal_%COMPUTERNAME%_settings.json file to vendor/windows-terminal/settings/settings.json! Access Denied."
@@ -360,7 +360,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
360360
MessageBox(NULL,
361361
(GetLastError() == ERROR_ACCESS_DENIED)
362362
? L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_terminal_settings.json! Access Denied."
363-
: L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_teerminal_settigns.json!", MB_TITLE, MB_ICONSTOP);
363+
: L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_terminal_settigns.json!", MB_TITLE, MB_ICONSTOP);
364364
exit(1);
365365
}
366366
else if (PathFileExists(conEmuDir))
@@ -645,44 +645,13 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
645645
STARTUPINFO si = { 0 };
646646

647647
si.cb = sizeof(STARTUPINFO);
648-
#if USE_TASKBAR_API
649-
si.lpTitle = appId;
650-
si.dwFlags = STARTF_TITLEISAPPID;
651-
#endif
648+
#if USE_TASKBAR_API
649+
si.lpTitle = appId;
650+
si.dwFlags = STARTF_TITLEISAPPID;
651+
#endif
652652
PROCESS_INFORMATION pi;
653653

654-
// MessageBox(NULL, terminalPath, _T("Error"), MB_OK);
655-
// MessageBox(NULL, args, _T("Error"), MB_OK);
656-
// Let's try to rerun as Administrator
657-
SHELLEXECUTEINFO sei = { sizeof(sei) };
658-
sei.fMask = SEE_MASK_NOASYNC | SEE_MASK_NOCLOSEPROCESS;
659-
sei.lpVerb = L"runas";
660-
sei.lpFile = terminalPath;
661-
sei.lpParameters = args;
662-
sei.nShow = SW_SHOWNORMAL;
663-
664-
if (admin && ShellExecuteEx(&sei))
665-
{
666-
if (!sei.hProcess)
667-
{
668-
Sleep(500);
669-
_ASSERTE(sei.hProcess != nullptr);
670-
}
671-
672-
if (sei.hProcess)
673-
{
674-
WaitForSingleObject(sei.hProcess, INFINITE);
675-
}
676-
677-
// int nZone = 0;
678-
// if (!HasZoneIdentifier(lsFile, nZone)
679-
// || (nZone != 0 /*LocalComputer*/))
680-
// {
681-
// // Assuming that elevated copy has fixed all zone problems
682-
// break;
683-
// }
684-
}
685-
else if (!CreateProcess(terminalPath, args, NULL, NULL, false, 0, NULL, NULL, &si, &pi))
654+
if (!CreateProcess(terminalPath, args, NULL, NULL, false, 0, NULL, NULL, &si, &pi))
686655
{
687656
if (PathFileExists(windowsTerminalDir))
688657
{
@@ -813,7 +782,6 @@ struct cmderOptions
813782
std::wstring cmderIcon = L"";
814783
std::wstring cmderRegScope = L"USER";
815784
std::wstring cmderTerminalArgs = L"";
816-
bool cmderAdmin = false;
817785
bool cmderSingle = false;
818786
bool cmderUserCfg = true;
819787
bool registerApp = false;
@@ -902,10 +870,6 @@ cmderOptions GetOption()
902870
{
903871
cmderOptions.cmderUserCfg = false;
904872
}
905-
else if (_wcsicmp(L"/a", szArgList[i]) == 0 && !PathFileExists(windowsTerminalDir) && !PathFileExists(conEmuDir))
906-
{
907-
cmderOptions.cmderAdmin = true;
908-
}
909873
else if (_wcsicmp(L"/register", szArgList[i]) == 0)
910874
{
911875
cmderOptions.registerApp = true;
@@ -1042,7 +1006,8 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
10421006
}
10431007
else
10441008
{
1045-
StartCmder(cmderOptions.cmderStart, cmderOptions.cmderSingle, cmderOptions.cmderTask, cmderOptions.cmderTitle, cmderOptions.cmderIcon, cmderOptions.cmderCfgRoot, cmderOptions.cmderUserCfg, cmderOptions.cmderTerminalArgs, cmderOptions.cmderAdmin); }
1009+
StartCmder(cmderOptions.cmderStart, cmderOptions.cmderSingle, cmderOptions.cmderTask, cmderOptions.cmderTitle, cmderOptions.cmderIcon, cmderOptions.cmderCfgRoot, cmderOptions.cmderUserCfg, cmderOptions.cmderTerminalArgs);
1010+
}
10461011

10471012
return 0;
10481013
}

0 commit comments

Comments
 (0)