Compare commits

..

242 Commits

Author SHA1 Message Date
e52906ac9b Merge branch 'master' into development 2025-07-16 00:48:11 +00:00
05552dc51c added a comment 2025-07-16 04:18:03 +03:30
623bd52b7c Merge branch 'master' into development 2025-07-16 00:46:57 +00:00
c6bfd6f276 Minor refactors to Git status and branch functions in git-prompt.sh
- `getGitStatusSetting`: use local variables, improve regex pattern, use return status codes instead of echo strings
- `getSimpleGitBranch`: better error handling, use local variables
- Simplified conditional checks
2025-07-16 04:16:47 +03:30
cf97d7d4ec Merge branch 'master' into development 2025-07-15 17:32:20 +00:00
1d51c4f402 make bash prompt more consistent;
* display λ in grey and bold
* fix a bug where an uneeded colon would be prepended to the tab title (when MSYSTEM is unset)
2025-07-15 21:02:12 +03:30
bb14aeace5 merge with master 2025-07-15 20:37:45 +03:30
aff4ad259f fix color values and names mismatch in comments 2025-07-15 20:25:59 +03:30
76c5b9e116 resolve conflicts 2025-07-15 19:31:41 +03:30
cb76868411 Import from upstream git-prompt.sh: user-specific bash completion scripts
Source: 061dbfe92b
2025-07-15 19:29:16 +03:30
abcb1a1aa1 display MSYSTEM if set; fix indentation; add comment 2025-07-15 19:26:49 +03:30
aa156a2901 revert inadvertent changes 2025-04-08 20:50:27 +03:30
df42ff2d8c indentation cleanup and comment fix 2025-04-08 20:48:47 +03:30
2868f9ee92 revert inadvertent changes 2025-04-08 12:11:37 -04:00
8b004be391 Merge branch 'master' into development 2025-04-08 10:04:33 +00:00
93785426a6 Bump peter-evans/create-pull-request from 6 to 7
Hopefully, there won't be breaking changes
2025-04-08 13:34:23 +03:30
e3fc1a122d Merge branch 'master' into development 2025-04-08 09:17:41 +00:00
00763846a2 Updates to 3 vendored dependencies 2025-04-08 12:47:31 +03:30
a44b30c3eb Update build.yml 2025-04-03 17:17:01 -04:00
6d82cf897b fix build script 2025-04-03 20:34:34 +00:00
1737bcdeb7 ⬆️ Update dependencies (git-for-windows v2.49.0.windows.1, clink v1.7.14, clink-completions v0.6.2) 2025-04-03 13:43:06 +00:00
7ac805cda5 Merge pull request #2942 from daxgames/cmder4win
Cmder for Windows  - Add `Bash`, `Powershell`, `mintty`.
2025-03-09 08:56:35 -07:00
c1bbc462f3 Merge branch 'upstream-development' into cmder4win
* upstream-development:
  CHANGELOG.md
  CHANGELOG.md
2025-01-05 22:49:28 -05:00
15d56185b7 Merge pull request #2988 from daxgames/fix_launcher_overwrite-2
Development BUG - Fixes launcher overwriting or not backing up terminal emulator settings in development branch.
2025-01-05 19:24:54 -08:00
8683dad111 Remove /a switch and associated code. 2025-01-05 22:07:27 -05:00
d349f57e78 add executionpolicy bypass 2025-01-05 20:19:40 -05:00
b412036262 CHANGELOG.md 2025-01-05 19:52:28 -05:00
06349694f0 CHANGELOG.md 2025-01-05 19:46:59 -05:00
e0aa20a080 CHANGELOG.md 2025-01-05 19:38:45 -05:00
b00dce8ba8 Merge remote-tracking branch 'origin/cmder4win' into cmder4win
* 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
2025-01-05 19:29:49 -05:00
0c2e5ce1f2 CHANGELOG.md 2025-01-05 19:28:51 -05:00
bd3f1326f2 Merge branch 'origin-development-dax' into cmder4win 2025-01-05 13:08:38 -05:00
6cf4a42469 Merge pull request #24 from daxgames/fix_launcher_overwrite-2
Development BUG - Fixes launcher overwriting or not backing up terminal emulator settings in development branch.
2025-01-05 13:01:46 -05:00
980083fb8c Merge pull request #23 from daxgames/more_speed_2
Optimizations for improving speed
2025-01-05 12:15:45 -05:00
a1a6a02b04 Merge pull request #2825 from daxgames/more_speed_2
Optimizations for improving speed
2025-01-05 12:14:40 -05:00
74d7dd211f cleanup 2025-01-01 22:49:02 -05:00
05f616fd76 cleanup 2025-01-01 22:32:37 -05:00
9b5be7bd53 cleanup 2025-01-01 22:29:41 -05:00
36ea61930f not set 2025-01-01 22:27:10 -05:00
8ea276d9bd not set 2025-01-01 22:15:34 -05:00
ebce8479ef origin/fix_launcher_overwrite 2024-12-29 16:23:59 -05:00
6c95424124 Merge branch 'development' of https://github.com/cmderdev/cmder into development 2024-11-14 00:14:56 +03:30
b140db4617 Merge branch 'development' of https://github.com/cmderdev/cmder into development 2024-11-14 00:13:38 +03:30
5d0699a0ae Merge branch 'development' of https://github.com/cmderdev/cmder into development 2024-11-14 00:08:50 +03:30
d15e7ac69f cleanup 2024-11-14 00:08:31 +03:30
126347025f cleanup 2024-11-14 00:01:29 +03:30
7ceacb63dd respect PATHEXT instead of hardcoding our own value
* support other path extensions as well (e.g. `.py` commonly used)
2024-11-14 00:00:53 +03:30
510178852d add missing qualified dir
https://github.com/cmderdev/cmder/pull/1961
2024-11-13 23:58:11 +03:30
4d15730d05 cleanup 2024-11-13 23:14:49 +03:30
cc40343157 Merge branch 'master' into development 2024-11-13 19:38:51 +00:00
25ccfeed77 prevent warnings if the dir does not exist
https://github.com/cmderdev/cmder/issues/121#issuecomment-654171568
2024-11-13 23:08:13 +03:30
940cadc526 Merge branch 'master' into development 2024-10-17 23:48:28 +00:00
42315d8cec enable /d flag in excd by default 2024-10-18 03:18:17 +03:30
9b466e3963 merge changes from master 2024-10-17 20:03:45 +03:30
c6dbb89129 Merge branch 'master' of https://github.com/cmderdev/cmder 2024-10-17 20:00:32 +03:30
1cfba25beb fix conflict 2024-10-17 20:00:21 +03:30
2007baef6e Updates to 3 vendored dependencies 2024-10-17 19:52:36 +03:30
4740b836f3 adjust indentation and merge from main 2024-10-17 19:46:22 +03:30
e220d114b2 add notes on what shim actually is 2024-10-17 19:43:14 +03:30
4204faa063 ⬆️ Update dependencies (git-for-windows v2.47.0.windows.1, clink v1.7.3, clink-completions v0.6.0) 2024-10-16 13:42:04 +00:00
fbd4c0422c Merge branch 'master' into development 2024-10-14 11:10:56 +00:00
540532f126 make library comments consistent and clean up code 2024-10-14 14:40:21 +03:30
41195ad8dd Bump peter-evans/create-pull-request from 6 to 7
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6 to 7.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v6...v7)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 15:58:11 +00:00
ffa37d4d5c sync fix launcher overwrite 2024-08-22 11:42:12 +00:00
f4f6255c1a remove extra {} 2024-08-20 12:25:33 +00:00
82ab068f12 cleanup 2024-08-15 10:24:02 -04:00
e84f2ff365 Merge branch 'master' into development 2024-07-27 17:34:23 +00:00
28f6098d48 Merge pull request #2959 from stanwest/cmd-double-quotes
In "lib_git.cmd", use single quotes inside double quotes
2024-07-27 21:04:15 +03:30
b56a6d43cb Use single quotes inside double quotes 2024-07-26 20:24:12 -04:00
339e6b40fd Merge branch 'master' into development 2024-06-06 10:05:08 +00:00
d2f7136ef8 modify the header to remove outdated mention 2024-06-06 13:34:55 +03:30
2e945fb02b Fix launcher overwritting/backing up emulator settings 2024-05-31 18:31:16 -04:00
e457afa8d1 Merge branch 'master' into development 2024-05-31 15:06:45 +00:00
4daff054eb Fix #2944 2024-05-31 18:36:31 +03:30
f38e0b3e03 sync 2024-05-30 17:21:29 -04:00
167f57bc97 Merge branch 'upstream-development' into cmder4win 2024-05-30 17:13:15 -04:00
9120d92318 Merge pull request #2943 from daxgames/new_wt
Update to latest released Windows Terminal to allow launching shells as Administrator.
2024-05-30 17:08:58 -04:00
9463d4ebc4 update build workflow to upload cmder_win* 2024-05-30 17:03:37 -04:00
c5946422e7 update build workflow to upload cmder_win.zip 2024-05-30 16:42:48 -04:00
e850f8241d add vendor/start_git_mintty.cmd 2024-05-30 16:37:37 -04:00
db3889d5e5 remove vendor/start_git_mintty.cmd 2024-05-30 16:27:43 -04:00
881938ed18 Update Windows Terminal default settings and version 2024-05-30 16:23:51 -04:00
45fd0c2666 ⬆️ Update dependencies (git-for-windows v2.45.1.windows.1, clink v1.6.14, clink-completions v0.5.2) 2024-05-29 13:40:37 +00:00
546d921e58 Merge branch 'master' into development 2024-05-28 13:49:59 +00:00
5145a15139 display git improper version string as debug 2024-05-28 17:19:47 +03:30
92c662de2f Merge branch 'master' into development 2024-05-23 18:29:27 +00:00
92419a48fc log the executable path for improper git 2024-05-23 21:59:16 +03:30
aac7cfc47a Fix GitHub action (merge master into development) 2024-05-21 11:58:26 +03:30
c9b77f618a enable match.expand_envvars
This is part of the "Enhanced default settings" by Clink and a very useful feature
2024-05-20 10:57:51 +03:30
a2e4884ea1 Merge pull request #2926 from cmderdev/dependabot/github_actions/softprops/action-gh-release-2
Bump softprops/action-gh-release from 1 to 2
2024-04-26 17:09:24 +03:30
d68c5b4487 Merge pull request #2909 from cmderdev/master
sync development with master
2024-04-26 15:56:46 +03:30
62a46140eb Merge pull request #2932 from loselarry/master
fix: fix some typos in comments
2024-04-10 08:01:16 -04:00
ae518cded8 fix: fix some typos in comments
Signed-off-by: loselarry <bikangning@yeah.net>
2024-04-10 16:39:46 +08:00
4ad76d8274 Bump softprops/action-gh-release from 1 to 2
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 1 to 2.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v1...v2)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-11 15:59:16 +00:00
8a199bf47b Bump microsoft/setup-msbuild from 1 to 2 (#2917)
Bumps [microsoft/setup-msbuild](https://github.com/microsoft/setup-msbuild) from 1 to 2.
- [Release notes](https://github.com/microsoft/setup-msbuild/releases)
- [Changelog](https://github.com/microsoft/setup-msbuild/blob/main/building-release.md)
- [Commits](https://github.com/microsoft/setup-msbuild/compare/v1...v2)

---
updated-dependencies:
- dependency-name: microsoft/setup-msbuild
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-06 19:43:29 +00:00
457d99da0b Bump peter-evans/create-pull-request from 5 to 6 (#2918)
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 5 to 6.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v5...v6)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-06 19:43:13 +00:00
52762636dc Bump actions/upload-artifact from 3 to 4 (#2905) 2024-01-03 00:54:57 +00:00
ed6c9b2bc9 Merge pull request #2907 from daxgames/development_ci
Do CI on development PRs
2024-01-02 14:14:15 -05:00
7753622897 Do CI on development PRs 2024-01-02 12:04:31 -05:00
5814792bd6 Merge pull request #15 from daxgames/development-dax
development dax
2024-01-02 11:42:22 -05:00
1ed3a36812 Update windows_terminal_default_settings.json 2024-01-02 11:41:21 -05:00
c5579d2cab Add Monokai, Default to One Half Dark 2024-01-02 11:20:20 -05:00
131949bc77 Merge branch 'master' into development 2023-12-20 10:31:53 +00:00
18950135ef Bump github/codeql-action from 2 to 3 (#2906)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-20 10:31:41 +00:00
6e213115fe Merge branch 'more_speed_2' of https://github.com/daxgames/cmder into more_speed_2 2023-11-27 10:01:01 -05:00
28e9018ce0 make mintty /a work 2023-11-27 10:00:28 -05:00
38a91ded02 cleanup 2023-11-26 22:28:16 -05:00
47292038ef add mintty 2023-11-26 21:35:30 -05:00
d8238b0230 cleanup 2023-11-24 18:18:16 -05:00
0a691cb7ee Merge remote-tracking branch 'upstream/development' into development 2023-11-24 17:45:54 -05:00
7a385ebf75 cleanup 2023-11-24 16:28:44 -05:00
0f6c91d03a cleanup 2023-11-24 16:22:49 -05:00
2beb27d490 cleanup 2023-11-24 15:27:19 -05:00
a7f19f56e8 cleanup 2023-11-24 15:25:46 -05:00
3ff9737076 Merge remote-tracking branch 'origin/development' into development 2023-11-24 15:19:56 -05:00
467d564a7b cleanup 2023-11-24 15:19:49 -05:00
9ce6911b49 add bash and powershell to Cmder for Windows 2023-11-24 15:14:09 -05:00
e2303b11c0 add cmder slim (i.e. option for no bundled terminal) 2023-11-24 21:06:55 +03:30
5c101a0306 remove small typo 2023-11-24 21:04:16 +03:30
3c2a25af9f cleanup 2023-11-24 12:04:03 -05:00
99b4e66c47 add Cmder for win 2023-11-24 11:35:24 -05:00
67b62784c8 add cmder slim 2023-11-23 09:07:32 -05:00
016846d5cf Merge remote-tracking branch 'origin/windows_terminal' into development 2023-11-23 08:49:20 -05:00
30718ab32b Merge remote-tracking branch 'origin/windows_terminal' into windows_terminal 2023-11-23 07:22:29 -05:00
26e684fb38 PR - Requested Changes 2023-11-23 07:20:26 -05:00
08fd69bdef PR - Requested Changes 2023-11-23 07:16:42 -05:00
f8aa7feb1f PR - Requested Changes 2023-11-23 07:10:59 -05:00
f0c18f1fc6 Update Cmder.bat 2023-11-23 06:50:12 -05:00
e01a553ca5 Merge pull request #2897 from daxgames/windows_terminal
Applying the windows terminal branch to the development
2023-11-21 03:43:50 +03:30
8025b5baa2 Merge branch 'development' into windows_terminal 2023-11-21 03:43:31 +03:30
9a4041941e Merge pull request #2896 from daxgames/more_speed_2
Applying the more speed branch to the development
2023-11-21 03:41:20 +03:30
86091b74e9 properly set CMDER_ROOT for windows terminal bash 2023-11-11 17:29:28 -08:00
f69e6226e5 Merge branch 'master' into development 2023-11-11 17:19:02 +00:00
b59647b570 Merge pull request #2892 from daxgames/revert_git_update
Revert Git update so not to include a release Candidate
2023-11-11 09:18:48 -08:00
2135fce19f revert git update to not include a release candidate 2023-11-11 09:12:30 -08:00
01c41a9268 Merge branch 'master' into more_speed_2 2023-11-10 18:21:11 -08:00
2ab6bcd72c cleanup 2023-11-10 17:57:46 -08:00
678b482269 Merge branch 'master' into windows_terminal 2023-11-10 17:02:47 -08:00
219c879582 Merge remote-tracking branch 'upstream/master' 2023-11-10 17:00:16 -08:00
289bcf03a5 Merge remote-tracking branch 'upstream/development' 2023-11-10 16:59:35 -08:00
9c834b60a3 Merge branch 'master' into development 2023-11-09 13:41:56 +00:00
50bc05fee7 Merge pull request #2891 from daxgames/rem_race
Remove Cmder.exe race condition
2023-11-09 17:11:42 +03:30
8d916a4446 remove env refresh race condition 2023-11-09 04:58:26 -08:00
90d86a7e5e add vendor/bin/create-cmdercfg.cmd 2023-11-06 09:55:49 -05:00
5e22496aca Merge branch 'master' into development 2023-11-05 18:55:47 +00:00
8b6add75cf Merge pull request #2882 from cmderdev/update-vendor
Updates to `2` vendored dependencies
2023-11-05 13:55:36 -05:00
8498447878 ⬆️ Update dependencies (git-for-windows v2.43.0-rc0.windows.1, clink v1.5.12) 2023-11-03 13:40:42 +00:00
0874f4be44 Merge branch 'master' into development 2023-10-25 09:02:45 +00:00
ffb93b1804 call init.bat with the same arguments 2023-10-25 12:32:31 +03:30
092dc4d323 Merge branch 'master' into development 2023-10-14 18:20:25 +00:00
39afad1743 Merge pull request #2879 from cmderdev/update-vendor
Updates to `2` vendored dependencies
2023-10-14 11:20:13 -07:00
d0cb6b5c23 ⬆️ Update dependencies (clink v1.5.9, clink-completions v0.4.11) 2023-10-10 13:40:41 +00:00
43a5e7e0b1 PR Review requested changes 2023-09-26 11:24:34 -04:00
ddad83c70f PR Review requested changes 2023-09-26 11:17:16 -04:00
01da2fe638 turn off /t in windows terminal defaults 2023-09-25 16:30:41 -04:00
58db4e3419 pack and build all 2023-09-25 16:13:38 -04:00
3cc22ca764 pack and build all 2023-09-25 16:12:52 -04:00
3671a6e13c pack and build all 2023-09-25 16:09:47 -04:00
ad21915919 Add pack code for windows terminal 2023-09-25 15:59:10 -04:00
ab10e83d95 sync and add windows terminal to sources. 2023-09-25 14:47:20 -04:00
cb543528af Merge branch 'master' of https://github.com/cmderdev/cmder into windows_terminal 2023-09-25 14:41:09 -04:00
9ee2bef7cd Merge branch 'master' into development 2023-09-25 18:41:04 +00:00
a409a1cce8 Merge pull request #2867 from cmderdev/update-vendor
Updates to `2` vendored dependencies
2023-09-25 14:40:50 -04:00
e24f653d24 add pack code for windows terminal releases 2023-09-25 14:26:53 -04:00
8bb2c5d587 Update Cmder command line help 2023-09-25 14:10:05 -04:00
7d3e691a69 add start_git_bash.cmd 2023-09-25 14:04:12 -04:00
7fa041dd7f fix 2023-09-25 12:13:42 -04:00
63bab369cf fix 2023-09-25 12:06:24 -04:00
759d0edd81 fix 2023-09-25 12:02:57 -04:00
7db6297347 fix 2023-09-25 11:57:33 -04:00
19fe75cbbe Merge branch 'master' into windows_terminal 2023-09-25 11:45:49 -04:00
3b8e87de84 Merge branch 'master' of https://github.com/cmderdev/cmder 2023-09-25 11:45:19 -04:00
2728f36302 fix 2023-09-25 11:44:09 -04:00
74c183c2a7 Add initial Windows Terminal support 2023-09-25 11:26:42 -04:00
d75ba7bce2 Merge branch 'master' of https://github.com/cmderdev/cmder into windows_terminal 2023-09-25 11:15:06 -04:00
968beb8a27 Add initial Windows Terminal support 2023-09-25 11:14:54 -04:00
7c04ee9f6a fixes 2023-09-22 17:15:23 -04:00
94ea2da567 make it work with windows terminal 2023-09-22 17:07:56 -04:00
faf66542b4 ⬆️ Update dependencies (git-for-windows v2.42.0.windows.2, clink v1.5.6) 2023-09-22 13:40:52 +00:00
d3497f5eb0 Merge branch 'master' into development 2023-09-21 17:28:35 +00:00
98a1e9621e Bump actions/checkout from 3 to 4 2023-09-21 20:58:21 +03:30
4f32d23c30 Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-04 15:47:52 +00:00
e52fa81fbb Merge branch 'more_speed_2' of https://github.com/daxgames/cmder into more_speed_2 2023-08-11 10:45:03 -04:00
6b330b81f2 allow launching windows terminal w/cmder from cmder 2023-08-11 10:44:33 -04:00
bd857bae2d Merge remote-tracking branch 'origin/more_speed_2' into more_speed_2 2023-08-11 09:32:20 -04:00
52e1a02224 Merge remote-tracking branch 'upstream/master' into more_speed_2 2023-08-11 09:31:47 -04:00
ad5c80bcd2 Merge remote-tracking branch 'upstream/master' 2023-08-11 09:31:24 -04:00
9b446b31d5 Merge remote-tracking branch 'upstream/master' into more_speed_2 2023-07-28 09:53:34 -04:00
9a135947af Merge branch 'master' into development 2023-07-27 21:28:50 +00:00
1b9a1e5b6f improve markdown (SECURITY.md)
use bullet points to render the list correctly; improve sentences
2023-07-28 00:58:39 +03:30
1adaab963b Merge branch 'master' into development 2023-07-27 18:32:18 +00:00
29650960aa Create SECURITY.md (#2866) 2023-07-27 19:32:04 +01:00
41f0454b05 Merge branch 'master' into development 2023-07-25 13:48:37 +00:00
3ea9728ffd Merge pull request #2861 from chrisant996/chrisant_fix_2859
Fix #2859; script error when cwd name contains `%`
2023-07-25 17:18:22 +03:30
a01fb4c444 Merge branch 'master' into development 2023-07-25 10:17:37 +00:00
4b0344172a ignore github-related and markdown for tests and codeql 2023-07-25 13:47:22 +03:30
b47cf43d4c Merge pull request #14 from cmderdev/master
Sync with master
2023-07-24 20:45:28 -04:00
4104a5612f Merge branch 'master' into development 2023-07-24 14:04:30 +00:00
5e219fe34e Update build.yml 2023-07-24 15:04:16 +01:00
ff7621c1da Merge branch 'master' into development 2023-07-24 13:56:12 +00:00
5d4c45d099 Merge branch 'master' into development 2023-07-24 08:30:03 +00:00
f517494dc4 Merge branch 'master' into development 2023-07-20 12:57:05 +00:00
84ee96c64f Fix #2859; script error when cwd name contains %
The `string.gsub()` function in Lua always uses Lua patterns (which are
similar to regular expressions).  Cmder's custom prompt wants to perform
simple plain text find/replace operations on strings.  `string.gsub()`
is the right Lua function for that, but since it always uses Lua
patterns it's necessary to apply escaping to the input strings otherwise
they can get misinterpreted and cause runtime errors.

For example, if the current working directory name contains a percent
sign, such as literally "My%20Home".

This change fixes that.  It introduces a helper function `gsub_plain()`
which behaves like `string.gsub()` but applies appropriate escaping to
convert the plain text input strings into the corresponding Lua
patterns so that it can achieve plain text find/replace operations.

It also introduces separate helper functions for escaping the `find` and
`replace` parameters for `string.gsub()`, since they have different
escaping rules.
2023-07-10 18:07:53 -07:00
4129084494 add comment to clink.lua explaining /c [folderpath] 2023-07-08 13:09:10 -07:00
ad804eda44 Merge remote-tracking branch 'upstream/master' 2023-07-04 13:01:27 -04:00
3ced7a2a1b '.gitignore 2023-07-04 11:07:33 -04:00
5311b25d9f Merge remote-tracking branch 'upstream/master' into more_speed_2 2023-07-04 11:03:08 -04:00
15addb87ee Merge branch 'master' into development 2023-07-04 08:40:45 +00:00
cd92c9fa74 cleanup 2023-07-03 17:51:02 -04:00
3ca03795d3 sync 2023-07-03 16:36:57 -04:00
294f85e33c fixes 2023-07-03 16:23:45 -04:00
4bf659833c fix multiuser user_init.cmd creation 2023-07-03 16:19:07 -04:00
ea0a9bb062 Merge branch 'master' into more_speed_2 2023-06-05 16:02:12 -04:00
47258fbd2b Merge branch 'master' of https://github.com/cmderdev/cmder 2023-06-05 16:01:37 -04:00
86b9fb25ab Add ability to launch git bash from external Installed git whwen using Cmder - Mini 2023-06-05 13:22:28 -04:00
7b55dab79e Merge remote-tracking branch 'upstream/master' into more_speed_2 2023-05-30 11:18:38 -04:00
dac3090881 Merge remote-tracking branch 'origin/more_speed_2' into more_speed_2 2023-05-30 11:18:00 -04:00
b2135cd0a9 don't error if vim slias exists 2023-05-30 11:15:04 -04:00
37c41e80df Merge branch 'master' into development 2023-05-23 10:57:06 +00:00
9a851da2cf Merge remote-tracking branch 'upstream/master' into more_speed_2 2023-05-18 12:28:03 -04:00
5a90558714 Merge branch 'master' into development 2023-05-17 08:00:29 +00:00
c1f8dfdb27 Merge branch 'master' into development 2023-05-16 20:22:11 +00:00
50c3ea4ab3 Merge branch 'master' into development 2023-05-11 15:07:20 +00:00
b46f7262e6 Merge branch 'master' into more_speed_2 2023-05-08 10:29:04 -04:00
3f53d1b927 Merge branch 'master' into development 2023-04-24 14:05:13 +00:00
6180aa53b3 Merge branch 'master' into development 2023-04-23 20:17:40 +00:00
5e3b70338d Merge pull request #12 from daxgames/update-vendor
Updates to `3` vendored dependencies
2023-04-21 16:06:26 -04:00
a4ea326a62 ⬆️ Update dependencies (git-for-windows v2.40.0.windows.1, clink v1.4.24, clink-completions v0.4.7) 2023-04-19 13:44:11 +00:00
42568b7316 Document '--' command line argument 2023-03-12 13:02:08 -07:00
f08ad62e39 Merge branch 'master' of https://github.com/cmderdev/cmder into more_speed_2 2023-03-11 14:59:26 -08:00
c4d9365584 x 2023-03-11 14:59:12 -08:00
e0b694324c add bypass 2023-03-05 15:00:11 -08:00
f1e2fb5697 prevent timer results every time. 2023-02-26 18:00:26 -08:00
615ba5f816 Delete user_init.optional.cmd 2023-02-18 05:57:12 -08:00
9cbc1845fb cleanup 2023-02-18 05:56:09 -08:00
3a2e747d22 add cleanup of unused env vars 2023-02-18 05:40:46 -08:00
1e623ecab4 auto generate cmd user_init.cmd 2023-02-12 09:48:27 -08:00
02154a8f88 Update to only collext cmder env vars 2023-02-12 09:46:16 -08:00
727a99b479 shared or user user_init.cmd 2023-02-11 19:27:15 -08:00
7e50f50863 add vendor/user_init.optional.cmd 2023-02-11 18:57:50 -08:00
56f45a81ca add debugging of path adds 2023-02-11 18:57:27 -08:00
274cce1f00 optimize for speed 2023-02-10 19:19:50 -08:00
43 changed files with 1844 additions and 414 deletions

View File

@ -19,7 +19,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out the repository under $GITHUB_WORKSPACE, so the job can access it
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all history for all branches and tags

View File

@ -11,7 +11,7 @@ on:
tags:
- "v*"
pull_request:
branches: [ "master" ]
branches: [ "master", "development" ]
#---------------------------------#
# environment configuration #
@ -30,58 +30,103 @@ jobs:
build:
name: Build Project
runs-on: windows-latest
permissions:
contents: write
discussions: write
steps:
- name: Check out repository code (Action from GitHub)
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1
uses: microsoft/setup-msbuild@v2
- name: Build Cmder Launcher
shell: pwsh
working-directory: scripts
run: .\build.ps1 -Compile -verbose
run: .\build.ps1 -Compile -verbose -terminal all
- name: Pack the built files
shell: pwsh
working-directory: scripts
run: .\pack.ps1 -verbose
run: .\pack.ps1 -verbose -terminal all
- name: Upload artifact (cmder_win_mini.zip)
uses: actions/upload-artifact@v4
with:
path: build/cmder_win_mini.zip
name: cmder_win_mini.zip
if-no-files-found: error
- name: Upload artifact (cmder_win.7z)
uses: actions/upload-artifact@v4
with:
path: build/cmder_win.7z
name: cmder_win.7z
if-no-files-found: error
- name: Upload artifact (cmder_win.zip)
uses: actions/upload-artifact@v4
with:
path: build/cmder_win.zip
name: cmder_win.zip
if-no-files-found: error
- name: Upload artifact (cmder_wt.zip)
uses: actions/upload-artifact@v4
with:
path: build/cmder_wt.zip
name: cmder_wt.zip
if-no-files-found: error
- name: Upload artifact (cmder_wt.7z)
uses: actions/upload-artifact@v4
with:
path: build/cmder_wt.7z
name: cmder_wt.7z
- name: Upload artifact (cmder_wt_mini.zip)
uses: actions/upload-artifact@v4
with:
path: build/cmder_wt_mini.zip
name: cmder_wt_mini.zip
- name: Upload artifact (cmder.zip)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: build/cmder.zip
name: cmder.zip
if-no-files-found: error
- name: Upload artifact (cmder.7z)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: build/cmder.7z
name: cmder.7z
- name: Upload artifact (cmder_mini.zip)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: build/cmder_mini.zip
name: cmder_mini.zip
- name: Upload artifact (hashes.txt)
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: build/hashes.txt
name: hashes.txt
- name: Create Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: |
build/cmder.zip
build/cmder_wt.zip
build/cmder.7z
build/cmder_wt.7z
build/cmder_mini.zip
build/cmder_wt_mini.zip
build/hashes.txt
draft: true
generate_release_notes: true

View File

@ -3,20 +3,25 @@
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
on:
push:
branches: [ "master" ]
branches: [ "master", "development" ]
paths-ignore:
- '**/*.md'
- '**/*.txt'
- '.github/**'
- '**/.gitignore'
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
branches: [ "master", "development" ]
paths-ignore:
- '**/*.md'
- '**/*.txt'
- '.github/**'
- '**/.gitignore'
schedule:
- cron: '30 19 * * 0'
@ -40,11 +45,11 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@ -55,7 +60,7 @@ jobs:
# queries: security-extended,security-and-quality
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1
uses: microsoft/setup-msbuild@v2
- name: Build Cmder Launcher
shell: pwsh
@ -63,6 +68,6 @@ jobs:
run: .\build.ps1 -Compile -verbose
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

View File

@ -4,9 +4,21 @@ on:
push:
branches:
- master
- development
paths-ignore:
- '**/*.md'
- '**/*.txt'
- '.github/**'
- '**/.gitignore'
pull_request:
branches:
- master
- development
paths-ignore:
- '**/*.md'
- '**/*.txt'
- '.github/**'
- '**/.gitignore'
defaults:
run:
@ -26,7 +38,7 @@ jobs:
continue-on-error: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Initialize vendors
shell: pwsh
working-directory: scripts

View File

@ -24,7 +24,7 @@ jobs:
pull-requests: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
@ -51,7 +51,7 @@ jobs:
Set-GHVariable -Name LIST_UPDATED -Value $listUpdated.Trim(', ')
echo "UPDATE_MESSAGE<<<EOF`n$updateMessage`n<EOF" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- uses: peter-evans/create-pull-request@v5
- uses: peter-evans/create-pull-request@v7
if: env.COUNT_UPDATED > 0
with:
title: 'Updates to `${{ env.COUNT_UPDATED }}` vendored dependencies'

7
.gitignore vendored
View File

@ -31,3 +31,10 @@ launcher/src/version.rc2
.vs/*
.vscode
.idea
.vagrant/
scripts/packer/iso/*.iso
!scripts/packer/floppy/*.exe
scripts/packer/packer_cache
scripts/packer/output-*
*.box

View File

@ -1,5 +1,17 @@
# Change Log
## Unreleased
### Fixes
- Fixes #2940
### Adds
- Cmder for Windows
- Uses Windows and Git for Windows Native Terminals.
- Does not contain a terminal emulator like ConEmu or Windows Terminal.
## [1.3.20](https://github.com/cmderdev/cmder/tree/v1.3.20) (2022-03-18)
### Changes

View File

@ -1,20 +1,66 @@
@echo off
SET CMDER_ROOT=%~dp0
set CMDER_TERMINAL=conemu
if exist "%CMDER_ROOT%\vendor\windows-terminal\windowsterminal.exe" (
SET CMDER_TERMINAL=windows-terminal
)
if NOT "%~1" == "" (
SET CMDER_TERMINAL=%~1
shift
)
:: Remove Trailing '\'
@if "%CMDER_ROOT:~-1%" == "\" SET CMDER_ROOT=%CMDER_ROOT:~0,-1%
if "%CMDER_ROOT:~-1%" == "\" SET CMDER_ROOT=%CMDER_ROOT:~0,-1%
if not exist "%CMDER_ROOT%\config" md "%CMDER_ROOT%\config" 2>nul
call :%CMDER_TERMINAL%
exit /b
:conemu
if not exist "%CMDER_ROOT%\config\user_ConEmu.xml" (
copy "%CMDER_ROOT%\vendor\ConEmu.xml.default" "%CMDER_ROOT%\config\user_ConEmu.xml" 1>nul
if %errorlevel% neq 0 (
echo ERROR: CMDER Initialization has Failed
exit /b 1
)
)
if exist "%~1" (
start %cmder_root%\vendor\conemu-maximus5\ConEmu.exe /Icon "%CMDER_ROOT%\icons\cmder.ico" /Title Cmder /LoadCfgFile "%~1"
) else (
start %cmder_root%\vendor\conemu-maximus5\ConEmu.exe /Icon "%CMDER_ROOT%\icons\cmder.ico" /Title Cmder /LoadCfgFile "%CMDER_ROOT%\config\user_ConEmu.xml"
)
exit /b
:windows-terminal
if not exist "%CMDER_ROOT%\vendor\windows-terminal\settings" md "%CMDER_ROOT%\vendor\windows-terminal\settings" 2>nul
if not exist "%CMDER_ROOT%\vendor\windows-terminal\.portable" echo "This makes this installation of Windows Terminal portable" >"%CMDER_ROOT%\vendor\windows-terminal\.portable" 2>nul
if exist "%CMDER_ROOT%\config\user_windows_terminal_settings.json" (
if not exist "%CMDER_ROOT%\vendor\windows-terminal\settings\settings.json" (
echo "Copying user Windows Terminal settings to '%CMDER_ROOT%\vendor\windows-terminal\settings\settings.json'..."
copy "%CMDER_ROOT%\config\user_windows_terminal_settings.json" "%CMDER_ROOT%\vendor\windows-terminal\settings\settings.json" 1>nul
)
) else if not exist "%CMDER_ROOT%\config\user_windows_terminal_settings.json" (
if not exist "%CMDER_ROOT%\config" mkdir "%CMDER_ROOT%\config" 2>nul
echo "Copying default Windows Terminal settings to '%CMDER_ROOT%\config'..."
copy "%CMDER_ROOT%\vendor\windows_terminal_default_settings.json" "%CMDER_ROOT%\config\user_windows_terminal_settings.json" 1>nul
echo "Copying default Windows Terminal settings to '%CMDER_ROOT%\vendor\windows-terminal\settings\settings.json'..."
copy "%CMDER_ROOT%\vendor\windows_terminal_default_settings.json" "%CMDER_ROOT%\vendor\windows-terminal\settings\settings.json" 1>nul
if %errorlevel% neq 0 (
echo ERROR: CMDER Initialization has Failed
exit /b 1
)
) else if exist "%cmder_root%\vendor\windows-terminal\settings\settings.json" (
copy "%cmder_root%\vendor\windows-terminal\settings\settings.json" "%CMDER_ROOT%\config\user_windows_terminal_settings.json"
)
start %cmder_root%\vendor\windows-terminal\windowsterminal.exe
exit /b
if not exist "%CMDER_ROOT%\config\user_ConEmu.xml" (
if not exist "%CMDER_ROOT%\config" mkdir "%CMDER_ROOT%\config" 2>nul
copy "%CMDER_ROOT%\vendor\ConEmu.xml.default" "%CMDER_ROOT%\config\user_ConEmu.xml" 1>nul
if %errorlevel% neq 0 (
echo ERROR: CMDER Initialization has Failed
exit /b 1
)
)
if exist "%~1" (
start %~dp0/vendor/conemu-maximus5/ConEmu.exe /Icon "%CMDER_ROOT%\icons\cmder.ico" /Title Cmder /LoadCfgFile "%~1"
) else (
start %~dp0/vendor/conemu-maximus5/ConEmu.exe /Icon "%CMDER_ROOT%\icons\cmder.ico" /Title Cmder /LoadCfgFile "%CMDER_ROOT%\config\user_ConEmu.xml"
)

View File

@ -60,7 +60,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]` | Forwards parameters to ConEmu |
| `-- [ConEmu extras pars]` | Forwards ALL remaining parameters to ConEmu. |
## Context Menu Integration

24
SECURITY.md Normal file
View File

@ -0,0 +1,24 @@
# Security Policy
## Supported Versions
| Version | Supported |
| ------- | ------------------ |
| 1.3.x | :white_check_mark: |
| < 1.3 | |
## Reporting a Vulnerability
If you discover a security issue in our project, please report it to [MartiUK](https://github.com/MartiUK). We will acknowledge your email within 24 hours and provide a more detailed response within 48 hours. We will try to fix the issue as soon as possible and inform you when a new version is released.
Please include as much of the information listed below as you can to help us better understand and resolve the issue:
- The nature of the issue
- The affected source file(s) with full paths
- The location of the vulnerable code (tag/branch/commit or direct URL)
- Any special configuration needed to reproduce the issue
- Detailed steps to reproduce the issue
- Proof-of-concept or exploit code (if possible)
- The impact of the issue, including how an attacker could exploit it
Please do not disclose the vulnerability publicly until we have resolved it.

View File

@ -188,6 +188,9 @@
<ItemGroup>
<ClCompile Include="src\CmderLauncher.cpp" />
</ItemGroup>
<ItemGroup>
<Image Include="..\icons\cmder.ico" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>

View File

@ -107,9 +107,9 @@ bool FileExists(const wchar_t * filePath)
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"")
{
#if USE_TASKBAR_API
wchar_t appId[MAX_PATH] = { 0 };
#endif
#if USE_TASKBAR_API
wchar_t appId[MAX_PATH] = { 0 };
#endif
wchar_t exeDir[MAX_PATH] = { 0 };
wchar_t icoPath[MAX_PATH] = { 0 };
wchar_t cfgPath[MAX_PATH] = { 0 };
@ -117,7 +117,7 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
wchar_t cpuCfgPath[MAX_PATH] = { 0 };
wchar_t userCfgPath[MAX_PATH] = { 0 };
wchar_t defaultCfgPath[MAX_PATH] = { 0 };
wchar_t conEmuPath[MAX_PATH] = { 0 };
wchar_t terminalPath[MAX_PATH] = { 0 };
wchar_t configDirPath[MAX_PATH] = { 0 };
wchar_t userConfigDirPath[MAX_PATH] = { 0 };
wchar_t userBinDirPath[MAX_PATH] = { 0 };
@ -128,21 +128,34 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
wchar_t legacyUserAliasesPath[MAX_PATH] = { 0 };
wchar_t args[MAX_PATH * 2 + 256] = { 0 };
wchar_t userConEmuCfgPath[MAX_PATH] = { 0 };
wchar_t windowsTerminalDir[MAX_PATH] = { 0 };
wchar_t conEmuDir[MAX_PATH] = { 0 };
wchar_t winDir[MAX_PATH] = { 0 };
wchar_t vendorDir[MAX_PATH] = { 0 };
wchar_t initCmd[MAX_PATH] = { 0 };
wchar_t initPowerShell[MAX_PATH] = { 0 };
wchar_t initBash[MAX_PATH] = { 0 };
wchar_t initMintty[MAX_PATH] = { 0 };
wchar_t vendoredGit[MAX_PATH] = { 0 };
wchar_t amdx64Git[MAX_PATH] = { 0 };
wchar_t x86Git[MAX_PATH] = { 0 };
wchar_t programFiles[MAX_PATH] = { 0 };
wchar_t programFilesX86[MAX_PATH] = { 0 };
wchar_t minTTYPath[MAX_PATH] = { 0 };
std::wstring cmderStart = path;
std::wstring cmderTask = taskName;
std::wstring cmderTitle = title;
std::wstring cmderConEmuArgs = conemu_args;
std::wstring cmderTerminalArgs = conemu_args;
std::copy(cfgRoot.begin(), cfgRoot.end(), userConfigDirPath);
userConfigDirPath[cfgRoot.length()] = 0;
GetModuleFileName(NULL, exeDir, sizeof(exeDir));
#if USE_TASKBAR_API
wcscpy_s(appId, exeDir);
#endif
#if USE_TASKBAR_API
wcscpy_s(appId, exeDir);
#endif
PathRemoveFileSpec(exeDir);
@ -166,8 +179,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
{
PathCombine(userProfilePath, configDirPath, L"user_profile.cmd");
char *lPr = (char *)malloc(MAX_PATH);
char *pR = (char *)malloc(MAX_PATH);
char* lPr = (char*)malloc(MAX_PATH);
char* pR = (char*)malloc(MAX_PATH);
size_t i;
wcstombs_s(&i, lPr, (size_t)MAX_PATH,
legacyUserProfilePath, (size_t)MAX_PATH);
@ -184,8 +197,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
{
PathCombine(userAliasesPath, configDirPath, L"user_aliases.cmd");
char *lPr = (char *)malloc(MAX_PATH);
char *pR = (char *)malloc(MAX_PATH);
char* lPr = (char*)malloc(MAX_PATH);
char* pR = (char*)malloc(MAX_PATH);
size_t i;
wcstombs_s(&i, lPr, (size_t)MAX_PATH,
legacyUserAliasesPath, (size_t)MAX_PATH);
@ -222,8 +235,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
{
PathCombine(userProfilePath, userConfigDirPath, L"user_profile.cmd");
char *lPr = (char *)malloc(MAX_PATH);
char *pR = (char *)malloc(MAX_PATH);
char* lPr = (char*)malloc(MAX_PATH);
char* pR = (char*)malloc(MAX_PATH);
size_t i;
wcstombs_s(&i, lPr, (size_t)MAX_PATH,
legacyUserProfilePath, (size_t)MAX_PATH);
@ -240,8 +253,8 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
{
PathCombine(userAliasesPath, userConfigDirPath, L"user_aliases.cmd");
char *lPr = (char *)malloc(MAX_PATH);
char *pR = (char *)malloc(MAX_PATH);
char* lPr = (char*)malloc(MAX_PATH);
char* pR = (char*)malloc(MAX_PATH);
size_t i;
wcstombs_s(&i, lPr, (size_t)MAX_PATH,
legacyUserAliasesPath, (size_t)MAX_PATH);
@ -251,71 +264,158 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
}
}
// Set path to vendored ConEmu config file
PathCombine(cfgPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu.xml");
PathCombine(vendorDir, exeDir, L"vendor");
PathCombine(windowsTerminalDir, vendorDir, L"windows-terminal");
PathCombine(conEmuDir, vendorDir, L"conemu-maximus5");
GetEnvironmentVariable(L"WINDIR", winDir, MAX_PATH);
// Set path to Cmder default ConEmu config file
PathCombine(defaultCfgPath, exeDir, L"vendor\\ConEmu.xml.default");
if (PathFileExists(windowsTerminalDir))
{
// Set path to vendored ConEmu config file
PathCombine(cfgPath, windowsTerminalDir, L"settings\\settings.json");
// Check for machine-specific then user config source file.
PathCombine(cpuCfgPath, userConfigDirPath, L"ConEmu-%COMPUTERNAME%.xml");
ExpandEnvironmentStrings(cpuCfgPath, cpuCfgPath, sizeof(cpuCfgPath) / sizeof(cpuCfgPath[0]));
// Set path to Cmder default ConEmu config file
PathCombine(defaultCfgPath, exeDir, L"vendor\\windows_terminal_default_settings.json");
// Set path to Cmder user ConEmu config file
PathCombine(userCfgPath, userConfigDirPath, L"user-ConEmu.xml");
// Check for machine-specific then user config source file.
PathCombine(cpuCfgPath, userConfigDirPath, L"windows_terminal_%COMPUTERNAME%_settings.json");
ExpandEnvironmentStrings(cpuCfgPath, cpuCfgPath, sizeof(cpuCfgPath) / sizeof(cpuCfgPath[0]));
if ( PathFileExists(cpuCfgPath) || use_user_cfg == false ) // config/ConEmu-%COMPUTERNAME%.xml file exists or /m was specified on command line, use machine specific config.
// Set path to Cmder user ConEmu config file
PathCombine(userCfgPath, userConfigDirPath, L"user_windows_terminal_settings.json");
}
else if (PathFileExists(conEmuDir))
{
// Set path to vendored ConEmu config file
PathCombine(cfgPath, conEmuDir, L"ConEmu.xml");
// Set path to Cmder default ConEmu config file
PathCombine(defaultCfgPath, exeDir, L"vendor\\ConEmu.xml.default");
// Check for machine-specific then user config source file.
PathCombine(cpuCfgPath, userConfigDirPath, L"ConEmu-%COMPUTERNAME%.xml");
ExpandEnvironmentStrings(cpuCfgPath, cpuCfgPath, sizeof(cpuCfgPath) / sizeof(cpuCfgPath[0]));
// Set path to Cmder user ConEmu config file
PathCombine(userCfgPath, userConfigDirPath, L"user-ConEmu.xml");
}
if (wcscmp(cpuCfgPath, L"") != 0 && (PathFileExists(cpuCfgPath) || use_user_cfg == false)) // config/[host specific terminal emulator config] file exists or /m was specified on command line, use machine specific config.
{
if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
{
if (PathFileExists(cfgPath)) // vendor/conemu-maximus5/ConEmu.xml file exists, copy vendor/conemu-maximus5/ConEmu.xml to config/ConEmu-%COMPUTERNAME%.xml.
if (PathFileExists(cfgPath)) // [terminal emulator config] file exists, copy [terminal emulator config] to config/user_[terminal emulator config] file to backup any settings changes from previous sessions.
{
if (!CopyFile(cfgPath, cpuCfgPath, FALSE))
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml! Access Denied."
: L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml!", MB_TITLE, MB_ICONSTOP);
exit(1);
if (PathFileExists(windowsTerminalDir)) {
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);
exit(1);
}
else if (PathFileExists(conEmuDir))
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml! Access Denied."
: L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml!", MB_TITLE, MB_ICONSTOP);
exit(1);
}
}
}
else // vendor/conemu-maximus5/ConEmu.xml config file does not exist, copy config/ConEmu-%COMPUTERNAME%.xml to vendor/conemu-maximus5/ConEmu.xml file
else // [terminal emulator config] file does not exist, copy config/[host specific terminal emulator config] file to [terminal emulator config] file
{
if (!CopyFile(cpuCfgPath, cfgPath, FALSE))
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy config/ConEmu-%COMPUTERNAME%.xml file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
: L"Failed to copy config/ConEmu-%COMPUTERNAME%.xml file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
exit(1);
if (PathFileExists(windowsTerminalDir)) {
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy config/windows_terminal_%COMPUTERNAME%_settings.json file to vendor/windows-terminal/settings/settings.json! Access Denied."
: L"Failed to copy config/windows_terminal_%COMPUTERNAME%_settings.json file to vendor/windows-terminal/settings/settings.json!", MB_TITLE, MB_ICONSTOP);
exit(1);
}
else if (PathFileExists(conEmuDir))
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy config/ConEmu-%COMPUTERNAME%.xml file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
: L"Failed to copy config/ConEmu-%COMPUTERNAME%.xml file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
exit(1);
}
}
}
}
else // '/c [path]' was specified, don't copy anything and use existing conemu-%COMPUTERNAME%.xml to start comemu.
{
if (use_user_cfg == false && PathFileExists(cfgPath) && !PathFileExists(cpuCfgPath)) // vendor/conemu-maximus5/ConEmu.xml file exists, copy vendor/conemu-maximus5/ConEmu.xml to config/ConEmu-%COMPUTERNAME%.xml.
{
if (!CopyFile(cfgPath, cpuCfgPath, FALSE))
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml! Access Denied."
: L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml!", MB_TITLE, MB_ICONSTOP);
exit(1);
}
}
PathCombine(userConEmuCfgPath, userConfigDirPath, L"ConEmu-%COMPUTERNAME%.xml");
ExpandEnvironmentStrings(userConEmuCfgPath, userConEmuCfgPath, sizeof(userConEmuCfgPath) / sizeof(userConEmuCfgPath[0]));
}
}
else if (PathFileExists(userCfgPath)) // config/user_conemu.xml exists, use it.
else if (wcscmp(userCfgPath, L"") != 0 && PathFileExists(userCfgPath)) // config/user[terminal emulator config] file exists, use it.
{
if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
{
if (PathFileExists(cfgPath)) // vendor/conemu-maximus5/ConEmu.xml exists, copy vendor/conemu-maximus5/ConEmu.xml to config/user_conemu.xml.
if (PathFileExists(cfgPath)) // [terminal emulator config] file exists, copy [terminal emulator config] to config/user_[terminal emulator config] file to backup any settings changes from previous sessions.
{
if (!CopyFile(cfgPath, userCfgPath, FALSE))
{
if (PathFileExists(windowsTerminalDir))
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_terminal_settings.json! Access Denied."
: L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_teerminal_settigns.json!", MB_TITLE, MB_ICONSTOP);
exit(1);
}
else if (PathFileExists(conEmuDir))
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/user-conemu.xml! Access Denied."
: L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/user-conemu.xml!", MB_TITLE, MB_ICONSTOP);
exit(1);
}
}
}
else // [terminal emulator config] file does not exist, copy config/user_[terminal emulator config] file to [terminal emulator config] file
{
if (!CopyFile(userCfgPath, cfgPath, FALSE))
{
if (PathFileExists(windowsTerminalDir))
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy config/user_windows_terminal_settings.json file to vendor/windows-terminal/settings/settings.json! Access Denied."
: L"Failed to copy config/user_windows_terminal_settings.json file to vendor/windows-terminal/settings/settings.json!", MB_TITLE, MB_ICONSTOP);
exit(1);
}
else if (PathFileExists(conEmuDir))
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy config/user-conemu.xml file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
: L"Failed to copy config/user-conemu.xml file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
exit(1);
}
}
}
}
else if (!PathFileExists(windowsTerminalDir)) { // '/c [path]' was specified, don't copy anything and use existing user_[terminal emulator config] file.
PathCombine(userConEmuCfgPath, userConfigDirPath, L"user-ConEmu.xml");
}
}
else if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
{
if (PathFileExists(cfgPath)) // [terminal emulator config] file exists, copy [terminal emulator config] file to config/user_[terminal emulator config] file.
{
if (!CopyFile(cfgPath, userCfgPath, FALSE))
{
if (PathFileExists(windowsTerminalDir))
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/user_windows_terminal_settings.json! Access Denied."
: L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/user_windows_terminal_settigns.json!", MB_TITLE, MB_ICONSTOP);
exit(1);
}
else if (PathFileExists(conEmuDir))
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
@ -324,28 +424,51 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
exit(1);
}
}
else // vendor/conemu-maximus5/ConEmu.xml does not exist, copy config/user-conemu.xml to vendor/conemu-maximus5/ConEmu.xml
else // vendor/[terminal emulator config].default config exists, copy Cmder vendor/[terminal emulator config].default file to [terminal emulator config] file.
{
if (!CopyFile(userCfgPath, cfgPath, FALSE))
if (!CopyFile(defaultCfgPath, cfgPath, FALSE))
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy config/user-conemu.xml file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
: L"Failed to copy config/user-conemu.xml file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
exit(1);
if (PathFileExists(windowsTerminalDir))
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy vendor/windows-terminal_default_settings_settings.json file to vendor/windows-terminal/settings/settings.json! Access Denied."
: L"Failed to copy vendor/windows-terminal_default_settings_settings.json file to vendor/windows-terminal/settings/settigns.json!", MB_TITLE, MB_ICONSTOP);
exit(1);
}
else if (PathFileExists(conEmuDir))
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
: L"Failed to copy vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
exit(1);
}
}
}
}
else // '/c [path]' was specified, don't copy anything and use existing user_conemu.xml to start comemu.
else if (!CopyFile(defaultCfgPath, cfgPath, FALSE) && PathFileExists(conEmuDir))
{
PathCombine(userConEmuCfgPath, userConfigDirPath, L"user-ConEmu.xml");
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
: L"Failed to copy vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
exit(1);
}
}
else if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
else if (wcscmp(cfgPath, L"") != 0 && PathFileExists(cfgPath)) // This is a first time Cmder.exe run and [terminal emulator config] file exists, copy [terminal emulator config] file to config/user_[terminal emulator config] file.
{
if (PathFileExists(cfgPath)) // vendor/conemu-maximus5/ConEmu.xml exists, copy vendor/conemu-maximus5/ConEmu.xml to config/user_conemu.xml
if (!CopyFile(cfgPath, userCfgPath, FALSE))
{
if (!CopyFile(cfgPath, userCfgPath, FALSE))
if (PathFileExists(windowsTerminalDir))
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/user_windows_terminal_settings_settings.json! Access Denied."
: L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/user_windows_terminal_settings_settigns.json!", MB_TITLE, MB_ICONSTOP);
exit(1);
}
else
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
@ -353,99 +476,146 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
: L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/user-conemu.xml!", MB_TITLE, MB_ICONSTOP);
exit(1);
}
else // vendor/ConEmu.xml.default config exists, copy Cmder vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml.
{
if (!CopyFile(defaultCfgPath, cfgPath, FALSE))
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
: L"Failed to copy vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
exit(1);
}
}
}
else {
if (!CopyFile(defaultCfgPath, cfgPath, FALSE))
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
: L"Failed to copy vendor/ConEmu.xml.default file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
exit(1);
}
}
}
else if (PathFileExists(cfgPath)) // vendor/conemu-maximus5/ConEmu.xml exists, copy vendor/conemu-maximus5/ConEmu.xml to config/user_conemu.xml
{
if (!CopyFile(cfgPath, userCfgPath, FALSE))
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/user-conemu.xml! Access Denied."
: L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/user-conemu.xml!", MB_TITLE, MB_ICONSTOP);
exit(1);
}
PathCombine(userConEmuCfgPath, userConfigDirPath, L"user-ConEmu.xml");
}
else // '/c [path]' was specified and 'vendor/ConEmu.xml.default' config exists, copy Cmder 'vendor/ConEmu.xml.default' file to '[user specified path]/config/user_ConEmu.xml'.
else if (wcscmp(defaultCfgPath, L"") != 0) // '/c [path]' was specified and 'vendor/[terminal emulator config].default' config exists, copy Cmder 'vendor/[terminal emulator config].default' file to '[user specified path]/config/user_[terminal emulator config]'.
{
if ( ! CopyFile(defaultCfgPath, userCfgPath, FALSE))
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy vendor/ConEmu.xml.default file to [user specified path]/config/user_ConEmu.xml! Access Denied."
: L"Failed to copy vendor/ConEmu.xml.default file to [user specified path]/config/user_ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
exit(1);
if (PathFileExists(windowsTerminalDir))
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy vendor/windows-terminal_default_settings_settings.json file to [user specified path]/config/user_windows_terminal_settings.json! Access Denied."
: L"Failed to copy vendor/windows-terminal_default_settings_settings.json file to [user specified path]/config/user_windows_terminal_settings.json!", MB_TITLE, MB_ICONSTOP);
exit(1);
}
else
{
MessageBox(NULL,
(GetLastError() == ERROR_ACCESS_DENIED)
? L"Failed to copy vendor/ConEmu.xml.default file to [user specified path]/config/user_ConEmu.xml! Access Denied."
: L"Failed to copy vendor/ConEmu.xml.default file to [user specified path]/config/user_ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
exit(1);
}
}
PathCombine(userConEmuCfgPath, userConfigDirPath, L"user-ConEmu.xml");
}
GetEnvironmentVariable(L"ProgramFiles", programFiles, MAX_PATH);
GetEnvironmentVariable(L"ProgramFiles(x86)", programFilesX86, MAX_PATH);
PathCombine(vendoredGit, vendorDir, L"git-for-windows");
PathCombine(amdx64Git, programFiles, L"Git");
PathCombine(x86Git, programFilesX86, L"Git");
SYSTEM_INFO sysInfo;
GetNativeSystemInfo(&sysInfo);
if (sysInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
if (PathFileExists(windowsTerminalDir))
{
PathCombine(conEmuPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu64.exe");
PathCombine(terminalPath, exeDir, L"vendor\\windows-terminal\\WindowsTerminal.exe");
}
else if (PathFileExists(conEmuDir))
{
swprintf_s(args, L"%s /Icon \"%s\"", args, icoPath);
swprintf_s(args, L"%s /title \"%s\"", args, cmderTitle.c_str());
PathCombine(terminalPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu64.exe");
}
else
{
PathCombine(conEmuPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu.exe");
}
PathCombine(terminalPath, winDir, L"system32\\cmd.exe");
swprintf_s(args, L"%s /Icon \"%s\"", args, icoPath);
if (streqi(cmderTask.c_str(), L"powershell"))
{
PathCombine(terminalPath, winDir, L"System32\\WindowsPowerShell\\v1.0\\powershell.exe");
}
/*
else if (streqi(cmderTask.c_str(), L"mintty"))
{
if (PathFileExists(vendoredGit))
{
PathCombine(terminalPath, vendoredGit, L"git-bash.exe");
}
else if (PathFileExists(amdx64Git))
{
PathCombine(terminalPath, amdx64Git, L"git-bash.exe");
}
else if (PathFileExists(x86Git))
{
PathCombine(terminalPath, x86Git, L"git-bash.exe");
}
}
*/
}
if (!streqi(cmderStart.c_str(), L""))
{
swprintf_s(args, L"%s /dir \"%s\"", args, cmderStart.c_str());
if (PathFileExists(windowsTerminalDir)) {
swprintf_s(args, L"%s -d \"%s\"", args, cmderStart.c_str());
}
else
{
swprintf_s(args, L"%s /dir \"%s\"", args, cmderStart.c_str());
}
}
if (is_single_mode)
{
swprintf_s(args, L"%s /single", args);
}
if (!streqi(cmderTitle.c_str(), L""))
{
swprintf_s(args, L"%s /title \"%s\"", args, cmderTitle.c_str());
if (!PathFileExists(windowsTerminalDir)) {
swprintf_s(args, L"%s /single", args);
}
}
if (cfgRoot.length() != 0)
{
swprintf_s(args, L"%s -loadcfgfile \"%s\"", args, userConEmuCfgPath);
if (!PathFileExists(windowsTerminalDir)) {
swprintf_s(args, L"%s -loadcfgfile \"%s\"", args, userConEmuCfgPath);
}
}
if (!streqi(cmderConEmuArgs.c_str(), L""))
if (!streqi(cmderTerminalArgs.c_str(), L""))
{
swprintf_s(args, L"%s %s", args, cmderConEmuArgs.c_str());
swprintf_s(args, L"%s %s", args, cmderTerminalArgs.c_str());
}
// The `/run` arg and its value MUST be the last arg of ConEmu
// see : https://conemu.github.io/en/ConEmuArgs.html
// > This must be the last used switch (excepting -new_console and -cur_console)
PathCombine(initCmd, vendorDir, L"init.bat");
PathCombine(initPowerShell, vendorDir, L"profile.ps1");
PathCombine(initBash, vendorDir, L"start_git_bash.cmd");
PathCombine(initMintty, vendorDir, L"start_git_mintty.cmd");
if (!streqi(cmderTask.c_str(), L""))
{
swprintf_s(args, L"%s /run {%s}", args, cmderTask.c_str());
if (PathFileExists(windowsTerminalDir)) {
swprintf_s(args, L"%s -p \"%s\"", args, cmderTask.c_str());
}
else if (PathFileExists(conEmuDir))
{
swprintf_s(args, L"%s /run {%s}", args, cmderTask.c_str());
}
else
{
if (streqi(cmderTask.c_str(), L"powershell"))
{
swprintf_s(args, L"%s -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command \"Invoke-Expression 'Import-Module ''%s'''\"", args, initPowerShell);
}
else if (streqi(cmderTask.c_str(), L"bash"))
{
swprintf_s(args, L"%s /c \"%s\"", args, initBash);
}
else if (streqi(cmderTask.c_str(), L"mintty"))
{
swprintf_s(args, L"%s /c \"%s\"", args, initMintty);
}
else if (streqi(cmderTask.c_str(), L"cmder"))
{
swprintf_s(args, L"%s /k \"%s\"", args, initCmd);
}
}
}
SetEnvironmentVariable(L"CMDER_ROOT", exeDir);
@ -455,23 +625,54 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
SetEnvironmentVariable(L"CMDER_USER_BIN", userBinDirPath);
}
// Try to find m'intty.exe' so ConEmu can launch using %MINTTY_EXE% in external Git for Cmder Mini.
// See: https://github.com/Maximus5/ConEmu/issues/2559 for why this is commented.
/*
if (PathFileExists(vendoredGit))
{
PathCombine(minTTYPath, vendoredGit, L"usr\\bin\\mintty.exe");
SetEnvironmentVariable(L"MINTTY_EXE", minTTYPath);
}
else if (PathFileExists(amdx64Git))
{
PathCombine(minTTYPath, amdx64Git, L"usr\\bin\\mintty.exe");
SetEnvironmentVariable(L"MINTTY_EXE", minTTYPath);
}
else if (PathFileExists(x86Git))
{
PathCombine(minTTYPath, x86Git, L"usr\\bin\\mintty.exe");
SetEnvironmentVariable(L"MINTTY_EXE", minTTYPath);
}
*/
// Ensure EnvironmentVariables are propagated.
STARTUPINFO si = { 0 };
si.cb = sizeof(STARTUPINFO);
#if USE_TASKBAR_API
si.lpTitle = appId;
si.dwFlags = STARTF_TITLEISAPPID;
#endif
#if USE_TASKBAR_API
si.lpTitle = appId;
si.dwFlags = STARTF_TITLEISAPPID;
#endif
PROCESS_INFORMATION pi;
if (!CreateProcess(conEmuPath, args, NULL, NULL, false, 0, NULL, NULL, &si, &pi)) {
MessageBox(NULL, _T("Unable to create the ConEmu process!"), _T("Error"), MB_OK);
if (!CreateProcess(terminalPath, args, NULL, NULL, false, 0, NULL, NULL, &si, &pi))
{
if (PathFileExists(windowsTerminalDir))
{
MessageBox(NULL, _T("Unable to create the Windows Terminal process!"), _T("Error"), MB_OK);
}
else if (PathFileExists(conEmuDir))
{
MessageBox(NULL, _T("Unable to create the ConEmu process!"), _T("Error"), MB_OK);
}
else
{
MessageBox(NULL, _T("Unable to create the Cmd process!"), _T("Error"), MB_OK);
}
return;
}
LRESULT lr = SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)"Environment", SMTO_ABORTIFHUNG | SMTO_NOTIMEOUTIFNOTHUNG, 5000, NULL);
lr = SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)L"Environment", SMTO_ABORTIFHUNG | SMTO_NOTIMEOUTIFNOTHUNG, 5000, NULL); // For Windows >= 8
}
bool IsUserOnly(std::wstring opt)
@ -524,11 +725,11 @@ void RegisterShellMenu(std::wstring opt, wchar_t* keyBaseName, std::wstring cfgR
wchar_t commandStr[MAX_PATH + 20] = { 0 };
wchar_t baseCommandStr[MAX_PATH + 20] = { 0 };
if (!single) {
swprintf_s(baseCommandStr, L"\"%s\"", exePath);
if (single) {
swprintf_s(baseCommandStr, L"\"%s\" /single", exePath);
}
else {
swprintf_s(baseCommandStr, L"\"%s\" /single", exePath);
swprintf_s(baseCommandStr, L"\"%s\"", exePath);
}
if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
@ -586,7 +787,7 @@ struct cmderOptions
std::wstring cmderTitle = L"Cmder";
std::wstring cmderIcon = L"";
std::wstring cmderRegScope = L"USER";
std::wstring cmderConEmuArgs = L"";
std::wstring cmderTerminalArgs = L"";
bool cmderSingle = false;
bool cmderUserCfg = true;
bool registerApp = false;
@ -600,11 +801,22 @@ cmderOptions GetOption()
LPWSTR *szArgList;
int argCount;
wchar_t windowsTerminalDir[MAX_PATH] = { 0 };
wchar_t conEmuDir[MAX_PATH] = { 0 };
wchar_t vendorDir[MAX_PATH] = { 0 };
wchar_t exeDir[MAX_PATH] = { 0 };
GetModuleFileName(NULL, exeDir, sizeof(exeDir));
PathRemoveFileSpec(exeDir);
PathCombine(vendorDir, exeDir, L"vendor");
PathCombine(windowsTerminalDir, vendorDir, L"windows-terminal");
PathCombine(conEmuDir, vendorDir, L"ConEmu-Maximus5");
szArgList = CommandLineToArgvW(GetCommandLine(), &argCount);
for (int i = 1; i < argCount; i++)
{
// MessageBox(NULL, szArgList[i], L"Arglist contents", MB_OK);
if (cmderOptions.error == false) {
if (_wcsicmp(L"/c", szArgList[i]) == 0)
@ -641,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))
{
cmderOptions.cmderTask = szArgList[i + 1];
i++;
}
else if (_wcsicmp(L"/title", szArgList[i]) == 0)
else if (_wcsicmp(L"/title", szArgList[i]) == 0 && !PathFileExists(windowsTerminalDir) && PathFileExists(conEmuDir))
{
cmderOptions.cmderTitle = szArgList[i + 1];
i++;
}
else if (_wcsicmp(L"/icon", szArgList[i]) == 0)
else if (_wcsicmp(L"/icon", szArgList[i]) == 0 && !PathFileExists(windowsTerminalDir) && PathFileExists(conEmuDir))
{
cmderOptions.cmderIcon = szArgList[i + 1];
i++;
}
else if (_wcsicmp(L"/single", szArgList[i]) == 0)
else if (_wcsicmp(L"/single", szArgList[i]) == 0 && !PathFileExists(windowsTerminalDir) && PathFileExists(conEmuDir))
{
cmderOptions.cmderSingle = true;
}
else if (_wcsicmp(L"/m", szArgList[i]) == 0)
else if (_wcsicmp(L"/m", szArgList[i]) == 0 && !PathFileExists(windowsTerminalDir) && PathFileExists(conEmuDir))
{
cmderOptions.cmderUserCfg = false;
}
@ -693,7 +905,7 @@ cmderOptions GetOption()
/* Used for passing arguments to conemu prog */
else if (_wcsicmp(L"/x", szArgList[i]) == 0)
{
cmderOptions.cmderConEmuArgs = szArgList[i + 1];
cmderOptions.cmderTerminalArgs = szArgList[i + 1];
i++;
}
/* Bare double dash, remaining commandline is for conemu */
@ -703,7 +915,7 @@ cmderOptions GetOption()
auto doubledash = cmdline.find(L" -- ");
if (doubledash != std::string::npos)
{
cmderOptions.cmderConEmuArgs = cmdline.substr(doubledash + 4);
cmderOptions.cmderTerminalArgs = cmdline.substr(doubledash + 4);
}
break;
}
@ -730,7 +942,11 @@ cmderOptions GetOption()
cmderOptions.error = true;
}
}
}
if (!PathFileExists(windowsTerminalDir) && !PathFileExists(conEmuDir) && streqi(cmderOptions.cmderTask.c_str(), L""))
{
cmderOptions.cmderTask = L"cmder";
}
if (cmderOptions.error == true)
@ -759,12 +975,29 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
cmderOptions cmderOptions = GetOption();
wchar_t windowsTerminalDir[MAX_PATH] = { 0 };
wchar_t exeDir[MAX_PATH] = { 0 };
GetModuleFileName(NULL, exeDir, sizeof(exeDir));
PathRemoveFileSpec(exeDir);
PathCombine(windowsTerminalDir, exeDir, L"vendor\\windows-terminal");
if (cmderOptions.registerApp == true)
{
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_LISTITEM, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_LISTITEM, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
if (PathFileExists(windowsTerminalDir))
{
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_LISTITEM, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_LISTITEM, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
}
else
{
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, false);
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_LISTITEM, cmderOptions.cmderCfgRoot, false);
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, false);
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_LISTITEM, cmderOptions.cmderCfgRoot, false);
}
}
else if (cmderOptions.unRegisterApp == true)
{
@ -779,8 +1012,8 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
}
else
{
StartCmder(cmderOptions.cmderStart, cmderOptions.cmderSingle, cmderOptions.cmderTask, cmderOptions.cmderTitle, cmderOptions.cmderIcon, cmderOptions.cmderCfgRoot, cmderOptions.cmderUserCfg, cmderOptions.cmderConEmuArgs);
StartCmder(cmderOptions.cmderStart, cmderOptions.cmderSingle, cmderOptions.cmderTask, cmderOptions.cmderTitle, cmderOptions.cmderIcon, cmderOptions.cmderCfgRoot, cmderOptions.cmderUserCfg, cmderOptions.cmderTerminalArgs);
}
return 0;
}
}

View File

@ -35,19 +35,19 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
1 TEXTINCLUDE
BEGIN
"resource.h\0"
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
"#include ""winres.h""\r\n"
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
@ -60,7 +60,7 @@ END
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_CMDER ICON "..\\..\\icons\\cmder.ico"
#endif // English (United States) resources
#endif // not APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////

View File

@ -6,7 +6,7 @@ STRINGTABLE
{
IDS_TITLE "Cmder Launcher"
IDS_SWITCHES L"Valid options:\n\n /c [CMDER User Root Path]\n /task [ConEmu Task Name]\n /icon [CMDER Icon Path]\n [/start [Start in Path] | [Start in Path]]\n /single\n /m\n /x [ConEmu extra arguments]\n\nor, either:\n /register [USER | ALL]\n /unregister [USER | ALL]"
IDS_SWITCHES L"Valid options:\n\n /c [CMDER User Root Path]\n /task [Windows Terminal Profile/ConEmu Task Name]\n /icon [CMDER Icon Path] - ConEmu ONLY!\n [/start [Start in Path] | [Start in Path]]\n /single - ConEmu ONLY!\n /m\n -- [ConEmu/Windows Terminal extra arguments]\n\nNote: '-- [...]' must be the last argument!\n\nor, either:\n /register [USER | ALL]\n /unregister [USER | ALL]"
}
/////////////////////////////////////////////////////////////////////////////

View File

@ -1,9 +1,8 @@
/**
* WARNING: do NOT modify this file! the content of this file should be
* automatically genereted before AppVeyor builds using the
* respective .ps1 Powershell scripts.
*
* WARNING: This file should NOT be manually modified!
* The contents will be automatically generated using the `.ps1` PowerShell scripts,
* during builds by the CI.
*/
/////////////////////////////////////////////////////////////////////////////

View File

@ -23,5 +23,6 @@ appveyor.yml
vendor\cmder.sh
vendor\git-prompt.sh
config\user-*
config\user_*
clink_history*
*.log

View File

@ -55,6 +55,9 @@ Param(
# Using this option will skip all downloads, if you only need to build launcher
[switch]$noVendor,
# Using this option will specify the emulator to use [none, all, conemu-maximus5, or windows-terminal]
[string]$terminal = 'all',
# Build launcher if you have MSBuild tools installed
[switch]$Compile
@ -79,7 +82,7 @@ if ($Compile) {
Write-Verbose "Building the launcher..."
# Referene: https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
# Reference: https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
msbuild CmderLauncher.vcxproj /t:Clean,Build /p:configuration=Release /m
if ($LastExitCode -ne 0) {
@ -113,15 +116,36 @@ if (-not $noVendor) {
}
else { $ConEmuXml = "" }
# Preserve modified (by user) Windows Terminal setting file
if ($config -ne "") {
$WinTermSettingsJson = Join-Path $saveTo "windows-terminal\settings\settings.json"
if (Test-Path $WinTermSettingsJson -pathType leaf) {
$WinTermSettingsJsonSave = Join-Path $config "windows_terminal_settings.json"
Write-Verbose "Backup '$WinTermSettingsJson' to '$WinTermSettingsJsonSave'"
Copy-Item $WinTermSettingsJson $WinTermSettingsJsonSave
}
else { $WinTermSettingsJson = "" }
}
else { $WinTermSettingsJson = "" }
# Kill ssh-agent.exe if it is running from the $env:cmder_root we are building
$cmder_folder = $cmder_root.toString()
foreach ($ssh_agent in $(Get-Process ssh-agent -ErrorAction SilentlyContinue)) {
if ([string]$($ssh_agent.path) -Match [string]$cmder_root.replace('\', '\\')) {
if ([string]$($ssh_agent.path) -Match $cmder_folder.Replace('\', '\\')) {
Write-Verbose $("Stopping " + $ssh_agent.path + "!")
Stop-Process $ssh_agent.id
}
}
foreach ($s in $sources) {
if ($terminal -eq "none") {
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
}
Write-Verbose "Getting vendored $($s.name) $($s.version)..."
# We do not care about the extensions/type of archive
@ -132,6 +156,16 @@ if (-not $noVendor) {
Download-File -Url $s.url -File $vend\$tempArchive -ErrorAction Stop
Extract-Archive $tempArchive $s.name
# Make Embedded Windows Terminal Portable
if ($s.name -eq "windows-terminal") {
$windowTerminalFiles = resolve-path ($saveTo + "\" + $s.name + "\terminal*")
move-item -ErrorAction SilentlyContinue $windowTerminalFiles\* $s.name >$null
remove-item -ErrorAction SilentlyContinue $windowTerminalFiles >$null
write-verbose "Making Windows Terminal Portable..."
New-Item -Type Directory -Path (Join-Path $saveTo "/windows-terminal/settings") -ErrorAction SilentlyContinue >$null
New-Item -Type File -Path (Join-Path $saveTo "/windows-terminal/.portable") -ErrorAction SilentlyContinue >$null
}
if ((Get-ChildItem $s.name).Count -eq 1) {
Flatten-Directory($s.name)
}
@ -146,6 +180,12 @@ if (-not $noVendor) {
Copy-Item $ConEmuXmlSave $ConEmuXml
}
# Restore Windows Terminal user configuration
if ($WinTermSettingsJson -ne "") {
Write-Verbose "Restore '$WinTermSettingsJsonSave' to '$WinTermSettingsJson'"
Copy-Item $WinTermSettingsJsonSave $WinTermSettingsJson
}
# Put vendor\cmder.sh in /etc/profile.d so it runs when we start bash or mintty
if ( (Test-Path $($saveTo + "git-for-windows/etc/profile.d") ) ) {
Write-Verbose "Adding cmder.sh /etc/profile.d"

View File

@ -31,6 +31,9 @@ Param(
# Path to the vendor configuration source file
[string]$cmderRoot = "$PSScriptRoot\..",
# Using this option will pack artifacts for a specific included terminal emulator [none, all, conemu-maximus5, or windows-terminal]
[string]$terminal = 'all',
# Vendor folder locaton
[string]$saveTo = "$PSScriptRoot\..\build"
)
@ -41,10 +44,36 @@ $cmderRoot = Resolve-Path $cmderRoot
$ErrorActionPreference = "Stop"
Ensure-Executable "7z"
$targets = @{
"cmder.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on";
"cmder.zip" = "-mm=Deflate -mfb=128 -mpass=3";
"cmder_mini.zip" = "-xr!`"vendor\git-for-windows`"";
if ($terminal -eq "none") {
$targets = @{
"cmder_win.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on -xr!`"vendor\conemu-maximus5`" -xr!`"vendor\windows-terminal`"";
"cmder_win.zip" = "-mm=Deflate -mfb=128 -mpass=3 -xr!`"vendor\conemu-maximus5`" -xr!`"vendor\windows-terminal`"";
"cmder_win.mini.zip" = "-xr!`"vendor\git-for-windows`" -xr!`"vendor\conemu-maximus5`" -xr!`"vendor\windows-terminal`"";
}
} elseif ($terminal -eq "windows-terminal") {
$targets = @{
"cmder_wt.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on -xr!`"vendor\conemu-maximus5`"";
"cmder_wt.zip" = "-mm=Deflate -mfb=128 -mpass=3 -xr!`"vendor\conemu-maximus5`"";
"cmder_wt_mini.zip" = "-xr!`"vendor\git-for-windows`" -xr!`"vendor\conemu-maximus5`"";
}
} 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`"";
}
} else {
$targets = @{
"cmder_win.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on -xr!`"vendor\conemu-maximus5`" -xr!`"vendor\windows-terminal`"";
"cmder_win.zip" = "-mm=Deflate -mfb=128 -mpass=3 -xr!`"vendor\conemu-maximus5`" -xr!`"vendor\windows-terminal`"";
"cmder_win_mini.zip" = "-xr!`"vendor\git-for-windows`" -xr!`"vendor\conemu-maximus5`" -xr!`"vendor\windows-terminal`"";
"cmder_wt.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on -xr!`"vendor\conemu-maximus5`"";
"cmder_wt.zip" = "-mm=Deflate -mfb=128 -mpass=3 -xr!`"vendor\conemu-maximus5`"";
"cmder_wt_mini.zip" = "-xr!`"vendor\git-for-windows`" -xr!`"vendor\conemu-maximus5`"";
"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`"";
}
}
Push-Location -Path $cmderRoot

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2018-02-22 06:02:11" build="171109">
<key name=".Vanilla" modified="2023-06-05 13:14:44" build="221218">
<value name="ColorTable00" type="dword" data="00222827"/>
<value name="ColorTable01" type="dword" data="009e5401"/>
<value name="ColorTable02" type="dword" data="0004aa74"/>
@ -42,8 +42,8 @@
<value name="PopBackColorIdx" type="hex" data="10"/>
<value name="ExtendFonts" type="hex" data="00"/>
<value name="ExtendFontNormalIdx" type="hex" data="01"/>
<value name="ExtendFontBoldIdx" type="hex" data="0c"/>
<value name="ExtendFontItalicIdx" type="hex" data="0d"/>
<value name="ExtendFontBoldIdx" type="hex" data="0C"/>
<value name="ExtendFontItalicIdx" type="hex" data="0D"/>
<value name="CursorTypeActive" type="dword" data="000232c1"/>
<value name="CursorTypeInactive" type="dword" data="00823282"/>
<value name="ClipboardDetectLineEnd" type="hex" data="01"/>
@ -58,7 +58,7 @@
<value name="TrueColorerSupport" type="hex" data="01"/>
<value name="FadeInactive" type="hex" data="01"/>
<value name="FadeInactiveLow" type="hex" data="00"/>
<value name="FadeInactiveHigh" type="hex" data="c8"/>
<value name="FadeInactiveHigh" type="hex" data="C8"/>
<value name="ComSpec.UncPaths" type="hex" data="01"/>
<value name="ConVisible" type="hex" data="00"/>
<value name="ConInMode" type="dword" data="ffffffff"/>
@ -78,7 +78,6 @@
<value name="StartFarEditors" type="hex" data="00"/>
<value name="StoreTaskbarkTasks" type="hex" data="00"/>
<value name="StoreTaskbarCommands" type="hex" data="00"/>
<value name="CmdLineHistory" type="multi"></value>
<value name="SingleInstance" type="hex" data="00"/>
<value name="ShowHelpTooltips" type="hex" data="01"/>
<value name="Multi" type="hex" data="01"/>
@ -113,13 +112,13 @@
<value name="Monospace" type="hex" data="01"/>
<value name="BackGround Image show" type="hex" data="00"/>
<value name="BackGround Image" type="string" data="c:\back.bmp"/>
<value name="bgImageDarker" type="hex" data="ff"/>
<value name="bgImageDarker" type="hex" data="FF"/>
<value name="bgImageColors" type="dword" data="ffffffff"/>
<value name="bgOperation" type="hex" data="00"/>
<value name="bgPluginAllowed" type="hex" data="01"/>
<value name="AlphaValue" type="hex" data="f8"/>
<value name="AlphaValue" type="hex" data="F8"/>
<value name="AlphaValueSeparate" type="hex" data="01"/>
<value name="AlphaValueInactive" type="hex" data="ee"/>
<value name="AlphaValueInactive" type="hex" data="EE"/>
<value name="UserScreenTransparent" type="hex" data="00"/>
<value name="ColorKeyTransparent" type="hex" data="00"/>
<value name="ColorKeyValue" type="dword" data="00010101"/>
@ -128,8 +127,8 @@
<value name="ConWnd Width" type="dword" data="00000078"/>
<value name="ConWnd Height" type="dword" data="0000001e"/>
<value name="Cascaded" type="hex" data="01"/>
<value name="ConWnd X" type="long" data="500"/>
<value name="ConWnd Y" type="long" data="500"/>
<value name="ConWnd X" type="long" data="2194"/>
<value name="ConWnd Y" type="long" data="95"/>
<value name="16bit Height" type="ulong" data="0"/>
<value name="AutoSaveSizePos" type="hex" data="01"/>
<value name="IntegralSize" type="hex" data="00"/>
@ -166,19 +165,19 @@
<value name="CTS.ActMode" type="hex" data="02"/>
<value name="CTS.RBtnAction" type="hex" data="03"/>
<value name="CTS.MBtnAction" type="hex" data="00"/>
<value name="CTS.ColorIndex" type="hex" data="e0"/>
<value name="CTS.ColorIndex" type="hex" data="E0"/>
<value name="ClipboardConfirmEnter" type="hex" data="01"/>
<value name="ClipboardConfirmLonger" type="ulong" data="200"/>
<value name="FarGotoEditorOpt" type="hex" data="01"/>
<value name="FarGotoEditorPath" type="string" data="far.exe /e%1:%2 &quot;%3&quot;"/>
<value name="FarGotoEditorPath" type="string" data='far.exe /e%1:%2 "%3"'/>
<value name="FixFarBorders" type="hex" data="01"/>
<value name="FixFarBordersRanges" type="string" data="2013-25C4;"/>
<value name="ExtendUCharMap" type="hex" data="01"/>
<value name="EnhanceGraphics" type="hex" data="01"/>
<value name="EnhanceButtons" type="hex" data="00"/>
<value name="PartBrush75" type="hex" data="c8"/>
<value name="PartBrush75" type="hex" data="C8"/>
<value name="PartBrush50" type="hex" data="96"/>
<value name="PartBrush25" type="hex" data="5a"/>
<value name="PartBrush25" type="hex" data="5A"/>
<value name="PartBrushBlack" type="hex" data="20"/>
<value name="RightClick opens context menu" type="hex" data="02"/>
<value name="RightClickMacro2" type="string" data=""/>
@ -413,15 +412,15 @@
<value name="Key.TileToLeft" type="dword" data="80808000"/>
<value name="Key.TileToRIght" type="dword" data="80808000"/>
<value name="KeyMacro01" type="dword" data="0012a031"/>
<value name="KeyMacro01.Text" type="string" data="Task(&quot;cmd&quot;)"/>
<value name="KeyMacro01.Text" type="string" data='Task("cmd")'/>
<value name="KeyMacro02" type="dword" data="0012a032"/>
<value name="KeyMacro02.Text" type="string" data="Task(&quot;PowerShell&quot;)"/>
<value name="KeyMacro02.Text" type="string" data='Task("PowerShell")'/>
<value name="KeyMacro03" type="dword" data="000011d0"/>
<value name="KeyMacro03.Text" type="string" data="FontSetSize(1,2)"/>
<value name="KeyMacro04" type="dword" data="000011d1"/>
<value name="KeyMacro04.Text" type="string" data="FontSetSize(1,-2)"/>
<value name="KeyMacro05" type="dword" data="0012a033"/>
<value name="KeyMacro05.Text" type="string" data="Task(&quot;PowerShell as Admin&quot;)"/>
<value name="KeyMacro05.Text" type="string" data='Task("PowerShell as Admin")'/>
<value name="KeyMacro06" type="dword" data="00000000"/>
<value name="KeyMacro06.Text" type="string" data=""/>
<value name="KeyMacro07" type="dword" data="00000000"/>
@ -484,12 +483,12 @@
<value name="DndLKey" type="hex" data="00"/>
<value name="DndRKey" type="hex" data="a2"/>
<value name="WndDragKey" type="dword" data="00121101"/>
<key name="Tasks" modified="2018-02-22 06:02:12" build="171109">
<value name="Count" type="long" data="9"/>
<key name="Tasks" modified="2023-06-05 13:14:44" build="221218">
<value name="Count" type="long" data="11"/>
<key name="Task1" modified="2018-02-22 06:02:12" build="171109">
<value name="Name" type="string" data="{cmd::Cmder as Admin}"/>
<value name="GuiArgs" type="string" data=" /icon &quot;%CMDER_ROOT%\icons\cmder.ico&quot;"/>
<value name="Cmd1" type="string" data="*cmd /k &quot;&quot;%ConEmuDir%\..\init.bat&quot; &quot;"/>
<value name="GuiArgs" type="string" data=' /icon "%CMDER_ROOT%\icons\cmder.ico"'/>
<value name="Cmd1" type="string" data='*cmd /k ""%ConEmuDir%\..\init.bat" "'/>
<value name="Active" type="long" data="0"/>
<value name="Count" type="long" data="1"/>
<value name="Hotkey" type="dword" data="00000000"/>
@ -497,8 +496,8 @@
</key>
<key name="Task2" modified="2018-02-22 06:05:13" build="171109">
<value name="Name" type="string" data="{cmd::Cmder}"/>
<value name="GuiArgs" type="string" data=" /icon &quot;%CMDER_ROOT%\icons\cmder.ico&quot;"/>
<value name="Cmd1" type="string" data="cmd /k &quot;&quot;%ConEmuDir%\..\init.bat&quot; &quot;"/>
<value name="GuiArgs" type="string" data=' /icon "%CMDER_ROOT%\icons\cmder.ico"'/>
<value name="Cmd1" type="string" data='cmd /k ""%ConEmuDir%\..\init.bat" "'/>
<value name="Active" type="long" data="0"/>
<value name="Count" type="long" data="1"/>
<value name="Hotkey" type="dword" data="00000000"/>
@ -507,8 +506,8 @@
<key name="Task3" modified="2018-02-22 06:05:13" build="171109">
<value name="Name" type="string" data="{PowerShell::PowerShell as Admin}"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data=" /icon &quot;%CMDER_ROOT%\icons\cmder.ico&quot;"/>
<value name="Cmd1" type="string" data="*PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command &quot;Invoke-Expression 'Import-Module ''%ConEmuDir%\..\profile.ps1'''&quot;"/>
<value name="GuiArgs" type="string" data=' /icon "%CMDER_ROOT%\icons\cmder.ico"'/>
<value name="Cmd1" type="string" data='*PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression &apos;Import-Module &apos;&apos;%ConEmuDir%\..\profile.ps1&apos;&apos;&apos;"'/>
<value name="Active" type="long" data="0"/>
<value name="Count" type="long" data="1"/>
<value name="Flags" type="dword" data="00000000"/>
@ -516,61 +515,78 @@
<key name="Task4" modified="2018-02-22 06:05:13" build="171109">
<value name="Name" type="string" data="{PowerShell::PowerShell}"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data=" /icon &quot;%CMDER_ROOT%\icons\cmder.ico&quot;"/>
<value name="Cmd1" type="string" data="PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command &quot;Invoke-Expression 'Import-Module ''%ConEmuDir%\..\profile.ps1'''&quot;"/>
<value name="Cmd2" type="string" data="&quot;%CMDER_ROOT%\vendor\git-for-windows\git-bash.exe&quot;"/>
<value name="GuiArgs" type="string" data=' /icon "%CMDER_ROOT%\icons\cmder.ico"'/>
<value name="Cmd1" type="string" data='PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression &apos;Import-Module &apos;&apos;%ConEmuDir%\..\profile.ps1&apos;&apos;&apos;"'/>
<value name="Cmd2" type="string" data='"%CMDER_ROOT%\vendor\git-for-windows\git-bash.exe"'/>
<value name="Active" type="long" data="0"/>
<value name="Count" type="long" data="1"/>
<value name="Flags" type="dword" data="00000000"/>
</key>
<key name="Task5" modified="2018-02-22 06:05:13" build="171109">
<key name="Task5" modified="2023-06-05 13:15:18" build="221218">
<value name="Name" type="string" data="{bash::mintty as Admin - External}"/>
<value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data='/icon "%ProgramFiles%\git\usr\share\git\git-for-windows.ico"'/>
<value name="Cmd1" type="string" data='*"%ProgramFiles%\git\usr\bin\mintty.exe" /bin/bash -l'/>
<value name="Active" type="long" data="0"/>
<value name="Count" type="long" data="1"/>
</key>
<key name="Task6" modified="2023-06-05 13:15:38" build="221218">
<value name="Name" type="string" data="{bash::mintty - External}"/>
<value name="Flags" type="dword" data="00000004"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data='/icon "%ProgramFiles%\git\usr\share\git\git-for-windows.ico"'/>
<value name="Cmd1" type="string" data='"%ProgramFiles%\git\usr\bin\mintty.exe" /bin/bash -l'/>
<value name="Active" type="long" data="0"/>
<value name="Count" type="long" data="1"/>
<value name="Cmd2" type="string" data='"%CMDER_ROOT%vendor\git-for-windows\usr\bin\mintty.exe" /bin/bash -l'/>
</key>
<key name="Task7" modified="2023-06-05 13:15:38" build="221218">
<value name="Name" type="string" data="{bash::mintty as Admin}"/>
<value name="Flags" type="dword" data="00000000"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data="/icon &quot;%ConEmuDir%\..\git-for-windows\usr\share\git\git-for-windows.ico&quot;"/>
<value name="Cmd1" type="string" data="*&quot;%ConEmuDir%\..\git-for-windows\usr\bin\mintty.exe&quot; /bin/bash -l"/>
<value name="GuiArgs" type="string" data='/icon "%ConEmuDir%\..\git-for-windows\usr\share\git\git-for-windows.ico"'/>
<value name="Active" type="long" data="0"/>
<value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data='*"%ConEmuDir%\..\git-for-windows\usr\bin\mintty.exe" /bin/bash -l'/>
</key>
<key name="Task6" modified="2018-02-22 06:05:13" build="171109">
<key name="Task8" modified="2023-06-05 13:15:18" build="221218">
<value name="Name" type="string" data="{bash::mintty}"/>
<value name="Flags" type="dword" data="00000000"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data="/icon &quot;%ConEmuDir%\..\git-for-windows\usr\share\git\git-for-windows.ico&quot;"/>
<value name="Cmd1" type="string" data="&quot;%ConEmuDir%\..\git-for-windows\usr\bin\mintty.exe&quot; /bin/bash -l"/>
<value name="GuiArgs" type="string" data='/icon "%ConEmuDir%\..\git-for-windows\usr\share\git\git-for-windows.ico"'/>
<value name="Cmd1" type="string" data='"%ConEmuDir%\..\git-for-windows\usr\bin\mintty.exe" /bin/bash -l'/>
<value name="Active" type="long" data="0"/>
<value name="Count" type="long" data="1"/>
<value name="Cmd2" type="string" data="&quot;%CMDER_ROOT%vendor\git-for-windows\usr\bin\mintty.exe&quot; /bin/bash -l"/>
</key>
<key name="Task7" modified="2018-02-22 06:05:13" build="171109">
<key name="Task9" modified="2023-06-05 13:14:44" build="221218">
<value name="Name" type="string" data="{bash::bash as Admin}"/>
<value name="Flags" type="dword" data="00000000"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data=" /icon &quot;%CMDER_ROOT%\icons\cmder.ico&quot;"/>
<value name="GuiArgs" type="string" data=' /icon "%CMDER_ROOT%\icons\cmder.ico"'/>
<value name="Cmd1" type="string" data='*cmd /c "%ConEmuDir%\..\start_git_bash.cmd"'/>
<value name="Active" type="long" data="0"/>
<value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data="*set &quot;PATH=%ConEmuDir%\..\git-for-windows\usr\bin;%PATH%&quot; &amp; %ConEmuDir%\..\git-for-windows\git-cmd.exe --no-cd --command=%ConEmuBaseDirShort%\conemu-msys2-64.exe &quot;%ConEmuDir%\..\git-for-windows\usr\bin\bash.exe&quot; --login -i"/>
</key>
<key name="Task8" modified="2018-02-22 06:05:13" build="171109">
<key name="Task10" modified="2023-06-05 13:14:44" build="221218">
<value name="Name" type="string" data="{bash::bash}"/>
<value name="Flags" type="dword" data="00000000"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data=" /icon &quot;%CMDER_ROOT%\icons\cmder.ico&quot;"/>
<value name="Cmd1" type="string" data="set &quot;PATH=%ConEmuDir%\..\git-for-windows\usr\bin;%PATH%&quot; &amp; %ConEmuDir%\..\git-for-windows\git-cmd.exe --no-cd --command=%ConEmuBaseDirShort%\conemu-msys2-64.exe &quot;%ConEmuDir%\..\git-for-windows\usr\bin\bash.exe&quot; --login -i"/>
<value name="GuiArgs" type="string" data=' /icon "%CMDER_ROOT%\icons\cmder.ico"'/>
<value name="Active" type="long" data="0"/>
<value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data='cmd /c "%ConEmuDir%\..\start_git_bash.cmd"'/>
</key>
<key name="Task9" modified="2018-03-23 23:26:53" build="180318">
<key name="Task11" modified="2023-06-05 13:14:44" build="221218">
<value name="Name" type="string" data="{WSL::bash}"/>
<value name="Flags" type="dword" data="00000000"/>
<value name="Hotkey" type="dword" data="00000000"/>
<value name="GuiArgs" type="string" data='-icon "%USERPROFILE%\AppData\Local\lxss\bash.ico"'/>
<value name="Cmd1" type="string" data='set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" &amp; %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pm:/mnt'/>
<value name="Active" type="long" data="0"/>
<value name="Count" type="long" data="1"/>
<value name="Cmd1" type="string" data='set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" &amp; %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pm:/mnt'/>
</key>
</key>
<key name="Apps" modified="2018-02-22 06:05:13" build="171109">
<value name="Count" type="long" data="0"/>
</key>
@ -676,7 +692,7 @@
<value name="StatusBar.Hide.Dpi" type="hex" data="01"/>
<value name="TabFlashChanged" type="long" data="8"/>
<value name="TabModifiedSuffix" type="string" data="[*]"/>
<key name="HotKeys" modified="2018-02-22 06:02:12" build="171109">
<key name="HotKeys" modified="2023-06-05 13:14:44" build="221218">
<value name="KeyMacroVersion" type="hex" data="02"/>
<value name="Multi.Modifier" type="dword" data="00000011"/>
<value name="Multi.ArrowsModifier" type="dword" data="0000005b"/>
@ -845,13 +861,13 @@
<value name="KeyMacro31.Text" type="string" data=""/>
<value name="KeyMacro32" type="dword" data="00000000"/>
<value name="KeyMacro32.Text" type="string" data=""/>
<value name="CTS.VkBlock" type="hex" data="a4"/>
<value name="CTS.VkText" type="hex" data="a0"/>
<value name="CTS.VkBlock" type="hex" data="A4"/>
<value name="CTS.VkText" type="hex" data="A0"/>
<value name="CTS.VkAct" type="hex" data="00"/>
<value name="CTS.VkPrompt" type="hex" data="00"/>
<value name="FarGotoEditorVk" type="hex" data="a2"/>
<value name="FarGotoEditorVk" type="hex" data="A2"/>
<value name="DndLKey" type="hex" data="00"/>
<value name="DndRKey" type="hex" data="a2"/>
<value name="DndRKey" type="hex" data="A2"/>
<value name="WndDragKey" type="dword" data="00121101"/>
<value name="Multi.Unfasten" type="dword" data="00000000"/>
<value name="Key.DebugProcess" type="dword" data="00105b44"/>
@ -869,10 +885,16 @@
<value name="Key.BufPrUp" type="dword" data="00121121"/>
<value name="Key.BufPrDn" type="dword" data="00121122"/>
<value name="Key.ResetTerm" type="dword" data="00000000"/>
<value name="SetFocusParent" type="dword" data="0000a01b"/>
<value name="CheckUpdates" type="dword" data="00105b55"/>
<value name="Multi.NewWndConfirm" type="dword" data="00000000"/>
<value name="CloseToRightKey" type="dword" data="00000000"/>
<value name="Key.EditMenu" type="dword" data="00000000"/>
<value name="Key.EditMenu2" type="dword" data="00000000"/>
</key>
<value name="StartCreateDelay" type="ulong" data="100"/>
<value name="DefaultTerminalDebugLog" type="hex" data="00"/>
<value name="LastMonitor" type="string" data="0,0,1440,1050"/>
<value name="LastMonitor" type="string" data="1680,0,3600,1050"/>
<value name="Restore2ActiveMon" type="hex" data="00"/>
<value name="DownShowExOnTopMessage" type="hex" data="00"/>
<value name="EnvironmentSet" type="multi">
@ -902,6 +924,15 @@
<value name="StatusBar.Hide.TMode" type="hex" data="01"/>
<value name="StatusBar.Hide.RMode" type="hex" data="01"/>
<value name="StatusBar.Hide.CellI" type="hex" data="01"/>
<value name="Language" type="string" data="en"/>
<value name="AnsiLogCodes" type="hex" data="00"/>
<value name="ResetTerminalConfirm" type="hex" data="01"/>
<value name="RestoreInactive" type="hex" data="00"/>
<value name="AutoReloadEnvironment" type="hex" data="01"/>
<value name="AutoTrimSingleLine" type="hex" data="00"/>
<value name="StatusBar.Hide.InputGrouping" type="hex" data="00"/>
<value name="StatusBar.Hide.WMode" type="hex" data="01"/>
</key>
</key>
</key>

View File

@ -2,9 +2,9 @@
(echo.
echo ------------------------------------
echo set
echo Get Cmder env variables...
echo ------------------------------------
set
set | findstr -i -r "^aliases= architecture_bits ccall= cexec= ^clink_ ^cmder ^debug_output= fast_init= ^GIT_INSTALL_ROOT= ^git_locale= ^HOME= ^max_depth= ^nix_tools= ^path_position= ^path= ^PLINK_PROTOCOL= ^print_ ^SVN_SSH= ^time_init= ^user_aliases= ^verbose_output="
echo.
echo ------------------------------------

View File

@ -9,5 +9,5 @@ if "%cmder_init%" == "1" (
)
pushd "%CMDER_ROOT%"
call "%CMDER_ROOT%\vendor\init.bat" /f
call "%CMDER_ROOT%\vendor\init.bat" /f %*
popd

3
vendor/bin/create-cmdercfg.cmd vendored Normal file
View File

@ -0,0 +1,3 @@
@echo off
powershell -executionpolicy bypass -f "%cmder_root%\vendor\bin\create-cmdercfg.ps1" -shell cmd -outfile "%CMDER_CONFIG_DIR%\user_init.cmd"

30
vendor/bin/create-cmdercfg.ps1 vendored Normal file
View File

@ -0,0 +1,30 @@
[CmdletBinding()]
param(
[Parameter()]
[string]$shell = 'cmd',
[string]$outfile = "$env:cmder_config_dir\user_init.cmd"
)
if ($shell -match 'powershell') {
write-host "'$shell' is not supported at this time!"
exit 0
} elseif ($shell -match 'bash') {
write-host "'$shell' is not supported at this time!"
exit 0
} elseif ($shell -notMatch 'cmd') {
exit 0
}
$CmderModulePath = Join-path $env:cmder_root "vendor/psmodules/"
$CmderFunctions = Join-Path $CmderModulePath "Cmder.ps1"
. $CmderFunctions
if ($shell -match 'cmd') {
write-host "Generating Cmder Config for '$shell' shell in '$outfile'..."
templateExpand "$env:cmder_root\vendor\user_init.cmd.template" "$outfile"
} elseif ($shell -match 'powershell') {
write-host "'$shell' is not supported at this time!"
} elseif ($shell -match 'bash') {
write-host "'$shell' is not supported at this time!"
}

14
vendor/bin/excd.cmd vendored
View File

@ -1,6 +1,8 @@
@if "%~1"=="/?" (@cd %*)
@set excd=%*
@set excd=%excd:"=%
@if "%excd:~0,1%"=="~" (@set excd=%userprofile%\%excd:~1%)
@if not "%~1"=="/d" (@set excd_param="/d") else (@set excd_param=)
@cd %excd_param% "%excd%"
@echo off
set excd=%*
set excd=%excd:"=%
set excd_param=/d
if /i "%excd:~0,2%"=="/d" set "excd=%excd:~2%"
if "%excd:~0,1%"=="~" (set excd=%userprofile%\%excd:~1%)
if "%excd:~0,1%"=="/" (set excd_param=)
cd %excd_param% %excd%

24
vendor/bin/timer.cmd vendored
View File

@ -11,6 +11,7 @@ set /a hours=%end_h%-%start_h%
set /a mins=%end_m%-%start_m%
set /a secs=%end_s%-%start_s%
set /a ms=%end_ms%-%start_ms%
if %ms% lss 0 set /a secs = %secs% - 1 & set /a ms = 100%ms%
if %secs% lss 0 set /a mins = %mins% - 1 & set /a secs = 60%secs%
if %mins% lss 0 set /a hours = %hours% - 1 & set /a mins = 60%mins%
@ -20,3 +21,26 @@ if 1%ms% lss 100 set ms=0%ms%
:: Mission accomplished
set /a totalsecs = %hours%*3600 + %mins%*60 + %secs%
echo Elapsed Time: %hours%:%mins%:%secs%.%ms% (%totalsecs%.%ms%s total)
:: cleanup
set start=
set end=
set options=
set start_h=
set start_m=
set start_s=
set start_ms=
set end_h=
set end_m=
set end_s=
set end_ms=
set hours=
set mins=
set secs=
set ms=
set totalsecs=

62
vendor/clink.lua vendored
View File

@ -51,11 +51,37 @@ local function get_unknown_color()
end
---
-- Makes a string safe to use as the replacement in string.gsub
-- Escapes special characters in a string.gsub `find` parameter, so that it
-- can be matched as a literal plain text string, i.e. disable Lua pattern
-- matching. See "Patterns" (https://www.lua.org/manual/5.2/manual.html#6.4.1).
-- @param {string} text Text to escape
-- @returns {string} Escaped text
---
local function verbatim(s)
s = string.gsub(s, "%%", "%%%%")
return s
local function escape_gsub_find_arg(text)
return text and text:gsub("([-+*?.%%()%[%]$^])", "%%%1") or ""
end
---
-- Escapes special characters in a string.gsub `replace` parameter, so that it
-- can be replaced as a literal plain text string, i.e. disable Lua pattern
-- matching. See "Patterns" (https://www.lua.org/manual/5.2/manual.html#6.4.1).
-- @param {string} text Text to escape
-- @returns {string} Escaped text
---
local function escape_gsub_replace_arg(text)
return text and text:gsub("%%", "%%%%") or ""
end
---
-- Perform string.sub, but disable Lua pattern matching and just treat both
-- the `find` and `replace` parameters as a literal plain text replacement.
-- @param {string} str Text in which to perform find and replace
-- @param {string} find Text to find (plain text; not a Lua pattern)
-- @param {string} replace Replacement text (plain text; not a Lua pattern)
-- @returns {string} Copy of the input `str` with `find` replaced by `replace`
---
local function gsub_plain(str, find, replace)
return string.gsub(str, escape_gsub_find_arg(find), escape_gsub_replace_arg(replace))
end
-- Extracts only the folder name from the input Path
@ -153,7 +179,7 @@ local function set_prompt_filter()
end
if prompt_useHomeSymbol and string.find(cwd, clink.get_env("HOME")) then
cwd = string.gsub(cwd, clink.get_env("HOME"), prompt_homeSymbol)
cwd = gsub_plain(cwd, clink.get_env("HOME"), prompt_homeSymbol)
end
local uah = ''
@ -176,14 +202,14 @@ local function set_prompt_filter()
local version_control = prompt_includeVersionControl and "{git}{hg}{svn}" or ""
local prompt = "{uah}{cwd}" .. version_control .. cr .. get_lamb_color() .. "{env}{lamb}\x1b[0m "
prompt = string.gsub(prompt, "{uah}", uah)
prompt = string.gsub(prompt, "{cwd}", cwd)
prompt = string.gsub(prompt, "{env}", env)
clink.prompt.value = string.gsub(prompt, "{lamb}", prompt_lambSymbol)
prompt = gsub_plain(prompt, "{uah}", uah)
prompt = gsub_plain(prompt, "{cwd}", cwd)
prompt = gsub_plain(prompt, "{env}", env)
clink.prompt.value = gsub_plain(prompt, "{lamb}", prompt_lambSymbol)
end
local function percent_prompt_filter()
clink.prompt.value = string.gsub(clink.prompt.value, "{percent}", "%%")
clink.prompt.value = gsub_plain(clink.prompt.value, "{percent}", "%")
end
---
@ -532,13 +558,13 @@ local function git_prompt_filter()
color = colors.conflict
end
clink.prompt.value = string.gsub(clink.prompt.value, "{git}", " "..color.."("..verbatim(branch)..")")
clink.prompt.value = gsub_plain(clink.prompt.value, "{git}", " "..color.."("..branch..")")
return false
end
end
-- No git present or not in git file
clink.prompt.value = string.gsub(clink.prompt.value, "{git}", "")
clink.prompt.value = gsub_plain(clink.prompt.value, "{git}", "")
return false
end
@ -577,13 +603,13 @@ local function hg_prompt_filter()
end
local result = color .. "(" .. branch .. ")"
clink.prompt.value = string.gsub(clink.prompt.value, "{hg}", " "..verbatim(result))
clink.prompt.value = gsub_plain(clink.prompt.value, "{hg}", " "..result)
return false
end
end
-- No hg present or not in hg repo
clink.prompt.value = string.gsub(clink.prompt.value, "{hg}", "")
clink.prompt.value = gsub_plain(clink.prompt.value, "{hg}", "")
end
local function svn_prompt_filter()
@ -636,13 +662,13 @@ local function svn_prompt_filter()
color = colors.dirty
end
clink.prompt.value = string.gsub(clink.prompt.value, "{svn}", " "..color.."("..verbatim(branch)..")")
clink.prompt.value = gsub_plain(clink.prompt.value, "{svn}", " "..color.."("..branch..")")
return false
end
end
-- No svn present or not in svn file
clink.prompt.value = string.gsub(clink.prompt.value, "{svn}", "")
clink.prompt.value = gsub_plain(clink.prompt.value, "{svn}", "")
return false
end
@ -666,6 +692,10 @@ for _,lua_module in ipairs(clink.find_files(completions_dir..'*.lua')) do
end
end
-- If Cmder is launched with '/c [folderPath]', indicating Cmder is installed globally and
-- each user has a private '[folderPath]\config' folder, Clink won't know about the global
-- '%cmder_root%\config dir, so we need to load scripts from there before . Clink loads lua
-- scripts from the profile directory given to it when it was injected.
if clink.get_env('CMDER_USER_CONFIG') then
local cmder_config_dir = clink.get_env('CMDER_ROOT')..'/config/'
for _,lua_module in ipairs(clink.find_files(cmder_config_dir..'*.lua')) do

View File

@ -1,6 +1,10 @@
# For explanation of these and other settings see:
# https://chrisant996.github.io/clink/clink.html
# name: Expand envvars when completing
# type: boolean
match.expand_envvars = True
# name: Sets how command history expansion is applied
# type: enum
# options: off,on,not_squoted,not_dquoted,not_quoted

6
vendor/cmder.sh vendored
View File

@ -22,7 +22,11 @@ function runProfiled {
}
# We do this for bash as admin sessions since $CMDER_ROOT is not being set
if [ "$CMDER_ROOT" == "" ] ; then
if [ -z "$CMDER_ROOT" ] && [ -n "$cmder_root" ] ; then
export CMDER_ROOT=$(cygpath -u $cmder_root)
fi
if [ -z "$CMDER_ROOT" ] ; then
case "$ConEmuDir" in *\\*) CMDER_ROOT=$( cd "$(cygpath -u "$ConEmuDir")/../.." ; pwd );; esac
else
case "$CMDER_ROOT" in *\\*) CMDER_ROOT="$(cygpath -u "$CMDER_ROOT")";; esac

19
vendor/cmder_exinit vendored
View File

@ -26,15 +26,14 @@ function runProfiled {
unset profile_d_scripts
pushd "${1}" >/dev/null
if [ ! "x${ZSH_VERSION}" = "x" ]; then
if [ -n "${ZSH_VERSION}" ]; then
profile_d_scripts=$(ls *.zsh 2>/dev/null)
elif [ ! "x${BASH_VERSION}" = "x" ]; then
elif [ -n "${BASH_VERSION}" ]; then
profile_d_scripts=$(ls *.sh 2>/dev/null)
fi
if [ ! "x${profile_d_scripts}" = "x" ] ; then
if [ -n "${profile_d_scripts}" ] ; then
for x in ${profile_d_scripts} ; do
echo Sourcing "${1}/${x}"...
. "${1}/${x}"
done
fi
@ -44,23 +43,23 @@ function runProfiled {
# Check that we haven't already been sourced.
[[ -z ${CMDER_EXINIT} ]] && CMDER_EXINIT="1" || return
if [ -z "$CMDER_ROOT" ] && [ -n "$cmder_root" ] ; then
export CMDER_ROOT=$(cygpath -u $cmder_root)
fi
# We do this for bash as admin sessions since $CMDER_ROOT is not being set
if [ "$CMDER_ROOT" = "" -a "$ConEmuDir" != "" ] ; then
if [ -d "${ConEmuDir}../../vendor" ] ; then
if [ -d "${ConEmuDir}/../../vendor" ] ; then
case "$ConEmuDir" in *\\*) CMDER_ROOT=$( cd "$(cygpath -u "$ConEmuDir")/../.." ; pwd );; esac
else
echo "Running in ConEmu without Cmder, skipping Cmder integration."
fi
elif [ "$CMDER_ROOT" != "" ] ; then
case "$CMDER_ROOT" in *\\*) CMDER_ROOT="$(cygpath -u "$CMDER_ROOT")";; esac
fi
if [ ! "$CMDER_ROOT" = "" ] ; then
if [ -n "$CMDER_ROOT" ] ; then
# Remove any trailing '/'
CMDER_ROOT=$(echo $CMDER_ROOT | sed 's:/*$::')
echo "Using \"CMDER_ROOT\" at \"${CMDER_ROOT}\"."
export CMDER_ROOT
PATH=${CMDER_ROOT}/bin:${CMDER_ROOT}/vendor/bin:$PATH:${CMDER_ROOT}

View File

@ -48,15 +48,15 @@ prompt_overrideSvnStatusOptIn = false
-- Colors: https://github.com/cmderdev/cmder/wiki/Customization#list-of-colors
-- Effects: https://github.com/cmderdev/cmder/wiki/Customization#list-of-effects
--
-- Green: "\x1b[1;33;49m"
-- Yellow: "\x1b[1;32;49m"
-- Green: "\x1b[1;32;49m"
-- Yellow: "\x1b[1;33;49m"
-- Light Grey: "\x1b[1;30;49m"
-- Prompt Element Colors
uah_color = "\x1b[1;33;49m" -- Green = uah = [user]@[hostname]
cwd_color = "\x1b[1;32;49m" -- Yellow cwd = Current Working Directory
uah_color = "\x1b[1;33;49m" -- Yellow uah = [user]@[hostname]
cwd_color = "\x1b[1;32;49m" -- Green cwd = Current Working Directory
lamb_color = "\x1b[1;30;49m" -- Light Grey = Lambda Color
clean_color = "\x1b[37;1m"
dirty_color = "\x1b[33;3m" -- Yellow, Italic
conflict_color = "\x1b[31;1m" -- Red, Bold
unknown_color = "\x1b[37;1m" -- White = No VCS Status Branch Color
unknown_color = "\x1b[37;1m" -- White, Bold = No VCS Status Branch Color

70
vendor/git-prompt.sh vendored
View File

@ -1,26 +1,35 @@
# Returns 1 if git status for Cmder is disabled, otherwise returns 0
function getGitStatusSetting() {
gitStatusSetting=$(git --no-pager config -l 2>/dev/null)
local gitConfig
if [[ -n ${gitStatusSetting} ]] && [[ ${gitStatusSetting} =~ cmder.status=false ]] || [[ ${gitStatusSetting} =~ cmder.shstatus=false ]]
# Get all git config entries for the current repository without pager
gitConfig=$(git --no-pager config -l 2>/dev/null) || return 0 # treat failure as enabled
# Check if git status for Cmder is disabled
if [[ $gitConfig =~ (^|$'\n')cmder\.status=false($|$'\n') ]] || \
[[ $gitConfig =~ (^|$'\n')cmder\.shstatus=false($|$'\n') ]]
then
echo false
else
echo true
return 1 # disabled
fi
return 0
}
# Prints current branch or detached HEAD short commit hash
function getSimpleGitBranch() {
gitDir=$(git rev-parse --git-dir 2>/dev/null)
if [ -z "$gitDir" ]; then
return 0
fi
local gitDir
gitDir=$(git rev-parse --git-dir 2>/dev/null) || return 0
headContent=$(< "$gitDir/HEAD")
if [[ "$headContent" == "ref: refs/heads/"* ]]
local headFile="$gitDir/HEAD"
[ -f "$headFile" ] || return 0
local headContent
headContent=$(< "$headFile")
if [[ "$headContent" =~ ^ref:\ refs/heads/(.+)$ ]]
then
echo " (${headContent:16})"
echo " (${BASH_REMATCH[1]})"
else
echo " (HEAD detached at ${headContent:0:7})"
echo " (HEAD detached at ${headContent:0:7})"
fi
}
@ -33,18 +42,18 @@ fi
if test -f ~/.config/git/git-prompt.sh
then
if [[ $(getGitStatusSetting) == true ]]
if getGitStatusSetting
then
. ~/.config/git/git-prompt.sh
fi
else
PS1='\[\033]0;$MSYSTEM:${PWD//[^[:ascii:]]/?}\007\]' # set window title
# PS1="$PS1"'\n' # new line
PS1="$PS1"'\[\033[32m\]' # change to green
# Taken parts from https://github.com/git-for-windows/build-extra/blob/main/git-extra/git-prompt.sh
PS1='\[\033]0;${TITLEPREFIX:+$TITLEPREFIX:}${PWD//[^[:ascii:]]/?}\007\]' # set window title to TITLEPREFIX (if set) and current working directory
# PS1="$PS1"'\n' # new line (disabled)
PS1="$PS1"'\[\033[32m\]' # change to green and bold
PS1="$PS1"'\u@\h ' # user@host<space>
# PS1="$PS1"'\[\033[35m\]' # change to purple
# PS1="$PS1"'$MSYSTEM ' # show MSYSTEM
PS1="$PS1"'\[\033[33m\]' # change to brownish yellow
PS1="$PS1${MSYSTEM:+\[\033[35m\]$MSYSTEM }" # show MSYSTEM in purple (if set)
PS1="$PS1"'\[\033[1;33m\]' # change to dark yellow in bold
PS1="$PS1"'\w' # current working directory
if test -z "$WINELOADERNOEXEC"
then
@ -55,7 +64,7 @@ else
if test -f "$COMPLETION_PATH/git-prompt.sh"
then
. "$COMPLETION_PATH/git-completion.bash"
if [[ $(getGitStatusSetting) == true ]]
if getGitStatusSetting
then
. "$COMPLETION_PATH/git-prompt.sh"
PS1="$PS1"'\[\033[36m\]' # change color to cyan
@ -66,9 +75,22 @@ else
fi
fi
fi
PS1="$PS1"'\[\033[0m\]' # change color
PS1="$PS1"'\[\033[0m\]' # reset color
PS1="$PS1"'\n' # new line
PS1="$PS1"'λ ' # prompt: always λ
PS1="$PS1"'\[\033[30;1m\]' # change color to grey in bold
PS1="$PS1"'λ ' # prompt: Cmder uses λ
PS1="$PS1"'\[\033[0m\]' # reset color
fi
MSYS2_PS1="$PS1" # for detection by MSYS2 SDK's bash.basrc
MSYS2_PS1="$PS1" # for detection by MSYS2 SDK's bash.basrc
# Evaluate all user-specific Bash completion scripts (if any)
if test -z "$WINELOADERNOEXEC"
then
for c in "$HOME"/bash_completion.d/*.bash
do
# Handle absence of any scripts (or the folder) gracefully
test ! -f "$c" ||
. "$c"
done
fi

118
vendor/init.bat vendored
View File

@ -166,9 +166,24 @@ if "%PROCESSOR_ARCHITECTURE%"=="x86" (
set CMDER_CLINK=0
)
if defined CMDER_USER_CONFIG (
if exist "%CMDER_ROOT%\config\user_init.cmd" (
call "%CMDER_ROOT%\config\user_init.cmd"
exit /b
) else if exist "%CMDER_USER_CONFIG%\config\user_init.cmd" (
call "%CMDER_USER_CONFIG%\config\user_init.cmd"
exit /b
)
) else if exist "%CMDER_ROOT%\config\user_init.cmd" (
call "%CMDER_ROOT%\config\user_init.cmd"
exit /b
)
if "%CMDER_CLINK%" == "1" (
REM TODO: Detect if clink is already injected, if so goto :CLINK_FINISH
goto :INJECT_CLINK
) else if "%CMDER_CLINK%" == "2" (
goto :CLINK_FINISH
)
goto :SKIP_CLINK
@ -205,6 +220,7 @@ goto :SKIP_CLINK
)
"%CMDER_ROOT%\vendor\clink\clink_%clink_architecture%.exe" inject --quiet --profile "%CMDER_CONFIG_DIR%" --scripts "%CMDER_ROOT%\vendor"
set CMDER_CLINK=2
:: Check if a fatal error occurred when trying to inject Clink
if errorlevel 2 (
@ -299,7 +315,7 @@ if exist "%CMDER_ROOT%\vendor\git-for-windows" (
)
:SPECIFIED_GIT
%print_debug% init.bat "Using /GIT_INSTALL_ROOT..."
%print_debug% init.bat "Using specified GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%...."
goto :CONFIGURE_GIT
:FOUND_GIT
@ -308,8 +324,13 @@ goto :CONFIGURE_GIT
:CONFIGURE_GIT
%print_debug% init.bat "Using Git from '%GIT_INSTALL_ROOT%..."
:: Add git to the path
if exist "%GIT_INSTALL_ROOT%\cmd\git.exe" %lib_path% enhance_path "%GIT_INSTALL_ROOT%\cmd" ""
%print_debug% init.bat "START - git.exe(prepend): Env Var - PATH=%path%"
if exist "%GIT_INSTALL_ROOT%\cmd\git.exe" (
set "path=%GIT_INSTALL_ROOT%\cmd;%path%"
)
%print_debug% init.bat "END - git.exe(prepend): Env Var - PATH=%path%"
:: Add the unix commands at the end to not shadow windows commands like `more` and `find`
if %nix_tools% equ 1 (
@ -320,16 +341,30 @@ if %nix_tools% equ 1 (
set "path_position="
)
%print_debug% init.bat "START - nix_tools(%path_position%): Env Var - PATH=%path%"
if %nix_tools% geq 1 (
if exist "%GIT_INSTALL_ROOT%\mingw32" (
%lib_path% enhance_path "%GIT_INSTALL_ROOT%\mingw32\bin" %path_position%
if "%path_position%" == "append" (
set "path=%path%;%GIT_INSTALL_ROOT%\mingw32\bin"
) else (
set "path=%GIT_INSTALL_ROOT%\mingw32\bin;%path%"
)
) else if exist "%GIT_INSTALL_ROOT%\mingw64" (
%lib_path% enhance_path "%GIT_INSTALL_ROOT%\mingw64\bin" %path_position%
if "%path_position%" == "append" (
set "path=%path%;%GIT_INSTALL_ROOT%\mingw64\bin"
) else (
set "path=%GIT_INSTALL_ROOT%\mingw64\bin;%path%"
)
)
if exist "%GIT_INSTALL_ROOT%\usr\bin" (
%lib_path% enhance_path "%GIT_INSTALL_ROOT%\usr\bin" %path_position%
if "%path_position%" == "append" (
set "path=%path%;%GIT_INSTALL_ROOT%\usr\bin"
) else (
set "path=%GIT_INSTALL_ROOT%\usr\bin;%path%"
)
)
)
%print_debug% init.bat "END - nix_tools(%path_position%): Env Var - PATH=%path%"
:SET_ENV
@ -362,8 +397,7 @@ if defined git_locale (
)
endlocal && set LANG=%LANG%
%print_debug% init.bat "Env Var - GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%"
%print_debug% init.bat "Found Git in: '%GIT_INSTALL_ROOT%'"
%print_debug% init.bat "Found Git in: 'GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%'"
goto :PATH_ENHANCE
:NO_GIT
@ -371,14 +405,32 @@ goto :PATH_ENHANCE
endlocal
:PATH_ENHANCE
%lib_path% enhance_path "%CMDER_ROOT%\vendor\bin"
%print_debug% init.bat "START - vendor/bin(prepend): Env Var - PATH=%path%"
set "path=%CMDER_ROOT%\vendor\bin;%path%"
%print_debug% init.bat "END - vendor/bin(prepend): Env Var - PATH=%path%"
:USER_CONFIG_START
%lib_path% enhance_path_recursive "%CMDER_ROOT%\bin" 0 %max_depth%
if defined CMDER_USER_BIN (
%lib_path% enhance_path_recursive "%CMDER_USER_BIN%" 0 %max_depth%
%print_debug% init.bat "START - bin(prepend): Env Var - PATH=%path%"
if %max_depth% gtr 1 (
%lib_path% enhance_path_recursive "%CMDER_ROOT%\bin" 0 %max_depth%
) else (
set "path=%CMDER_ROOT%\bin;%path%"
)
%lib_path% enhance_path "%CMDER_ROOT%" append
%print_debug% init.bat "END - bin(prepend): Env Var - PATH=%path%"
if defined CMDER_USER_BIN if defined CMDER_USER_ROOT (
%print_debug% init.bat "START - user_bin(prepend): Env Var - PATH=%path%"
if %max_depth% gtr 1 (
%lib_path% enhance_path_recursive "%CMDER_USER_BIN%" 0 %max_depth%
) else (
set "path=%CMDER_USER_ROOT%\bin;%path%"
)
%print_debug% init.bat "END - user_bin(prepend): Env Var - PATH=!path!"
)
%print_debug% init.bat "START - cmder_root(append): Env Var - PATH=%path%"
set "path=%path%;%CMDER_ROOT%"
%print_debug% init.bat "END - cmder_root(append): Env Var - PATH=%path%"
:: Drop *.bat and *.cmd files into "%CMDER_ROOT%\config\profile.d"
:: to run them at startup.
@ -426,7 +478,7 @@ if "%CMDER_ALIASES%" == "1" (
)
:: Add aliases to the environment
type "%user_aliases%" | findstr /b /l /i "history=cat " >nul
type "%user_aliases%" | %WINDIR%\System32\findstr /b /l /i "history=cat " >nul
if "%ERRORLEVEL%" == "0" (
echo Migrating alias 'history' to new Clink 1.x.x...
call "%CMDER_ROOT%\vendor\bin\alias.cmd" /d history
@ -487,12 +539,40 @@ if "%CMDER_ALIASES%" == "1" if exist "%CMDER_ROOT%\bin\alias.bat" if exist "%CMD
set initialConfig=
:CMDER_CONFIGURED
if not defined CMDER_CONFIGURED set CMDER_CONFIGURED=1
if not exist "%CMDER_CONFIG_DIR%\user_init.cmd" (
powershell -executionpolicy bypass -f "%cmder_root%\vendor\bin\create-cmdercfg.ps1" -shell cmd -outfile "%CMDER_CONFIG_DIR%\user_init.cmd"
set CMDER_INIT_END=%time%
if %time_init% gtr 0 (
"%cmder_root%\vendor\bin\timer.cmd" "%CMDER_INIT_START%" "%CMDER_INIT_END%"
if not exist "%CMDER_ROOT%\config\user_init.cmd" (
%print_error% "Failed to generate Cmder config"
)
)
:CMDER_CONFIGURED
if not defined CMDER_CONFIGURED set CMDER_CONFIGURED=1
set CMDER_INIT_END=%time%
if "%time_init%" == "1" if "%CMDER_INIT_END%" neq "" if "%CMDER_INIT_START%" neq "" (
call "%cmder_root%\vendor\bin\timer.cmd" "%CMDER_INIT_START%" "%CMDER_INIT_END%"
)
:CLEANUP
set architecture_bits=
set CMDER_ALIASES=
set CMDER_INIT_END=
set CMDER_INIT_START=
set CMDER_USER_FLAGS=
set CMDER_CLINK=
set debug_output=
set fast_init=
set max_depth=
set nix_tools=
set path_position=
set print_debug=
set print_error=
set print_verbose=
set print_warning=
set time_init=
set verbose_output=
set user_aliases=
exit /b

View File

@ -10,9 +10,8 @@ if "%~1" == "/h" (
exit /b
:help
:::===============================================================================
:::show_subs - shows all sub routines in a .bat/.cmd file with documentation
:::help - shows all sub routines in a .bat/.cmd file with documentation
:::.
:::include:
:::.
@ -20,16 +19,15 @@ exit /b
:::.
:::usage:
:::.
::: %lib_base% show_subs "file"
::: %lib_base% help "file"
:::.
:::options:
:::.
::: file <in> full path to file containing lib_routines to display
:::.
:::-------------------------------------------------------------------------------
for /f "tokens=* delims=:" %%a in ('type "%~1" ^| %WINDIR%\System32\findstr /i /r "^:::"') do (
rem echo a="%%a"
:help
for /f "tokens=* delims=:" %%a in ('%WINDIR%\System32\findstr /i /r "^:::" "%~1"') do (
if "%%a"=="." (
echo.
) else if /i "%%a" == "usage" (
@ -44,9 +42,13 @@ exit /b
pause
exit /b
:cmder_shell
:::===============================================================================
:::show_subs - shows all sub routines in a .bat/.cmd file with documentation
:::cmder_shell - Initializes the Cmder shell environment variables
:::.
:::description:
:::.
::: This routine sets up the Cmder shell environment by detecting the
::: command shell and initializing related variables.
:::.
:::include:
:::.
@ -55,15 +57,30 @@ exit /b
:::usage:
:::.
::: %lib_base% cmder_shell
:::.
:::options:
:::.
::: file <in> full path to file containing lib_routines to display
:::.
:::-------------------------------------------------------------------------------
:cmder_shell
call :detect_comspec %ComSpec%
exit /b
:::===============================================================================
:::detect_comspec - Detects the command shell being used:::
:::.
:::description:
:::.
::: This function sets the CMDER_SHELL variable to the name of the
::: detected command shell. It also initializes the CMDER_CLINK and
::: CMDER_ALIASES variables if they are not already defined.
:::.
:::include:
:::.
::: call "lib_base.cmd"
:::.
:::usage:
:::.
::: %lib_base% detect_comspec %ComSpec%
:::-------------------------------------------------------------------------------
:detect_comspec
set CMDER_SHELL=%~n1
if not defined CMDER_CLINK (
@ -74,6 +91,27 @@ exit /b
)
exit /b
:::===============================================================================
:::update_legacy_aliases - Updates the legacy alias definitions in the user_aliases file
:::.
:::description:
:::.
::: This function checks if the user_aliases file contains the marker
::: ";= Add aliases below here". If the marker is not found, it creates
::: an initial user_aliases store by copying the default user_aliases file
::: from the CMDER_ROOT directory. If the CMDER_USER_CONFIG environment
::: variable is defined, it creates a backup of the existing user_aliases
::: file before copying the default file.
:::.
:::include:
:::.
::: call "lib_base.cmd"
:::.
:::usage:
:::.
::: %lib_base% update_legacy_aliases
:::-------------------------------------------------------------------------------
:update_legacy_aliases
type "%user_aliases%" | %WINDIR%\System32\findstr /i ";= Add aliases below here" >nul
if "%errorlevel%" == "1" (

View File

@ -12,7 +12,6 @@ if "%~1" == "/h" (
exit /b
:read_version
:::===============================================================================
:::read_version - Get the git.exe version
:::.
@ -34,6 +33,7 @@ exit /b
::: GIT_VERSION_[GIT SCOPE] <out> Env variable containing Git semantic version string
:::-------------------------------------------------------------------------------
:read_version
:: clear the variables
set GIT_VERSION_%~1=
@ -55,6 +55,7 @@ exit /b
set "GIT_VERSION=%%C"
) else (
echo "'git --version' returned an improper version string!"
%print_debug% :read_version "returned string: '%%A %%B %%C' by executable path: %git_executable%"
pause
exit /b
)
@ -63,7 +64,6 @@ exit /b
exit /b
:parse_version
:::===============================================================================
:::parse_version - Parse semantic version string 'x.x.x.x' and return the pieces
:::.
@ -88,6 +88,7 @@ exit /b
::: [SCOPE]_BUILD <out> Scoped Build version.
:::-------------------------------------------------------------------------------
:parse_version
:: process a `x.x.x.xxxx.x` formatted string
%print_debug% :parse_version "ARGV[1]=%~1, ARGV[2]=%~2"
@ -110,9 +111,8 @@ exit /b
:endlocal_set_git_version
:validate_version
:::===============================================================================
:::validate_version - Validate semantic version string 'x.x.x.x'.
:::validate_version - Validate semantic version string 'x.x.x.x'
:::.
:::include:
:::.
@ -128,6 +128,7 @@ exit /b
::: [VERSION] <in> Semantic version String. Ex: 1.2.3.4
:::-------------------------------------------------------------------------------
:validate_version
:: now parse the version information into the corresponding variables
%print_debug% :validate_version "ARGV[1]=%~1, ARGV[2]=%~2"
@ -142,9 +143,8 @@ exit /b
)
exit /b
:compare_versions
:::===============================================================================
:::compare_version - Compare semantic versions return latest version.
:::compare_version - Compare semantic versions and return latest version
:::.
:::include:
:::.
@ -160,6 +160,7 @@ exit /b
::: [SCOPE2] <in> Example: VENDOR
:::-------------------------------------------------------------------------------
:compare_versions
:: checks all major, minor, patch and build variables for the given arguments.
:: whichever binary that has the most recent version will be used based on the return code.
@ -184,7 +185,12 @@ exit /b
endlocal & exit /b 0
:::===============================================================================
:::is_git_shim
:::is_git_shim - Check if the directory has a git.shim file
:::.
:::description:
:::.
::: Shim is a small helper program for Scoop that calls the executable configured in git.shim file
::: See: github.com/ScoopInstaller/Shim and github.com/cmderdev/cmder/pull/1905
:::.
:::include:
:::.
@ -201,7 +207,7 @@ exit /b
:is_git_shim
pushd "%~1"
:: check if there's shim - and if yes follow the path
:: check if there is a shim file - if yes, read the actual executable path
setlocal enabledelayedexpansion
if exist git.shim (
for /F "tokens=2 delims== " %%I in (git.shim) do (
@ -218,7 +224,7 @@ exit /b
exit /b
:::===============================================================================
:::compare_git_versions
:::compare_git_versions - Compare the user git version against the vendored version
:::.
:::include:
:::.
@ -252,7 +258,7 @@ exit /b
:: if the user provided git executable is not found
IF ERRORLEVEL -255 IF NOT ERRORLEVEL -254 (
:: if not exist "%git_executable%" (
%print_debug% ":compare_git_versions" "No git at "%git_executable%" found."
%print_debug% ":compare_git_versions" "No git at '%git_executable%' found."
set test_dir=
)
)
@ -261,7 +267,7 @@ exit /b
exit /b
:::===============================================================================
:::get_user_git_version - get the version information for the user provided git binary
:::get_user_git_version - Get the version information for the user provided git binary
:::.
:::include:
:::.
@ -277,5 +283,4 @@ exit /b
%lib_git% read_version USER "%test_dir%" 2>nul
%print_debug% ":get_user_git_version" "get_user_git_version GIT_VERSION_USER: %GIT_VERSION_USER%"
%lib_git% validate_version USER %GIT_VERSION_USER%
exit /b
exit /b

View File

@ -1,6 +1,5 @@
@echo off
call "%~dp0lib_base.cmd"
call "%%~dp0lib_console"
set lib_path=call "%~dp0lib_path.cmd"
@ -11,6 +10,13 @@ if "%~1" == "/h" (
call :%*
)
setlocal enabledelayedexpansion
if not defined find_pathext (
set "find_pathext=!PATHEXT:;= !"
set "find_pathext=!find_pathext:.=\.!"
)
endlocal & set "find_pathext=%find_pathext%"
exit /b
:enhance_path
@ -32,13 +38,12 @@ exit /b
:::options:
:::
::: append <in> Append to the path env variable rather than pre-pend.
::B
:::
:::
:::output:
:::
::: path <out> Sets the path env variable if required.
:::-------------------------------------------------------------------------------
if "%~1" neq "" (
set "add_path=%~1"
) else (
@ -52,7 +57,8 @@ exit /b
set "position="
)
dir "%add_path%" | findstr -i "\.COM \.EXE \.BAT \.CMD \.PS1 \.VBS" >NUL
dir "%add_path%" 2>NUL | findstr -i -e "%find_pathext%" >NUL
if "%ERRORLEVEL%" == "0" (
set "add_to_path=%add_path%"
) else (
@ -81,20 +87,20 @@ exit /b
echo "!path!"|!WINDIR!\System32\findstr >nul /I /R /C:";!find_query!;"
call :set_found
)
%print_debug% :enhance_path "Env Var INSIDE PATH !find_query! - found=!found!"
%print_debug% :enhance_path "Env Var INSIDE PATH !find_query! - found=!found!"
if /i "!position!" == "append" (
if "!found!" == "0" (
echo "!path!"|!WINDIR!\System32\findstr >nul /I /R /C:";!find_query!\"$"
call :set_found
)
%print_debug% :enhance_path "Env Var END PATH !find_query! - found=!found!"
%print_debug% :enhance_path "Env Var END PATH !find_query! - found=!found!"
) else (
if "!found!" == "0" (
echo "!path!"|!WINDIR!\System32\findstr >nul /I /R /C:"^\"!find_query!;"
call :set_found
)
%print_debug% :enhance_path "Env Var BEGIN PATH !find_query! - found=!found!"
%print_debug% :enhance_path "Env Var BEGIN PATH !find_query! - found=!found!"
)
endlocal & set found=%found%
@ -129,13 +135,12 @@ exit /b
exit /b
:changed
%print_debug% :enhance_path "END Env Var - PATH=%path%"
%print_debug% :enhance_path "Env Var %find_query% - found=%found%"
%print_debug% :enhance_path "END Env Var - PATH=%path%"
%print_debug% :enhance_path "Env Var %find_query% - found=%found%"
exit /b
exit /b
:set_found
if "%ERRORLEVEL%" == "0" (
set found=1
@ -144,8 +149,12 @@ exit /b
exit /b
:enhance_path_recursive
call :set_path_recursive "%~1" "%~2" "%~3"
exit /b
:set_path_recursive
:::===============================================================================
:::enhance_path_recursive - Add a directory and subs to the path env variable if
:::set_path_recursive - Add a directory and subs to the path env variable if
::: required.
:::.
:::include:
@ -154,7 +163,7 @@ exit /b
:::.
:::usage:
:::.
::: call "%~DP0lib_path" enhance_path_recursive "[dir_path]" [max_depth] [append]
::: call "%~DP0lib_path" set_path_recursive "[dir_path]" [max_depth] [append]
:::.
:::required:
:::.
@ -186,7 +195,7 @@ exit /b
set "position="
)
dir "%add_path%" 2>NUL | findstr -i "\.COM \.EXE \.BAT \.CMD \.PS1 \.VBS" >NUL
dir "%add_path%" 2>NUL | findstr -i -e "%find_pathext%" >NUL
if "%ERRORLEVEL%" == "0" (
set "add_to_path=%add_path%"
@ -196,7 +205,11 @@ exit /b
if "%fast_init%" == "1" (
if "%add_to_path%" neq "" (
call :enhance_path "%add_to_path%" %position%
if "%position%" == "append" (
set "path=%path%;%add_to_path%"
) else (
set "path=%add_to_path%;%path%"
)
)
)
@ -205,15 +218,19 @@ exit /b
exit /b
)
%print_debug% :enhance_path_recursive "Env Var - add_path=%add_to_path%"
%print_debug% :enhance_path_recursive "Env Var - position=%position%"
%print_debug% :enhance_path_recursive "Env Var - depth=%depth%"
%print_debug% :enhance_path_recursive "Env Var - max_depth=%max_depth%"
%print_debug% :set_path_recursive "Env Var - add_path=%add_to_path%"
%print_debug% :set_path_recursive "Env Var - position=%position%"
%print_debug% :set_path_recursive "Env Var - depth=%depth%"
%print_debug% :set_path_recursive "Env Var - max_depth=%max_depth%"
if %max_depth% gtr %depth% (
if "%add_to_path%" neq "" (
%print_debug% :enhance_path_recursive "Adding parent directory - '%add_to_path%'"
call :enhance_path "%add_to_path%" %position%
%print_debug% :set_path_recursive "Adding parent directory - '%add_to_path%'"
if "%position%" == "append" (
set "path=%path%;%add_to_path%"
) else (
set "path=%add_to_path%;%path%"
)
)
call :set_depth
call :loop_depth
@ -223,7 +240,7 @@ exit /b
exit /b
: set_depth
:set_depth
set /a "depth=%depth%+1"
exit /b
@ -233,10 +250,9 @@ exit /b
)
for /d %%i in ("%add_path%\*") do (
%print_debug% :enhance_path_recursive "Env Var BEFORE - depth=%depth%"
%print_debug% :enhance_path_recursive "Found Subdirectory - '%%~fi'"
call :enhance_path_recursive "%%~fi" %depth% %max_depth% %position%
%print_debug% :enhance_path_recursive "Env Var AFTER- depth=%depth%"
%print_debug% :set_path_recursive "Env Var BEFORE - depth=%depth%"
%print_debug% :set_path_recursive "Found Subdirectory - '%%~fi'"
call :set_path_recursive "%%~fi" %depth% %max_depth% %position%
%print_debug% :set_path_recursive "Env Var AFTER- depth=%depth%"
)
exit /b

View File

@ -12,26 +12,26 @@ if "%~1" == "/h" (
exit /b
:run_profile_d
:::===============================================================================
:::run_profile_d - Run all scripts in the passed dir path
:::
:::run_profile_d - Run all scripts in the passed directory path
:::.
:::include:
:::
:::.
::: call "lib_profile.cmd"
:::
:::.
:::usage:
:::
:::.
::: %lib_profile% "[dir_path]"
:::
:::.
:::required:
:::
:::.
::: [dir_path] <in> Fully qualified directory path containing init *.cmd|*.bat.
::: Example: "c:\bin"
:::
:::.
::: path <out> Sets the path env variable if required.
:::-------------------------------------------------------------------------------
:run_profile_d
if not exist "%~1" (
mkdir "%~1"
)
@ -43,4 +43,3 @@ exit /b
)
popd
exit /b

2
vendor/profile.ps1 vendored
View File

@ -86,7 +86,7 @@ if ($null -ne $ENV:GIT_INSTALL_ROOT) {
}
if (Get-Command -Name "vim" -ErrorAction SilentlyContinue) {
New-Alias -name "vi" -value vim
New-Alias -name "vi" -value vim -errorAction SilentlyContinue
}
if (Get-Module PSReadline -ErrorAction "SilentlyContinue") {

View File

@ -18,7 +18,8 @@ function readVersion($gitPath) {
}
function isGitShim($gitPath) {
# check if there's shim - and if yes follow the path
# check if there is a shim file - if yes, read the actual executable path
# See: github.com/ScoopInstaller/Shim
if (Test-Path "${gitPath}\git.shim") {
$shim = (get-content "${gitPath}\git.shim")
@ -176,3 +177,29 @@ function getGitStatusSetting() {
return $true
}
function yOrn( $question ) {
Do {
$Answer = Read-Host -Prompt "`n${question}? (y/n) "
}
Until ($Answer -eq 'y' -or $Answer -eq 'n' -or $Answer -eq 'yes' -or $Answer -eq 'no')
return $Answer
}
function templateExpand($template_filename, $outfile) {
$template = Get-Content "$template_filename" -Raw
$expanded = Invoke-Expression "@`"`r`n$template`r`n`"@"
$overwrite = 'y'
if ((test-path "$outfile")) {
$overwrite = yOrn "'$outfile' already exists do you want to overwrite it"
}
if ($overwrite -match 'y') {
$expanded | out-file -ErrorAction silentlycontinue -encoding ascii "$outfile"
} else {
write-host "Skipping Cmder '$shell' config generation at user request!"
}
}

17
vendor/sources.json vendored
View File

@ -1,13 +1,18 @@
[
{
"name": "windows-terminal",
"version": "1.20.11271.0",
"url": "https://github.com/microsoft/terminal/releases/download/v1.20.11271.0/Microsoft.WindowsTerminal_1.20.11271.0_x64.zip"
},
{
"name": "git-for-windows",
"version": "2.41.0.windows.3",
"url": "https://github.com/git-for-windows/git/releases/download/v2.41.0.windows.3/PortableGit-2.41.0.3-64-bit.7z.exe"
"version": "2.49.0.windows.1",
"url": "https://github.com/git-for-windows/git/releases/download/v2.49.0.windows.1/PortableGit-2.49.0-64-bit.7z.exe"
},
{
"name": "clink",
"version": "1.5.1",
"url": "https://github.com/chrisant996/clink/releases/download/v1.5.1/clink.1.5.1.1e9e51.zip"
"version": "1.7.14",
"url": "https://github.com/chrisant996/clink/releases/download/v1.7.14/clink.1.7.14.843933.zip"
},
{
"name": "conemu-maximus5",
@ -16,7 +21,7 @@
},
{
"name": "clink-completions",
"version": "0.4.10",
"url": "https://github.com/vladimir-kotikov/clink-completions/archive/v0.4.10.zip"
"version": "0.6.2",
"url": "https://github.com/vladimir-kotikov/clink-completions/archive/v0.6.2.zip"
}
]

51
vendor/start_git_bash.cmd vendored Normal file
View File

@ -0,0 +1,51 @@
@echo off
if not defined CMDER_ROOT (
if defined ConEmuDir (
for /f "delims=" %%i in ("%ConEmuDir%\..\..") do (
set "CMDER_ROOT=%%~fi"
)
) else (
for /f "delims=" %%i in ("%~dp0\..") do (
set "CMDER_ROOT=%%~fi"
)
)
)
if defined ConEmuDir (
set "gitCommand=--command=%ConEmuBaseDirShort%\conemu-msys2-64.exe"
)
if exist "%CMDER_ROOT%\vendor\git-for-windows" (
set "PATH=%CMDER_ROOT%\vendor\git-for-windows\usr\bin;%PATH%"
set "gitCmd=%CMDER_ROOT%\vendor\git-for-windows\git-cmd.exe"
set "bashCmd=%CMDER_ROOT%\vendor\git-for-windows\usr\bin\bash.exe"
) else if exist "%ProgramFiles%\git" (
set "PATH=%ProgramFiles%\git\usr\bin;%PATH%"
set "gitCmd=%ProgramFiles%\git\git-cmd.exe"
set "bashCmd=%ProgramFiles%\git\usr\bin\bash.exe"
if not exist "%ProgramFiles%\git\etc\profile.d\cmder_exinit.sh" (
echo Run 'mklink "%ProgramFiles%\git\etc\profile.d\cmder_exinit.sh" "%CMDER_ROOT%\vendor\cmder_exinit"' in 'cmd::Cmder as Admin' to use Cmder with external Git Bash
echo.
echo or
echo.
echo Run 'echo "" ^> "%ProgramFiles%\git\etc\profile.d\cmder_exinit.sh"' in 'cmd::Cmder as Admin' to disable this message.
)
) else if exist "%ProgramFiles(x86)%\git" (
set "PATH=%ProgramFiles(x86)%\git\usr\bin;%PATH%"
set "gitCmd=%ProgramFiles(x86)%\git\git-cmd.exe"
set "bashCmd=%ProgramFiles(x86)%\git\usr\bin\bash.exe"
if not exist "%ProgramFiles(x86)%\git\etc\profile.d\cmder_exinit.sh" (
echo Run 'mklink "%ProgramFiles^(x86^)%\git\etc\profile.d\cmder_exinit.sh" "%CMDER_ROOT%\vendor\cmder_exinit"' in 'cmd::Cmder as Admin' to use Cmder with external Git Bash
echo.
echo or
echo.
echo Run 'echo "" ^> "%ProgramFiles^(x86^)%\git\etc\profile.d\cmder_exinit.sh"' in 'cmd::Cmder as Admin' to disable this message.
)
)
if defined ConEmuDir (
"%gitCmd%" --no-cd %gitCommand% "%bashCmd%" --login -i
) else (
"%bashCmd%" --login -i
)

40
vendor/start_git_mintty.cmd vendored Normal file
View File

@ -0,0 +1,40 @@
@echo off
if not defined CMDER_ROOT (
if defined ConEmuDir (
for /f "delims=" %%i in ("%ConEmuDir%\..\..") do (
set "CMDER_ROOT=%%~fi"
)
) else (
for /f "delims=" %%i in ("%~dp0\..") do (
set "CMDER_ROOT=%%~fi"
)
)
)
if exist "%CMDER_ROOT%\vendor\git-for-windows" (
set "PATH=%CMDER_ROOT%\vendor\git-for-windows\usr\bin;%PATH%"
set "gitCmd=%CMDER_ROOT%\vendor\git-for-windows\usr\bin\mintty.exe"
) else if exist "%ProgramFiles%\git" (
set "PATH=%ProgramFiles%\git\usr\bin;%PATH%"
set "gitCmd=%ProgramFiles%\git\usr\bin\mintty.exe"
if not exist "%ProgramFiles%\git\etc\profile.d\cmder_exinit.sh" (
echo Run 'mklink "%ProgramFiles%\git\etc\profile.d\cmder_exinit.sh" "%CMDER_ROOT%\vendor\cmder_exinit"' in 'cmd::Cmder as Admin' to use Cmder with external Git Bash
echo.
echo or
echo.
echo Run 'echo "" ^> "%ProgramFiles%\git\etc\profile.d\cmder_exinit.sh"' in 'cmd::Cmder as Admin' to disable this message.
)
) else if exist "%ProgramFiles(x86)%\git" (
set "PATH=%ProgramFiles(x86)%\git\usr\bin;%PATH%"
set "gitCmd=%ProgramFiles(x86)%\git\usr\bin\mintty.exe"
if not exist "%ProgramFiles(x86)%\git\etc\profile.d\cmder_exinit.sh" (
echo Run 'mklink "%ProgramFiles^(x86^)%\git\etc\profile.d\cmder_exinit.sh" "%CMDER_ROOT%\vendor\cmder_exinit"' in 'cmd::Cmder as Admin' to use Cmder with external Git Bash
echo.
echo or
echo.
echo Run 'echo "" ^> "%ProgramFiles^(x86^)%\git\etc\profile.d\cmder_exinit.sh"' in 'cmd::Cmder as Admin' to disable this message.
)
)
"%gitCmd%" /bin/bash -l

174
vendor/user_init.cmd.template vendored Normal file
View File

@ -0,0 +1,174 @@
@echo off
:: This file was autogenerated by Cmder init.bat
::
:: It is yours to edit and will not be touched again by Cmder.
::
:: If you wish to recreate this file simply rename it and Cmder will re-create it the next time it is run
:: or run the followin command from a Cmder shell:
::
:: powershell -f %cmder_root%\vendor\bin\create-cmdercfg.ps1 -shell cmd [-outfile "[filename]"]
::
if "%CMDER_CLINK%" == "1" (
goto :INJECT_CLINK
) else if "%CMDER_CLINK%" == "2" if defined WT_PROFILE_ID (
goto :INJECT_CLINK
) else if "%CMDER_CLINK%" == "2" (
goto :CLINK_FINISH
)
goto :SKIP_CLINK
:INJECT_CLINK
%print_verbose% "Injecting Clink!"
:: Check if Clink is not present
if not exist "%CMDER_ROOT%\vendor\clink\clink_%clink_architecture%.exe" (
goto :SKIP_CLINK
)
:: Run Clink
if not exist "%CMDER_CONFIG_DIR%\settings" if not exist "%CMDER_CONFIG_DIR%\clink_settings" (
echo Generating Clink initial settings in "%CMDER_CONFIG_DIR%\clink_settings"
copy "%CMDER_ROOT%\vendor\clink_settings.default" "%CMDER_CONFIG_DIR%\clink_settings"
echo Additional *.lua files in "%CMDER_CONFIG_DIR%" are loaded on startup.
)
if not exist "%CMDER_CONFIG_DIR%\cmder_prompt_config.lua" (
echo Creating Cmder prompt config file: "%CMDER_CONFIG_DIR%\cmder_prompt_config.lua"
copy "%CMDER_ROOT%\vendor\cmder_prompt_config.lua.default" "%CMDER_CONFIG_DIR%\cmder_prompt_config.lua"
)
"%CMDER_ROOT%\vendor\clink\clink_%clink_architecture%.exe" inject --quiet --profile "%CMDER_CONFIG_DIR%" --scripts "%CMDER_ROOT%\vendor"
if errorlevel 1 (
%print_error% "Clink initialization has failed with error code: %errorlevel%"
goto :CLINK_FINISH
)
set CMDER_CLINK=2
goto :CLINK_FINISH
:SKIP_CLINK
%print_warning% "Skipping Clink Injection!"
for /f "tokens=2 delims=:." %%x in ('chcp') do set cp=%%x
chcp 65001>nul
:: Revert back to plain cmd.exe prompt without clink
prompt `$E[1;32;49m`$P`$S`$_`$E[1;30;49mλ`$S`$E[0m
chcp %cp%>nul
:CLINK_FINISH
if not defined GIT_INSTALL_ROOT set "GIT_INSTALL_ROOT=$env:GIT_INSTALL_ROOT"
if not defined SVN_SSH set "SVN_SSH=$env:SVN_SSH"
if not defined git_locale set git_locale=$env:git_locale
if not defined LANG set LANG=$env:lang
if not defined user_aliases set "user_aliases=$env:user_aliases"
if not defined aliases set "aliases=%user_aliases%"
if not defined HOME set "HOME=%USERPROFILE%"
set PLINK_PROTOCOL=$env:PLINK_PROTOCOL
set "path=%GIT_INSTALL_ROOT%\cmd;%path%"
set path_position=append
if %nix_tools% equ 1 (
set "path_position=append"
) else (
set "path_position="
)
if %nix_tools% geq 1 (
if exist "%GIT_INSTALL_ROOT%\mingw32" (
if "%path_position%" == "append" (
set "path=%path%;%GIT_INSTALL_ROOT%\mingw32\bin"
) else (
set "path=%GIT_INSTALL_ROOT%\mingw32\bin;%path%"
)
) else if exist "%GIT_INSTALL_ROOT%\mingw64" (
if "%path_position%" == "append" (
set "path=%path%;%GIT_INSTALL_ROOT%\mingw64\bin"
) else (
set "path=%GIT_INSTALL_ROOT%\mingw64\bin;%path%"
)
)
if exist "%GIT_INSTALL_ROOT%\usr\bin" (
if "%path_position%" == "append" (
set "path=%path%;%GIT_INSTALL_ROOT%\usr\bin"
) else (
set "path=%GIT_INSTALL_ROOT%\usr\bin;%path%"
)
)
)
set "path=%CMDER_ROOT%\vendor\bin;%path%"
:USER_CONFIG_START
if %max_depth% gtr 1 (
%lib_path% enhance_path_recursive "%CMDER_ROOT%\bin" 0 %max_depth%
) else (
set "path=%CMDER_ROOT%\bin;%path%"
)
setlocal enabledelayedexpansion
if defined CMDER_USER_BIN (
if %max_depth% gtr 1 (
%lib_path% enhance_path_recursive "%CMDER_USER_BIN%" 0 %max_depth%
) else (
set "path=%CMDER_USER_ROOT%\bin;%path%"
)
)
endlocal && set "path=%path%"
set "path=%path%;%CMDER_ROOT%"
call "%user_aliases%"
%lib_profile% run_profile_d "%CMDER_ROOT%\config\profile.d"
if defined CMDER_USER_CONFIG (
%lib_profile% run_profile_d "%CMDER_USER_CONFIG%\profile.d"
)
call "%CMDER_ROOT%\config\user_profile.cmd"
if defined CMDER_USER_CONFIG (
if exist "%CMDER_USER_CONFIG%\user_profile.cmd" (
call "%CMDER_USER_CONFIG%\user_profile.cmd"
)
)
set "path=%path:;;=;%
:CMDER_CONFIGURED
if not defined CMDER_CONFIGURED set CMDER_CONFIGURED=1
set CMDER_INIT_END=%time%
if "%time_init%" == "1" if "%CMDER_INIT_END%" neq "" if "%CMDER_INIT_START%" neq "" (
call "%cmder_root%\vendor\bin\timer.cmd" "%CMDER_INIT_START%" "%CMDER_INIT_END%"
)
:CLEANUP
set architecture_bits=
set CMDER_ALIASES=
set CMDER_INIT_END=
set CMDER_INIT_START=
set CMDER_USER_FLAGS=
set debug_output=
set fast_init=
set max_depth=
set nix_tools=
set path_position=
set print_debug=
set print_error=
set print_verbose=
set print_warning=
set time_init=
set verbose_output=
set user_aliases=
exit /b

View File

@ -0,0 +1,390 @@
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions": [
{
"command": {
"action": "copy",
"singleLine": false
},
"keys": "ctrl+shift+c"
},
{
"command": "unbound",
"keys": "ctrl+v"
},
{
"command": "unbound",
"keys": "ctrl+c"
},
{
"command": "paste"
},
{
"command": "find",
"keys": "ctrl+shift+f"
},
{
"command": {
"action": "splitPane",
"split": "auto",
"splitMode": "duplicate"
},
"keys": "alt+shift+d"
}
],
"copyFormatting": "none",
"copyOnSelect": true,
"defaultProfile": "{48946353-ebe8-4571-a591-7d609f31327a}",
"newTabMenu": [
{
"type": "remainingProfiles"
}
],
"profiles": {
"defaults": {
"colorScheme": "One Half Dark",
"font": {
"face": "Cascadia Code"
}
},
"list": [
{
"colorScheme": "One Half Dark",
"commandline": "cmd /k \"%WT_SETTINGS_DIR%\\..\\..\\init.bat\"",
"guid": "{48946353-ebe8-4571-a591-7d609f31327a}",
"hidden": false,
"icon": "%WT_SETTINGS_DIR%\\..\\..\\..\\icons\\cmder.ico",
"name": "Cmder",
"startingDirectory": null,
"tabTitle": "Cmder",
"useAtlasEngine": false
},
{
"colorScheme": "One Half Dark",
"commandline": "%SystemRoot%\\System32\\cmd.exe /k \"%WT_SETTINGS_DIR%\\..\\..\\init.bat\"",
"elevate": true,
"guid": "{bdd957d0-c15a-49e6-9816-14b02351a071}",
"hidden": false,
"icon": "%WT_SETTINGS_DIR%\\..\\..\\..\\icons\\cmder_red.ico",
"name": "Cmder as Admin",
"startingDirectory": null,
"tabTitle": "Cmder as Admin"
},
{
"colorScheme": "One Half Dark",
"commandline": "PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command \"Invoke-Expression 'Import-Module ''%WT_SETTINGS_DIR%\\..\\..\\profile.ps1'''\"",
"guid": "{eb1f6578-ce9d-47a9-a8c7-9b3fdd22302d}",
"hidden": false,
"icon": "%WT_SETTINGS_DIR%\\..\\..\\..\\icons\\cmder_orange.ico",
"name": "Cmder - PowerShell",
"startingDirectory": null,
"tabTitle": "Cmder",
"useAtlasEngine": false
},
{
"colorScheme": "One Half Dark",
"commandline": "PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command \"Invoke-Expression 'Import-Module ''%WT_SETTINGS_DIR%\\..\\..\\profile.ps1'''\"",
"elevate": true,
"guid": "{c5225c3e-8619-4145-8182-2800814eeb17}",
"hidden": false,
"icon": "%WT_SETTINGS_DIR%\\..\\..\\..\\icons\\cmder_purple.ico",
"name": "Cmder - PowerShell as Admin",
"startingDirectory": null,
"tabTitle": "Cmder - PowerShell as Admin",
"useAtlasEngine": false
},
{
"colorScheme": "One Half Dark",
"commandline": "%WT_SETTINGS_DIR%\\..\\..\\start_git_bash.cmd",
"guid": "{c5c298e9-010e-4b8c-bc55-e3df81846b4c}",
"hidden": false,
"icon": "%WT_SETTINGS_DIR%\\..\\..\\..\\icons\\cmder_blue.ico",
"name": "Cmder - Bash",
"startingDirectory": null,
"tabTitle": "Cmder - Bash"
},
{
"colorScheme": "One Half Dark",
"commandline": "%WT_SETTINGS_DIR%\\..\\..\\start_git_bash.cmd",
"elevate": true,
"guid": "{545eb9ed-4c1c-49b3-8cc6-7eb41bd280ff}",
"hidden": false,
"icon": "%WT_SETTINGS_DIR%\\..\\..\\..\\icons\\cmder_yellow.ico",
"name": "Cmder - Bash as Admin",
"startingDirectory": null,
"tabTitle": "Cmder - Bash as Admin"
},
{
"commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"hidden": false,
"name": "Windows PowerShell"
},
{
"commandline": "%SystemRoot%\\System32\\cmd.exe",
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"hidden": false,
"name": "Command Prompt"
}
]
},
"schemes": [
{
"background": "#0C0C0C",
"black": "#0C0C0C",
"blue": "#0037DA",
"brightBlack": "#767676",
"brightBlue": "#3B78FF",
"brightCyan": "#61D6D6",
"brightGreen": "#16C60C",
"brightPurple": "#B4009E",
"brightRed": "#E74856",
"brightWhite": "#F2F2F2",
"brightYellow": "#F9F1A5",
"cursorColor": "#FFFFFF",
"cyan": "#3A96DD",
"foreground": "#CCCCCC",
"green": "#13A10E",
"name": "Campbell",
"purple": "#881798",
"red": "#C50F1F",
"selectionBackground": "#FFFFFF",
"white": "#CCCCCC",
"yellow": "#C19C00"
},
{
"background": "#012456",
"black": "#0C0C0C",
"blue": "#0037DA",
"brightBlack": "#767676",
"brightBlue": "#3B78FF",
"brightCyan": "#61D6D6",
"brightGreen": "#16C60C",
"brightPurple": "#B4009E",
"brightRed": "#E74856",
"brightWhite": "#F2F2F2",
"brightYellow": "#F9F1A5",
"cursorColor": "#FFFFFF",
"cyan": "#3A96DD",
"foreground": "#CCCCCC",
"green": "#13A10E",
"name": "Campbell Powershell",
"purple": "#881798",
"red": "#C50F1F",
"selectionBackground": "#FFFFFF",
"white": "#CCCCCC",
"yellow": "#C19C00"
},
{
"background": "#282828",
"black": "#282828",
"blue": "#458588",
"brightBlack": "#928374",
"brightBlue": "#83A598",
"brightCyan": "#8EC07C",
"brightGreen": "#B8BB26",
"brightPurple": "#D3869B",
"brightRed": "#FB4934",
"brightWhite": "#EBDBB2",
"brightYellow": "#FABD2F",
"cursorColor": "#FFFFFF",
"cyan": "#689D6A",
"foreground": "#EBDBB2",
"green": "#98971A",
"name": "Gruvbox Dark",
"purple": "#B16286",
"red": "#CC241D",
"selectionBackground": "#FFFFFF",
"white": "#A89984",
"yellow": "#D79921"
},
{
"background": "#272822",
"black": "#3E3D32",
"blue": "#03395C",
"brightBlack": "#272822",
"brightBlue": "#66D9EF",
"brightCyan": "#66D9EF",
"brightGreen": "#A6E22E",
"brightPurple": "#AE81FF",
"brightRed": "#F92672",
"brightWhite": "#F8F8F2",
"brightYellow": "#FD971F",
"cursorColor": "#FFFFFF",
"cyan": "#66D9EF",
"foreground": "#F8F8F2",
"green": "#A6E22E",
"name": "Monokai",
"purple": "#AE81FF",
"red": "#F92672",
"selectionBackground": "#FFFFFF",
"white": "#F8F8F2",
"yellow": "#FFE792"
},
{
"background": "#282C34",
"black": "#282C34",
"blue": "#61AFEF",
"brightBlack": "#5A6374",
"brightBlue": "#61AFEF",
"brightCyan": "#56B6C2",
"brightGreen": "#98C379",
"brightPurple": "#C678DD",
"brightRed": "#E06C75",
"brightWhite": "#DCDFE4",
"brightYellow": "#E5C07B",
"cursorColor": "#FFFFFF",
"cyan": "#56B6C2",
"foreground": "#DCDFE4",
"green": "#98C379",
"name": "One Half Dark",
"purple": "#C678DD",
"red": "#E06C75",
"selectionBackground": "#FFFFFF",
"white": "#DCDFE4",
"yellow": "#E5C07B"
},
{
"background": "#FAFAFA",
"black": "#383A42",
"blue": "#0184BC",
"brightBlack": "#4F525D",
"brightBlue": "#61AFEF",
"brightCyan": "#56B5C1",
"brightGreen": "#98C379",
"brightPurple": "#C577DD",
"brightRed": "#DF6C75",
"brightWhite": "#FFFFFF",
"brightYellow": "#E4C07A",
"cursorColor": "#4F525D",
"cyan": "#0997B3",
"foreground": "#383A42",
"green": "#50A14F",
"name": "One Half Light",
"purple": "#A626A4",
"red": "#E45649",
"selectionBackground": "#FFFFFF",
"white": "#FAFAFA",
"yellow": "#C18301"
},
{
"background": "#002B36",
"black": "#002B36",
"blue": "#268BD2",
"brightBlack": "#073642",
"brightBlue": "#839496",
"brightCyan": "#93A1A1",
"brightGreen": "#586E75",
"brightPurple": "#6C71C4",
"brightRed": "#CB4B16",
"brightWhite": "#FDF6E3",
"brightYellow": "#657B83",
"cursorColor": "#FFFFFF",
"cyan": "#2AA198",
"foreground": "#839496",
"green": "#859900",
"name": "Solarized Dark",
"purple": "#D33682",
"red": "#DC322F",
"selectionBackground": "#FFFFFF",
"white": "#EEE8D5",
"yellow": "#B58900"
},
{
"background": "#FDF6E3",
"black": "#002B36",
"blue": "#268BD2",
"brightBlack": "#073642",
"brightBlue": "#839496",
"brightCyan": "#93A1A1",
"brightGreen": "#586E75",
"brightPurple": "#6C71C4",
"brightRed": "#CB4B16",
"brightWhite": "#FDF6E3",
"brightYellow": "#657B83",
"cursorColor": "#002B36",
"cyan": "#2AA198",
"foreground": "#657B83",
"green": "#859900",
"name": "Solarized Light",
"purple": "#D33682",
"red": "#DC322F",
"selectionBackground": "#FFFFFF",
"white": "#EEE8D5",
"yellow": "#B58900"
},
{
"background": "#000000",
"black": "#000000",
"blue": "#3465A4",
"brightBlack": "#555753",
"brightBlue": "#729FCF",
"brightCyan": "#34E2E2",
"brightGreen": "#8AE234",
"brightPurple": "#AD7FA8",
"brightRed": "#EF2929",
"brightWhite": "#EEEEEC",
"brightYellow": "#FCE94F",
"cursorColor": "#FFFFFF",
"cyan": "#06989A",
"foreground": "#D3D7CF",
"green": "#4E9A06",
"name": "Tango Dark",
"purple": "#75507B",
"red": "#CC0000",
"selectionBackground": "#FFFFFF",
"white": "#D3D7CF",
"yellow": "#C4A000"
},
{
"background": "#FFFFFF",
"black": "#000000",
"blue": "#3465A4",
"brightBlack": "#555753",
"brightBlue": "#729FCF",
"brightCyan": "#34E2E2",
"brightGreen": "#8AE234",
"brightPurple": "#AD7FA8",
"brightRed": "#EF2929",
"brightWhite": "#EEEEEC",
"brightYellow": "#FCE94F",
"cursorColor": "#000000",
"cyan": "#06989A",
"foreground": "#555753",
"green": "#4E9A06",
"name": "Tango Light",
"purple": "#75507B",
"red": "#CC0000",
"selectionBackground": "#FFFFFF",
"white": "#D3D7CF",
"yellow": "#C4A000"
},
{
"background": "#000000",
"black": "#000000",
"blue": "#000080",
"brightBlack": "#808080",
"brightBlue": "#0000FF",
"brightCyan": "#00FFFF",
"brightGreen": "#00FF00",
"brightPurple": "#FF00FF",
"brightRed": "#FF0000",
"brightWhite": "#FFFFFF",
"brightYellow": "#FFFF00",
"cursorColor": "#FFFFFF",
"cyan": "#008080",
"foreground": "#C0C0C0",
"green": "#008000",
"name": "Vintage",
"purple": "#800080",
"red": "#800000",
"selectionBackground": "#FFFFFF",
"white": "#C0C0C0",
"yellow": "#808000"
}
],
"themes": [],
"useAcrylicInTabRow": true,
"wordDelimiters": " ()\"',;<>!@#$%^&*|+=[]{}~?\u2502"
}