-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
base: master
Are you sure you want to change the base?
Conversation
Sync with master
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`.
There was a problem hiding this 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 inpack.ps1
andbuild.ps1
to select which emulator artifacts to include. - Extend the C++ launcher (
CmderLauncher.cpp
) to detect and launch Windows Terminal, migrate config logic, and renameconEmu
references to genericterminal
. - 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. |
} 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`""; |
There was a problem hiding this comment.
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
.
} 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.
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 |
There was a problem hiding this comment.
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.
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); |
There was a problem hiding this comment.
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
.
: 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)) |
There was a problem hiding this comment.
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.
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.
@copilot Hmm, I appreciate the detailed review, I'll address the issues raised in a local branch. |
No description provided.