Skip to content

Cmder development changes #2898

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 150 commits into
base: master
Choose a base branch
from
Draft

Cmder development changes #2898

wants to merge 150 commits into from

Conversation

DRSDavidSoft
Copy link
Contributor

No description provided.

daxgames and others added 15 commits January 5, 2025 13:01
Development BUG - Fixes launcher overwriting or not backing up terminal emulator settings in development branch.
* origin/cmder4win:
  cleanup
  cleanup
  cleanup
  not set
  origin/fix_launcher_overwrite
  cleanup
  respect PATHEXT instead of hardcoding our own value
  add missing qualified dir
  cleanup
  prevent warnings if the dir does not exist
  enable `/d` flag in `excd` by default
  fix conflict
  add notes on what shim actually is
  ⬆️ Update dependencies (git-for-windows v2.47.0.windows.1, clink v1.7.3, clink-completions v0.6.0)
  make library comments consistent and clean up code
  Use single quotes inside double quotes
  modify the header to remove outdated mention
  add vendor/bin/create-cmdercfg.cmd
Development BUG - Fixes launcher overwriting or not backing up terminal emulator settings in development branch.
* upstream-development:
  CHANGELOG.md
  CHANGELOG.md
Cmder for Windows  - Add `Bash`, `Powershell`, `mintty`.
@DRSDavidSoft DRSDavidSoft changed the title Cmder 1.4 development changes Cmder development changes Apr 8, 2025
@DRSDavidSoft DRSDavidSoft requested a review from Copilot July 2, 2025 02:19
@DRSDavidSoft DRSDavidSoft added this to the 1.4 milestone Jul 2, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Add support for Windows Terminal alongside ConEmu and enable packing/building specific terminals via a new -terminal option. Updates include:

  • Introduce -terminal parameter in pack.ps1 and build.ps1 to select which emulator artifacts to include.
  • Extend the C++ launcher (CmderLauncher.cpp) to detect and launch Windows Terminal, migrate config logic, and rename conEmu references to generic terminal.
  • Update CI workflow to produce and upload separate artifacts for each terminal type and adjust documentation and packaging rules.

Reviewed Changes

Copilot reviewed 11 out of 30 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
scripts/pack.ps1 Added $terminal param and conditional target sets; duplicate branch.
scripts/build.ps1 Added $terminal param, Windows Terminal backup/restore logic; used return inside loop.
packignore Include new config\user_* pattern.
launcher/src/strings.rc2 Updated switch help to include Windows Terminal flags.
launcher/src/resource.rc Adjusted #endif comment label.
launcher/src/CmderLauncher.cpp Renamed variables and added Windows Terminal detection/logic; scattered typos and grouping bug.
launcher/CmderLauncher.vcxproj Added icon image entry to project.
README.md Updated usage docs to use -- instead of /X.
Cmder.bat Dispatch to ConEmu or Windows Terminal based on existence.
CHANGELOG.md Added unreleased section documenting the new Windows Terminal support.
.github/workflows/build.yml Updated build steps to pass -terminal and upload new artifacts.

Comment on lines +59 to +63
} elseif ($terminal -eq "windows-terminal") {
$targets = @{
"cmder.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on -xr!`"vendor\windows-terminal`"";
"cmder.zip" = "-mm=Deflate -mfb=128 -mpass=3 -xr!`"vendor\windows-terminal`"";
"cmder_mini.zip" = "-xr!`"vendor\git-for-windows`" -xr!`"vendor\windows-terminal`"";
Copy link
Preview

Copilot AI Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch duplicates the previous elseif for windows-terminal. It looks like one should target conemu-maximus5 instead of repeating windows-terminal.

Suggested change
} elseif ($terminal -eq "windows-terminal") {
$targets = @{
"cmder.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on -xr!`"vendor\windows-terminal`"";
"cmder.zip" = "-mm=Deflate -mfb=128 -mpass=3 -xr!`"vendor\windows-terminal`"";
"cmder_mini.zip" = "-xr!`"vendor\git-for-windows`" -xr!`"vendor\windows-terminal`"";
} elseif ($terminal -eq "conemu-maximus5") {
$targets = @{
"cmder_conemu.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on -xr!`"vendor\windows-terminal`"";
"cmder_conemu.zip" = "-mm=Deflate -mfb=128 -mpass=3 -xr!`"vendor\windows-terminal`"";
"cmder_conemu_mini.zip" = "-xr!`"vendor\git-for-windows`" -xr!`"vendor\windows-terminal`"";

Copilot uses AI. Check for mistakes.

Comment on lines +142 to +146
return
} elseif ($s.name -eq "conemu-maximus5" -and $terminal -eq "windows-terminal") {
return
} elseif ($s.name -eq "windows-terminal" -and $terminal -eq "conemu-maximus5") {
return
Copy link
Preview

Copilot AI Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using return inside the foreach ($s in $sources) loop will exit the entire script. Replace return with continue to skip only the current source.

Suggested change
return
} elseif ($s.name -eq "conemu-maximus5" -and $terminal -eq "windows-terminal") {
return
} elseif ($s.name -eq "windows-terminal" -and $terminal -eq "conemu-maximus5") {
return
continue
} elseif ($s.name -eq "conemu-maximus5" -and $terminal -eq "windows-terminal") {
continue
} elseif ($s.name -eq "windows-terminal" -and $terminal -eq "conemu-maximus5") {
continue

Copilot uses AI. Check for mistakes.

MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_terminal_%COMPUTERNAME%_settings.json! Access Denied."
: L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_teerminal_%COMPUTERNAME%_settigns.json!", MB_TITLE, MB_ICONSTOP);
Copy link
Preview

Copilot AI Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typographical errors in this message: windows_teerminal should be windows_terminal, and settigns should be settings.

Suggested change
: L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_teerminal_%COMPUTERNAME%_settigns.json!", MB_TITLE, MB_ICONSTOP);
: L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_terminal_%COMPUTERNAME%_settings.json!", MB_TITLE, MB_ICONSTOP);

Copilot uses AI. Check for mistakes.

@@ -638,26 +853,26 @@ cmderOptions GetOption()
MessageBox(NULL, szArgList[i + 1], L"/START - Folder does not exist!", MB_OK);
}
}
else if (_wcsicmp(L"/task", szArgList[i]) == 0)
else if (_wcsicmp(L"/task", szArgList[i]) == 0 || PathFileExists(windowsTerminalDir) || PathFileExists(conEmuDir))
Copy link
Preview

Copilot AI Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The OR conditions will match whenever a terminal exists, not just on the /task flag. You likely want to group the checks as (_wcsicmp(...) == 0) && (PathFileExists(...) || ...) to avoid unintended matches.

Suggested change
else if (_wcsicmp(L"/task", szArgList[i]) == 0 || PathFileExists(windowsTerminalDir) || PathFileExists(conEmuDir))
else if (_wcsicmp(L"/task", szArgList[i]) == 0 && (PathFileExists(windowsTerminalDir) || PathFileExists(conEmuDir)))

Copilot uses AI. Check for mistakes.

@DRSDavidSoft DRSDavidSoft requested review from a team July 2, 2025 02:24
@DRSDavidSoft DRSDavidSoft marked this pull request as draft July 2, 2025 02:24
@DRSDavidSoft
Copy link
Contributor Author

@copilot Hmm, I appreciate the detailed review, I'll address the issues raised in a local branch.

@DRSDavidSoft DRSDavidSoft removed request for a team July 2, 2025 02:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants