mirror of
https://github.com/cmderdev/cmder.git
synced 2025-11-09 21:59:08 +08:00
Compare commits
371 Commits
vagrant
...
developmen
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
480b638e0e | ||
|
|
7f0cfac498 | ||
|
|
7bb7678521 | ||
|
|
dc3b142b32 | ||
|
|
105ff0158b | ||
|
|
9c3bbe9b24 | ||
|
|
5536ea2088 | ||
|
|
f67e5704ed | ||
|
|
be44bac956 | ||
|
|
4fb6bed907 | ||
|
|
d001d9113b | ||
|
|
f4e68b0388 | ||
|
|
9030e7a25e | ||
|
|
a824b721cb | ||
|
|
1b03e29fa3 | ||
|
|
153f7310a1 | ||
|
|
e2fcb1ceda | ||
|
|
3172771f15 | ||
|
|
842393aea0 | ||
|
|
ef46d6465d | ||
|
|
eabadf96dc | ||
|
|
7b248bc9a3 | ||
|
|
697c122faf | ||
|
|
2ce0146d6e | ||
|
|
5dfa14ccce | ||
|
|
4d259ba84c | ||
|
|
bbd7507b4e | ||
|
|
b9246177c0 | ||
|
|
a571eedab6 | ||
|
|
a8d897f633 | ||
|
|
d900f6a630 | ||
|
|
304b8c7a05 | ||
|
|
fc24040e5e | ||
|
|
a1def7195e | ||
|
|
456ddcc59e | ||
|
|
f6adae5fb2 | ||
|
|
c039d977c2 | ||
|
|
60045d8c4f | ||
|
|
9b64482f37 | ||
|
|
bc970e7f78 | ||
|
|
7df73096d6 | ||
|
|
96f0bc9c6e | ||
|
|
f91d0bd5ba | ||
|
|
081e818465 | ||
|
|
b0ab14d29f | ||
|
|
96842bf09e | ||
|
|
ca068f5696 | ||
|
|
bf7d5166b4 | ||
|
|
3ca3b9f033 | ||
|
|
36670ea0dd | ||
|
|
a0d085f93e | ||
|
|
538662ce56 | ||
|
|
09ab2f25d8 | ||
|
|
f9d402d447 | ||
|
|
88ca59f82e | ||
|
|
d7fd2244cf | ||
|
|
85c0824553 | ||
|
|
667820105e | ||
|
|
6b26f5b9b4 | ||
|
|
a0a5b2ceab | ||
|
|
d37d173702 | ||
|
|
71b648f065 | ||
|
|
1f70cfa508 | ||
|
|
641a3b55fc | ||
|
|
f6bf29dff6 | ||
|
|
89ec06b387 | ||
|
|
b20f084fbc | ||
|
|
d4433f8917 | ||
|
|
8ab1f11fa4 | ||
|
|
73739407b1 | ||
|
|
aa6b28a2b0 | ||
|
|
d01ab39181 | ||
|
|
a513d08ab8 | ||
|
|
fb01ee7bb9 | ||
|
|
74b3f18c53 | ||
|
|
0cbe1e8d8c | ||
|
|
b522c136ad | ||
|
|
614f314e41 | ||
|
|
76711b43b4 | ||
|
|
375f63ac7e | ||
|
|
278694285c | ||
|
|
f9a4b0d9fc | ||
|
|
6f6c21dcae | ||
|
|
9653adc5f9 | ||
|
|
2f148fb36a | ||
|
|
f6bc623284 | ||
|
|
006567cdbc | ||
|
|
4886f612ea | ||
|
|
d45651f805 | ||
|
|
75d6973ccf | ||
|
|
1bcba81bec | ||
|
|
66747a1126 | ||
|
|
e7f102bdee | ||
|
|
b1b9bd22b5 | ||
|
|
a7c0e0642d | ||
|
|
1940e97ddc | ||
|
|
066203dbdc | ||
|
|
545331a336 | ||
|
|
08ce81609a | ||
|
|
218400a4b8 | ||
|
|
173b86fbc8 | ||
|
|
8ec4789e35 | ||
|
|
e2784bca6a | ||
|
|
43ab19a74d | ||
|
|
c7116bd533 | ||
|
|
e52906ac9b | ||
|
|
05552dc51c | ||
|
|
623bd52b7c | ||
|
|
c6bfd6f276 | ||
|
|
cf97d7d4ec | ||
|
|
1d51c4f402 | ||
|
|
bb14aeace5 | ||
|
|
aff4ad259f | ||
|
|
76c5b9e116 | ||
|
|
cb76868411 | ||
|
|
abcb1a1aa1 | ||
|
|
aa156a2901 | ||
|
|
df42ff2d8c | ||
|
|
2868f9ee92 | ||
|
|
8b004be391 | ||
|
|
93785426a6 | ||
|
|
e3fc1a122d | ||
|
|
00763846a2 | ||
|
|
a44b30c3eb | ||
|
|
6d82cf897b | ||
|
|
1737bcdeb7 | ||
|
|
7ac805cda5 | ||
|
|
c1bbc462f3 | ||
|
|
15d56185b7 | ||
|
|
8683dad111 | ||
|
|
d349f57e78 | ||
|
|
b412036262 | ||
|
|
06349694f0 | ||
|
|
e0aa20a080 | ||
|
|
b00dce8ba8 | ||
|
|
0c2e5ce1f2 | ||
|
|
bd3f1326f2 | ||
|
|
6cf4a42469 | ||
|
|
980083fb8c | ||
|
|
a1a6a02b04 | ||
|
|
74d7dd211f | ||
|
|
05f616fd76 | ||
|
|
9b5be7bd53 | ||
|
|
36ea61930f | ||
|
|
8ea276d9bd | ||
|
|
ebce8479ef | ||
|
|
6c95424124 | ||
|
|
b140db4617 | ||
|
|
5d0699a0ae | ||
|
|
d15e7ac69f | ||
|
|
126347025f | ||
|
|
7ceacb63dd | ||
|
|
510178852d | ||
|
|
4d15730d05 | ||
|
|
cc40343157 | ||
|
|
25ccfeed77 | ||
|
|
940cadc526 | ||
|
|
42315d8cec | ||
|
|
9b466e3963 | ||
|
|
c6dbb89129 | ||
|
|
1cfba25beb | ||
|
|
2007baef6e | ||
|
|
4740b836f3 | ||
|
|
e220d114b2 | ||
|
|
4204faa063 | ||
|
|
fbd4c0422c | ||
|
|
540532f126 | ||
|
|
41195ad8dd | ||
|
|
ffa37d4d5c | ||
|
|
f4f6255c1a | ||
|
|
82ab068f12 | ||
|
|
e84f2ff365 | ||
|
|
28f6098d48 | ||
|
|
b56a6d43cb | ||
|
|
339e6b40fd | ||
|
|
d2f7136ef8 | ||
|
|
2e945fb02b | ||
|
|
e457afa8d1 | ||
|
|
4daff054eb | ||
|
|
f38e0b3e03 | ||
|
|
167f57bc97 | ||
|
|
9120d92318 | ||
|
|
9463d4ebc4 | ||
|
|
c5946422e7 | ||
|
|
e850f8241d | ||
|
|
db3889d5e5 | ||
|
|
881938ed18 | ||
|
|
45fd0c2666 | ||
|
|
546d921e58 | ||
|
|
5145a15139 | ||
|
|
92c662de2f | ||
|
|
92419a48fc | ||
|
|
aac7cfc47a | ||
|
|
c9b77f618a | ||
|
|
a2e4884ea1 | ||
|
|
d68c5b4487 | ||
|
|
62a46140eb | ||
|
|
ae518cded8 | ||
|
|
4ad76d8274 | ||
|
|
8a199bf47b | ||
|
|
457d99da0b | ||
|
|
52762636dc | ||
|
|
ed6c9b2bc9 | ||
|
|
7753622897 | ||
|
|
5814792bd6 | ||
|
|
1ed3a36812 | ||
|
|
c5579d2cab | ||
|
|
131949bc77 | ||
|
|
18950135ef | ||
|
|
6e213115fe | ||
|
|
28e9018ce0 | ||
|
|
38a91ded02 | ||
|
|
47292038ef | ||
|
|
d8238b0230 | ||
|
|
0a691cb7ee | ||
|
|
7a385ebf75 | ||
|
|
0f6c91d03a | ||
|
|
2beb27d490 | ||
|
|
a7f19f56e8 | ||
|
|
3ff9737076 | ||
|
|
467d564a7b | ||
|
|
9ce6911b49 | ||
|
|
e2303b11c0 | ||
|
|
5c101a0306 | ||
|
|
3c2a25af9f | ||
|
|
99b4e66c47 | ||
|
|
67b62784c8 | ||
|
|
016846d5cf | ||
|
|
30718ab32b | ||
|
|
26e684fb38 | ||
|
|
08fd69bdef | ||
|
|
f8aa7feb1f | ||
|
|
f0c18f1fc6 | ||
|
|
e01a553ca5 | ||
|
|
8025b5baa2 | ||
|
|
9a4041941e | ||
|
|
86091b74e9 | ||
|
|
f69e6226e5 | ||
|
|
b59647b570 | ||
|
|
2135fce19f | ||
|
|
01c41a9268 | ||
|
|
2ab6bcd72c | ||
|
|
678b482269 | ||
|
|
219c879582 | ||
|
|
289bcf03a5 | ||
|
|
9c834b60a3 | ||
|
|
50bc05fee7 | ||
|
|
8d916a4446 | ||
|
|
90d86a7e5e | ||
|
|
5e22496aca | ||
|
|
8b6add75cf | ||
|
|
8498447878 | ||
|
|
0874f4be44 | ||
|
|
ffb93b1804 | ||
|
|
092dc4d323 | ||
|
|
39afad1743 | ||
|
|
d0cb6b5c23 | ||
|
|
43a5e7e0b1 | ||
|
|
ddad83c70f | ||
|
|
01da2fe638 | ||
|
|
58db4e3419 | ||
|
|
3cc22ca764 | ||
|
|
3671a6e13c | ||
|
|
ad21915919 | ||
|
|
ab10e83d95 | ||
|
|
cb543528af | ||
|
|
9ee2bef7cd | ||
|
|
a409a1cce8 | ||
|
|
e24f653d24 | ||
|
|
8bb2c5d587 | ||
|
|
7d3e691a69 | ||
|
|
7fa041dd7f | ||
|
|
63bab369cf | ||
|
|
759d0edd81 | ||
|
|
7db6297347 | ||
|
|
19fe75cbbe | ||
|
|
3b8e87de84 | ||
|
|
2728f36302 | ||
|
|
74c183c2a7 | ||
|
|
d75ba7bce2 | ||
|
|
968beb8a27 | ||
|
|
7c04ee9f6a | ||
|
|
94ea2da567 | ||
|
|
faf66542b4 | ||
|
|
d3497f5eb0 | ||
|
|
98a1e9621e | ||
|
|
4f32d23c30 | ||
|
|
e52fa81fbb | ||
|
|
6b330b81f2 | ||
|
|
bd857bae2d | ||
|
|
52e1a02224 | ||
|
|
ad5c80bcd2 | ||
|
|
9b446b31d5 | ||
|
|
9a135947af | ||
|
|
1b9a1e5b6f | ||
|
|
1adaab963b | ||
|
|
29650960aa | ||
|
|
41f0454b05 | ||
|
|
3ea9728ffd | ||
|
|
a01fb4c444 | ||
|
|
4b0344172a | ||
|
|
b47cf43d4c | ||
|
|
4104a5612f | ||
|
|
5e219fe34e | ||
|
|
ff7621c1da | ||
|
|
9be28807cb | ||
|
|
5d4c45d099 | ||
|
|
e2168a361c | ||
|
|
f517494dc4 | ||
|
|
7542376213 | ||
|
|
84ee96c64f | ||
|
|
4129084494 | ||
|
|
ad804eda44 | ||
|
|
3ced7a2a1b | ||
|
|
5311b25d9f | ||
|
|
15addb87ee | ||
|
|
e9750ab73d | ||
|
|
cd92c9fa74 | ||
|
|
3ca03795d3 | ||
|
|
294f85e33c | ||
|
|
4bf659833c | ||
|
|
ea0a9bb062 | ||
|
|
47258fbd2b | ||
|
|
86b9fb25ab | ||
|
|
7b55dab79e | ||
|
|
dac3090881 | ||
|
|
b2135cd0a9 | ||
|
|
37c41e80df | ||
|
|
59e14a1783 | ||
|
|
34f2aabb8e | ||
|
|
9a851da2cf | ||
|
|
5a90558714 | ||
|
|
845720e25a | ||
|
|
c1f8dfdb27 | ||
|
|
55676399d5 | ||
|
|
48e4dff882 | ||
|
|
a605ec520d | ||
|
|
5fab87f4d6 | ||
|
|
c9153c96bf | ||
|
|
74381ecd19 | ||
|
|
50c3ea4ab3 | ||
|
|
8d39f79a90 | ||
|
|
b46f7262e6 | ||
|
|
7b880efda4 | ||
|
|
3f53d1b927 | ||
|
|
4aefd0bb71 | ||
|
|
7daeb465e8 | ||
|
|
6180aa53b3 | ||
|
|
23488fcbb2 | ||
|
|
d838f861af | ||
|
|
d80202c791 | ||
|
|
5e3b70338d | ||
|
|
a4ea326a62 | ||
|
|
73034f9e31 | ||
|
|
8875f77573 | ||
|
|
1d1e815c91 | ||
|
|
36ad85c7b7 | ||
|
|
42568b7316 | ||
|
|
f08ad62e39 | ||
|
|
c4d9365584 | ||
|
|
e0b694324c | ||
|
|
f1e2fb5697 | ||
|
|
615ba5f816 | ||
|
|
9cbc1845fb | ||
|
|
3a2e747d22 | ||
|
|
1e623ecab4 | ||
|
|
02154a8f88 | ||
|
|
727a99b479 | ||
|
|
7e50f50863 | ||
|
|
56f45a81ca | ||
|
|
274cce1f00 |
15
.git-blame-ignore-revs
Normal file
15
.git-blame-ignore-revs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# List of whitespace-only commits to ignore in the Git blame;
|
||||||
|
# to improve tracking changes and avoid noise
|
||||||
|
58db4e3419bf1e5cc1bb61fcd7ce2ebbca89243a
|
||||||
|
efb3338f5cf0eec21e8a75abc62ee14965cb4a7e
|
||||||
|
3859f6ffc088b2ae78748abc84986f4adcadcd41
|
||||||
|
d6569192fc91167f555c3eff58402ff01f1197ea
|
||||||
|
67de97a492c9389f95499db38f9474a1c20ec585
|
||||||
|
a0d085f93eaa69c22449d0217e8daf9eaea2b180
|
||||||
|
1cfba25beb46c74bb1debca2bcfe7ac470e96172
|
||||||
|
f6bc623284914489e891bbac923feb774c862b99
|
||||||
|
abbab3f8b477e917d0a175d0de23cce121096631
|
||||||
|
126347025f9cade241beff182738b2527da7535e
|
||||||
|
4740b836f300658b27e6ad4d79efac63c9c24c24
|
||||||
|
be44bac95670b1cbbc91bd657882d985989846f9
|
||||||
|
f67e5704eda60526d495be758572181f01a6cac8
|
||||||
33
.github/workflows/branches.yml
vendored
Normal file
33
.github/workflows/branches.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Update branches
|
||||||
|
|
||||||
|
# Controls when the action will run.
|
||||||
|
on:
|
||||||
|
# Triggers the workflow on push events for the development branch
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
# Allows you to run this workflow manually from the Actions tab
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||||
|
jobs:
|
||||||
|
# This job updates the development branch with the master branch
|
||||||
|
update-development:
|
||||||
|
# The type of runner that the job will run on
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
# 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@v5
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # fetch all history for all branches and tags
|
||||||
|
|
||||||
|
# Runs a single command using the runners shell
|
||||||
|
- name: Merge master into development
|
||||||
|
run: |
|
||||||
|
git config user.name "${{ github.actor }}"
|
||||||
|
git config user.email "${{ github.actor }}@users.noreply.github.com"
|
||||||
|
git checkout development
|
||||||
|
git merge --no-ff master
|
||||||
|
git push origin development
|
||||||
67
.github/workflows/build.yml
vendored
67
.github/workflows/build.yml
vendored
@@ -11,7 +11,7 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- "v*"
|
- "v*"
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "master" ]
|
branches: [ "master", "development" ]
|
||||||
|
|
||||||
#---------------------------------#
|
#---------------------------------#
|
||||||
# environment configuration #
|
# environment configuration #
|
||||||
@@ -30,58 +30,103 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
name: Build Project
|
name: Build Project
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
discussions: write
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository code (Action from GitHub)
|
- name: Check out repository code (Action from GitHub)
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Add MSBuild to PATH
|
- name: Add MSBuild to PATH
|
||||||
uses: microsoft/setup-msbuild@v1
|
uses: microsoft/setup-msbuild@v2
|
||||||
|
|
||||||
- name: Build Cmder Launcher
|
- name: Build Cmder Launcher
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
working-directory: scripts
|
working-directory: scripts
|
||||||
run: .\build.ps1 -Compile -verbose
|
run: .\build.ps1 -Compile -verbose -terminal all
|
||||||
|
|
||||||
- name: Pack the built files
|
- name: Pack the built files
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
working-directory: scripts
|
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)
|
- name: Upload artifact (cmder.zip)
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v5
|
||||||
with:
|
with:
|
||||||
path: build/cmder.zip
|
path: build/cmder.zip
|
||||||
name: cmder.zip
|
name: cmder.zip
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Upload artifact (cmder.7z)
|
- name: Upload artifact (cmder.7z)
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v5
|
||||||
with:
|
with:
|
||||||
path: build/cmder.7z
|
path: build/cmder.7z
|
||||||
name: cmder.7z
|
name: cmder.7z
|
||||||
|
|
||||||
- name: Upload artifact (cmder_mini.zip)
|
- name: Upload artifact (cmder_mini.zip)
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v5
|
||||||
with:
|
with:
|
||||||
path: build/cmder_mini.zip
|
path: build/cmder_mini.zip
|
||||||
name: cmder_mini.zip
|
name: cmder_mini.zip
|
||||||
|
|
||||||
- name: Upload artifact (hashes.txt)
|
- name: Upload artifact (hashes.txt)
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v5
|
||||||
with:
|
with:
|
||||||
path: build/hashes.txt
|
path: build/hashes.txt
|
||||||
name: hashes.txt
|
name: hashes.txt
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
build/cmder.zip
|
build/cmder.zip
|
||||||
|
build/cmder_wt.zip
|
||||||
build/cmder.7z
|
build/cmder.7z
|
||||||
|
build/cmder_wt.7z
|
||||||
build/cmder_mini.zip
|
build/cmder_mini.zip
|
||||||
|
build/cmder_wt_mini.zip
|
||||||
build/hashes.txt
|
build/hashes.txt
|
||||||
draft: true
|
draft: true
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
|
|||||||
29
.github/workflows/codeql.yml
vendored
29
.github/workflows/codeql.yml
vendored
@@ -3,20 +3,25 @@
|
|||||||
#
|
#
|
||||||
# You may wish to alter this file to override the set of languages analyzed,
|
# You may wish to alter this file to override the set of languages analyzed,
|
||||||
# or to provide custom queries or build logic.
|
# 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"
|
name: "CodeQL"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "master" ]
|
branches: [ "master", "development" ]
|
||||||
|
paths-ignore:
|
||||||
|
- '**/*.md'
|
||||||
|
- '**/*.txt'
|
||||||
|
- '.github/**'
|
||||||
|
- '**/.gitignore'
|
||||||
pull_request:
|
pull_request:
|
||||||
# The branches below must be a subset of the branches above
|
# The branches below must be a subset of the branches above
|
||||||
branches: [ "master" ]
|
branches: [ "master", "development" ]
|
||||||
|
paths-ignore:
|
||||||
|
- '**/*.md'
|
||||||
|
- '**/*.txt'
|
||||||
|
- '.github/**'
|
||||||
|
- '**/.gitignore'
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '30 19 * * 0'
|
- cron: '30 19 * * 0'
|
||||||
|
|
||||||
@@ -40,11 +45,11 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v2
|
uses: github/codeql-action/init@v4
|
||||||
with:
|
with:
|
||||||
languages: ${{ matrix.language }}
|
languages: ${{ matrix.language }}
|
||||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
# 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
|
# queries: security-extended,security-and-quality
|
||||||
|
|
||||||
- name: Add MSBuild to PATH
|
- name: Add MSBuild to PATH
|
||||||
uses: microsoft/setup-msbuild@v1
|
uses: microsoft/setup-msbuild@v2
|
||||||
|
|
||||||
- name: Build Cmder Launcher
|
- name: Build Cmder Launcher
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
@@ -63,6 +68,6 @@ jobs:
|
|||||||
run: .\build.ps1 -Compile -verbose
|
run: .\build.ps1 -Compile -verbose
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v2
|
uses: github/codeql-action/analyze@v4
|
||||||
with:
|
with:
|
||||||
category: "/language:${{matrix.language}}"
|
category: "/language:${{matrix.language}}"
|
||||||
|
|||||||
16
.github/workflows/tests.yml
vendored
16
.github/workflows/tests.yml
vendored
@@ -4,9 +4,21 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
- development
|
||||||
|
paths-ignore:
|
||||||
|
- '**/*.md'
|
||||||
|
- '**/*.txt'
|
||||||
|
- '.github/**'
|
||||||
|
- '**/.gitignore'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
- development
|
||||||
|
paths-ignore:
|
||||||
|
- '**/*.md'
|
||||||
|
- '**/*.txt'
|
||||||
|
- '.github/**'
|
||||||
|
- '**/.gitignore'
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
@@ -26,7 +38,7 @@ jobs:
|
|||||||
continue-on-error: false
|
continue-on-error: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v5
|
||||||
- name: Initialize vendors
|
- name: Initialize vendors
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
working-directory: scripts
|
working-directory: scripts
|
||||||
@@ -36,7 +48,7 @@ jobs:
|
|||||||
cmd /c vendor\init.bat /v /d /t
|
cmd /c vendor\init.bat /v /d /t
|
||||||
- name: Testing PowerShell
|
- name: Testing PowerShell
|
||||||
run: |
|
run: |
|
||||||
PowerShell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile -Command "Invoke-Expression '. ''vendor\profile.ps1'''"
|
PowerShell.exe -ExecutionPolicy Bypass -NoLogo -NoProfile -Command "$env:CMDER_DEBUG='1'; . 'vendor\profile.ps1'"
|
||||||
- name: Testing Bash
|
- name: Testing Bash
|
||||||
run: |
|
run: |
|
||||||
bash vendor/cmder.sh
|
bash vendor/cmder.sh
|
||||||
|
|||||||
4
.github/workflows/vendor.yml
vendored
4
.github/workflows/vendor.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
|||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ jobs:
|
|||||||
Set-GHVariable -Name LIST_UPDATED -Value $listUpdated.Trim(', ')
|
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
|
echo "UPDATE_MESSAGE<<<EOF`n$updateMessage`n<EOF" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
|
||||||
|
|
||||||
- uses: peter-evans/create-pull-request@v4
|
- uses: peter-evans/create-pull-request@v7
|
||||||
if: env.COUNT_UPDATED > 0
|
if: env.COUNT_UPDATED > 0
|
||||||
with:
|
with:
|
||||||
title: 'Updates to `${{ env.COUNT_UPDATED }}` vendored dependencies'
|
title: 'Updates to `${{ env.COUNT_UPDATED }}` vendored dependencies'
|
||||||
|
|||||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -32,3 +32,9 @@ launcher/src/version.rc2
|
|||||||
.vscode
|
.vscode
|
||||||
.idea
|
.idea
|
||||||
.vagrant/
|
.vagrant/
|
||||||
|
scripts/packer/iso/*.iso
|
||||||
|
!scripts/packer/floppy/*.exe
|
||||||
|
scripts/packer/packer_cache
|
||||||
|
scripts/packer/output-*
|
||||||
|
*.box
|
||||||
|
|
||||||
|
|||||||
12
CHANGELOG.md
12
CHANGELOG.md
@@ -1,5 +1,17 @@
|
|||||||
# Change Log
|
# 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)
|
## [1.3.20](https://github.com/cmderdev/cmder/tree/v1.3.20) (2022-03-18)
|
||||||
|
|
||||||
### Changes
|
### Changes
|
||||||
|
|||||||
74
Cmder.bat
74
Cmder.bat
@@ -1,20 +1,66 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
SET CMDER_ROOT=%~dp0
|
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 '\'
|
:: 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"
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -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. |
|
| `/SINGLE` | Start Cmder in single mode. |
|
||||||
| `/START [start_path]` | Folder path to start in. |
|
| `/START [start_path]` | Folder path to start in. |
|
||||||
| `/TASK [task_name]` | Task to start after launch. |
|
| `/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
|
## Context Menu Integration
|
||||||
|
|
||||||
@@ -352,6 +352,10 @@ Cmder by default comes with a vendored ConEmu installation as the underlying ter
|
|||||||
|
|
||||||
However, Cmder can in fact run in a variety of other terminal emulators, and even integrated IDEs. Assuming you have the latest version of Cmder, follow the following instructions to get Cmder working with your own terminal emulator.
|
However, Cmder can in fact run in a variety of other terminal emulators, and even integrated IDEs. Assuming you have the latest version of Cmder, follow the following instructions to get Cmder working with your own terminal emulator.
|
||||||
|
|
||||||
|
⚠ *Note:* Cmder includes built-in support for Windows Terminal directory tracking via OSC 9;9 sequences. This enables "Duplicate Tab" and "Split Pane" features to preserve the current working directory for both `cmd.exe` and PowerShell sessions.
|
||||||
|
|
||||||
|
⚠ *Note:* Cmder also includes built-in support for [Windows Terminal shell integration](https://learn.microsoft.com/en-us/windows/terminal/tutorials/shell-integration) via OSC 133 sequences (A, B, C, D) for PowerShell sessions. This enables features like command navigation (jump between commands), command selection, visual command separators, command exit code tracking, and improved command history management in Windows Terminal.
|
||||||
|
|
||||||
For instructions on how to integrate Cmder with your IDE, please read our [Wiki section](https://github.com/cmderdev/cmder/wiki#cmder-integration).
|
For instructions on how to integrate Cmder with your IDE, please read our [Wiki section](https://github.com/cmderdev/cmder/wiki#cmder-integration).
|
||||||
|
|
||||||
## Upgrading
|
## Upgrading
|
||||||
|
|||||||
24
SECURITY.md
Normal file
24
SECURITY.md
Normal 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.
|
||||||
64
Vagrantfile
vendored
64
Vagrantfile
vendored
@@ -1,64 +0,0 @@
|
|||||||
Vagrant.configure("2") do |config|
|
|
||||||
required_plugins = %w( vagrant-vbguest )
|
|
||||||
required_plugins.each do |plugin|
|
|
||||||
system "vagrant plugin install #{plugin}" unless Vagrant.has_plugin? plugin
|
|
||||||
end
|
|
||||||
|
|
||||||
# config.vbguest.iso_path = "../../../../usr/share/virtualbox/VBoxGuestAdditions.iso"
|
|
||||||
config.vbguest.allow_downgrade = true
|
|
||||||
|
|
||||||
config.vm.define "cmderdev-10" do |win10|
|
|
||||||
win10.vm.hostname = "cmderdev-10"
|
|
||||||
win10.vm.box = "cmderdev-10"
|
|
||||||
|
|
||||||
# win10.vm.network :private_network, ip: "192.168.56.101"
|
|
||||||
|
|
||||||
win10.vm.provider :virtualbox do |v|
|
|
||||||
# v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
|
|
||||||
v.customize ["modifyvm", :id, "--name", "cmderdev-10"]
|
|
||||||
v.customize ["modifyvm", :id, "--ostype", "Windows10_64"]
|
|
||||||
v.customize ["modifyvm", :id, "--graphicscontroller", "vboxsvga"]
|
|
||||||
v.customize ["modifyvm", :id, "--memory", 8192]
|
|
||||||
v.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
|
|
||||||
#v.customize ["setextradata", :id, "GUI/ScaleFactor", "1.75"]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
config.vm.define "cmderdev-11" do |win11|
|
|
||||||
win11.vm.hostname = "cmderdev-11"
|
|
||||||
win11.vm.box = "cmderdev-11"
|
|
||||||
|
|
||||||
# win11.vm.network :private_network, ip: "192.168.56.111"
|
|
||||||
|
|
||||||
win11.vm.provider :virtualbox do |v|
|
|
||||||
# v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
|
|
||||||
v.customize ["modifyvm", :id, "--name", "cmderdev-11"]
|
|
||||||
v.customize ["modifyvm", :id, "--ostype", "Windows11_64"]
|
|
||||||
v.customize ["modifyvm", :id, "--graphicscontroller", "vboxvga"]
|
|
||||||
v.customize ["modifyvm", :id, "--memory", 8192]
|
|
||||||
v.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
|
|
||||||
#v.customize ["setextradata", :id, "GUI/ScaleFactor", "1.75"]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
config.vm.define "cmderdev-10-pro-scaled" do |cmderdev|
|
|
||||||
cmderdev.vm.hostname = 'cmderdev-10-pro'
|
|
||||||
cmderdev.vm.box = "cmderdev-10"
|
|
||||||
|
|
||||||
cmderdev.vm.provider :virtualbox do |v|
|
|
||||||
# v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
|
|
||||||
v.customize ["modifyvm", :id, "--name", "cmderdev-pro"]
|
|
||||||
v.customize ["modifyvm", :id, "--graphicscontroller", "vboxsvga"]
|
|
||||||
v.customize ["modifyvm", :id, "--memory", 8192]
|
|
||||||
v.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
|
|
||||||
v.customize ["setextradata", :id, "GUI/ScaleFactor", "1.75"]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
config.vm.provision "file", source: "./scripts/vagrant/windows_terminal_settings.json.default", destination: "windows_terminal_settings.json.default"
|
|
||||||
config.vm.provision "file", source: "./scripts/vagrant/windows_terminal_state.json.default", destination: "windows_terminal_state.json.default"
|
|
||||||
config.vm.provision "shell", path: './scripts/vagrant/add-cmder.ps1'
|
|
||||||
config.vm.provision "shell", path: './vendor/bin/add-vscodeprofile.ps1'
|
|
||||||
config.vm.provision "shell", path: './vendor/bin/add-windowsterminalprofiles.ps1'
|
|
||||||
config.vm.provision "shell", path: './vendor/bin/add-cmdertodesktop.ps1'
|
|
||||||
end
|
|
||||||
60
appveyor.yml
60
appveyor.yml
@@ -1,60 +0,0 @@
|
|||||||
#---------------------------------#
|
|
||||||
# general configuration #
|
|
||||||
#---------------------------------#
|
|
||||||
|
|
||||||
version: 1.0.{build}-{branch}
|
|
||||||
|
|
||||||
# branches to build
|
|
||||||
branches:
|
|
||||||
# blacklist
|
|
||||||
except:
|
|
||||||
- gh-pages
|
|
||||||
|
|
||||||
#---------------------------------#
|
|
||||||
# environment configuration #
|
|
||||||
#---------------------------------#
|
|
||||||
|
|
||||||
# Operating system (build VM template)
|
|
||||||
os: Visual Studio 2022
|
|
||||||
|
|
||||||
#---------------------------------#
|
|
||||||
# build configuration #
|
|
||||||
#---------------------------------#
|
|
||||||
|
|
||||||
build_script:
|
|
||||||
- ps: cd scripts; .\build.ps1 -Compile -verbose
|
|
||||||
|
|
||||||
after_build:
|
|
||||||
- ps: .\pack.ps1 -verbose
|
|
||||||
|
|
||||||
# Disable test search, since we don't have any.
|
|
||||||
test: off
|
|
||||||
|
|
||||||
#---------------------------------#
|
|
||||||
# artifacts #
|
|
||||||
#---------------------------------#
|
|
||||||
|
|
||||||
artifacts:
|
|
||||||
- path: build\cmder.zip
|
|
||||||
name: cmderzip
|
|
||||||
|
|
||||||
- path: build\cmder.7z
|
|
||||||
name: cmder7z
|
|
||||||
|
|
||||||
- path: build\cmder_mini.zip
|
|
||||||
name: cmdermini
|
|
||||||
|
|
||||||
- path: build\hashes.txt
|
|
||||||
name: hashes
|
|
||||||
|
|
||||||
#---------------------------------#
|
|
||||||
# notifications #
|
|
||||||
#---------------------------------#
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
# Webhook
|
|
||||||
- provider: Webhook
|
|
||||||
url: https://webhooks.gitter.im/e/d673abb1b2e659dcd625
|
|
||||||
on_build_success: true
|
|
||||||
on_build_failure: true
|
|
||||||
on_build_status_changed: true
|
|
||||||
@@ -188,6 +188,9 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="src\CmderLauncher.cpp" />
|
<ClCompile Include="src\CmderLauncher.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Image Include="..\icons\cmder.ico" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
|
|||||||
@@ -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"")
|
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
|
#if USE_TASKBAR_API
|
||||||
wchar_t appId[MAX_PATH] = { 0 };
|
wchar_t appId[MAX_PATH] = { 0 };
|
||||||
#endif
|
#endif
|
||||||
wchar_t exeDir[MAX_PATH] = { 0 };
|
wchar_t exeDir[MAX_PATH] = { 0 };
|
||||||
wchar_t icoPath[MAX_PATH] = { 0 };
|
wchar_t icoPath[MAX_PATH] = { 0 };
|
||||||
wchar_t cfgPath[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 cpuCfgPath[MAX_PATH] = { 0 };
|
||||||
wchar_t userCfgPath[MAX_PATH] = { 0 };
|
wchar_t userCfgPath[MAX_PATH] = { 0 };
|
||||||
wchar_t defaultCfgPath[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 configDirPath[MAX_PATH] = { 0 };
|
||||||
wchar_t userConfigDirPath[MAX_PATH] = { 0 };
|
wchar_t userConfigDirPath[MAX_PATH] = { 0 };
|
||||||
wchar_t userBinDirPath[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 legacyUserAliasesPath[MAX_PATH] = { 0 };
|
||||||
wchar_t args[MAX_PATH * 2 + 256] = { 0 };
|
wchar_t args[MAX_PATH * 2 + 256] = { 0 };
|
||||||
wchar_t userConEmuCfgPath[MAX_PATH] = { 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 cmderStart = path;
|
||||||
std::wstring cmderTask = taskName;
|
std::wstring cmderTask = taskName;
|
||||||
std::wstring cmderTitle = title;
|
std::wstring cmderTitle = title;
|
||||||
std::wstring cmderConEmuArgs = conemu_args;
|
std::wstring cmderTerminalArgs = conemu_args;
|
||||||
|
|
||||||
std::copy(cfgRoot.begin(), cfgRoot.end(), userConfigDirPath);
|
std::copy(cfgRoot.begin(), cfgRoot.end(), userConfigDirPath);
|
||||||
userConfigDirPath[cfgRoot.length()] = 0;
|
userConfigDirPath[cfgRoot.length()] = 0;
|
||||||
|
|
||||||
GetModuleFileName(NULL, exeDir, sizeof(exeDir));
|
GetModuleFileName(NULL, exeDir, sizeof(exeDir));
|
||||||
|
|
||||||
#if USE_TASKBAR_API
|
#if USE_TASKBAR_API
|
||||||
wcscpy_s(appId, exeDir);
|
wcscpy_s(appId, exeDir);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
PathRemoveFileSpec(exeDir);
|
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");
|
PathCombine(userProfilePath, configDirPath, L"user_profile.cmd");
|
||||||
|
|
||||||
char *lPr = (char *)malloc(MAX_PATH);
|
char* lPr = (char*)malloc(MAX_PATH);
|
||||||
char *pR = (char *)malloc(MAX_PATH);
|
char* pR = (char*)malloc(MAX_PATH);
|
||||||
size_t i;
|
size_t i;
|
||||||
wcstombs_s(&i, lPr, (size_t)MAX_PATH,
|
wcstombs_s(&i, lPr, (size_t)MAX_PATH,
|
||||||
legacyUserProfilePath, (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");
|
PathCombine(userAliasesPath, configDirPath, L"user_aliases.cmd");
|
||||||
|
|
||||||
char *lPr = (char *)malloc(MAX_PATH);
|
char* lPr = (char*)malloc(MAX_PATH);
|
||||||
char *pR = (char *)malloc(MAX_PATH);
|
char* pR = (char*)malloc(MAX_PATH);
|
||||||
size_t i;
|
size_t i;
|
||||||
wcstombs_s(&i, lPr, (size_t)MAX_PATH,
|
wcstombs_s(&i, lPr, (size_t)MAX_PATH,
|
||||||
legacyUserAliasesPath, (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");
|
PathCombine(userProfilePath, userConfigDirPath, L"user_profile.cmd");
|
||||||
|
|
||||||
char *lPr = (char *)malloc(MAX_PATH);
|
char* lPr = (char*)malloc(MAX_PATH);
|
||||||
char *pR = (char *)malloc(MAX_PATH);
|
char* pR = (char*)malloc(MAX_PATH);
|
||||||
size_t i;
|
size_t i;
|
||||||
wcstombs_s(&i, lPr, (size_t)MAX_PATH,
|
wcstombs_s(&i, lPr, (size_t)MAX_PATH,
|
||||||
legacyUserProfilePath, (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");
|
PathCombine(userAliasesPath, userConfigDirPath, L"user_aliases.cmd");
|
||||||
|
|
||||||
char *lPr = (char *)malloc(MAX_PATH);
|
char* lPr = (char*)malloc(MAX_PATH);
|
||||||
char *pR = (char *)malloc(MAX_PATH);
|
char* pR = (char*)malloc(MAX_PATH);
|
||||||
size_t i;
|
size_t i;
|
||||||
wcstombs_s(&i, lPr, (size_t)MAX_PATH,
|
wcstombs_s(&i, lPr, (size_t)MAX_PATH,
|
||||||
legacyUserAliasesPath, (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(vendorDir, exeDir, L"vendor");
|
||||||
PathCombine(cfgPath, exeDir, L"vendor\\conemu-maximus5\\ConEmu.xml");
|
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
|
if (PathFileExists(windowsTerminalDir))
|
||||||
PathCombine(defaultCfgPath, exeDir, L"vendor\\ConEmu.xml.default");
|
{
|
||||||
|
// Set path to vendored ConEmu config file
|
||||||
|
PathCombine(cfgPath, windowsTerminalDir, L"settings\\settings.json");
|
||||||
|
|
||||||
// Check for machine-specific then user config source file.
|
// Set path to Cmder default ConEmu config file
|
||||||
PathCombine(cpuCfgPath, userConfigDirPath, L"ConEmu-%COMPUTERNAME%.xml");
|
PathCombine(defaultCfgPath, exeDir, L"vendor\\windows_terminal_default_settings.json");
|
||||||
ExpandEnvironmentStrings(cpuCfgPath, cpuCfgPath, sizeof(cpuCfgPath) / sizeof(cpuCfgPath[0]));
|
|
||||||
|
|
||||||
// Set path to Cmder user ConEmu config file
|
// Check for machine-specific then user config source file.
|
||||||
PathCombine(userCfgPath, userConfigDirPath, L"user-ConEmu.xml");
|
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 (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))
|
if (!CopyFile(cfgPath, cpuCfgPath, FALSE))
|
||||||
{
|
{
|
||||||
MessageBox(NULL,
|
if (PathFileExists(windowsTerminalDir)) {
|
||||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
MessageBox(NULL,
|
||||||
? L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml! Access Denied."
|
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||||
: L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/ConEmu-%COMPUTERNAME%.xml!", MB_TITLE, MB_ICONSTOP);
|
? L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_terminal_%COMPUTERNAME%_settings.json! Access Denied."
|
||||||
exit(1);
|
: L"Failed to copy vendor/windows-terminal/settings/settings.json file to config/windows_terminal_%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))
|
if (!CopyFile(cpuCfgPath, cfgPath, FALSE))
|
||||||
{
|
{
|
||||||
MessageBox(NULL,
|
if (PathFileExists(windowsTerminalDir)) {
|
||||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
MessageBox(NULL,
|
||||||
? L"Failed to copy config/ConEmu-%COMPUTERNAME%.xml file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
|
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||||
: L"Failed to copy config/ConEmu-%COMPUTERNAME%.xml file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
|
? L"Failed to copy config/windows_terminal_%COMPUTERNAME%_settings.json file to vendor/windows-terminal/settings/settings.json! Access Denied."
|
||||||
exit(1);
|
: 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 (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 (!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_terminal_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,
|
MessageBox(NULL,
|
||||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||||
@@ -324,28 +424,51 @@ void StartCmder(std::wstring path = L"", bool is_single_mode = false, std::wstr
|
|||||||
exit(1);
|
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,
|
if (PathFileExists(windowsTerminalDir))
|
||||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
{
|
||||||
? L"Failed to copy config/user-conemu.xml file to vendor/conemu-maximus5/ConEmu.xml! Access Denied."
|
MessageBox(NULL,
|
||||||
: L"Failed to copy config/user-conemu.xml file to vendor/conemu-maximus5/ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
|
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||||
exit(1);
|
? 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,
|
MessageBox(NULL,
|
||||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
(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);
|
: L"Failed to copy vendor/conemu-maximus5/ConEmu.xml file to config/user-conemu.xml!", MB_TITLE, MB_ICONSTOP);
|
||||||
exit(1);
|
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");
|
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))
|
if ( ! CopyFile(defaultCfgPath, userCfgPath, FALSE))
|
||||||
{
|
{
|
||||||
MessageBox(NULL,
|
if (PathFileExists(windowsTerminalDir))
|
||||||
(GetLastError() == ERROR_ACCESS_DENIED)
|
{
|
||||||
? L"Failed to copy vendor/ConEmu.xml.default file to [user specified path]/config/user_ConEmu.xml! Access Denied."
|
MessageBox(NULL,
|
||||||
: L"Failed to copy vendor/ConEmu.xml.default file to [user specified path]/config/user_ConEmu.xml!", MB_TITLE, MB_ICONSTOP);
|
(GetLastError() == ERROR_ACCESS_DENIED)
|
||||||
exit(1);
|
? 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");
|
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;
|
SYSTEM_INFO sysInfo;
|
||||||
GetNativeSystemInfo(&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
|
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""))
|
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)
|
if (is_single_mode)
|
||||||
{
|
{
|
||||||
swprintf_s(args, L"%s /single", args);
|
if (!PathFileExists(windowsTerminalDir)) {
|
||||||
}
|
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 (cfgRoot.length() != 0)
|
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
|
// The `/run` arg and its value MUST be the last arg of ConEmu
|
||||||
// see : https://conemu.github.io/en/ConEmuArgs.html
|
// see : https://conemu.github.io/en/ConEmuArgs.html
|
||||||
// > This must be the last used switch (excepting -new_console and -cur_console)
|
// > 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""))
|
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);
|
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);
|
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.
|
// Ensure EnvironmentVariables are propagated.
|
||||||
|
|
||||||
STARTUPINFO si = { 0 };
|
STARTUPINFO si = { 0 };
|
||||||
|
|
||||||
si.cb = sizeof(STARTUPINFO);
|
si.cb = sizeof(STARTUPINFO);
|
||||||
#if USE_TASKBAR_API
|
#if USE_TASKBAR_API
|
||||||
si.lpTitle = appId;
|
si.lpTitle = appId;
|
||||||
si.dwFlags = STARTF_TITLEISAPPID;
|
si.dwFlags = STARTF_TITLEISAPPID;
|
||||||
#endif
|
#endif
|
||||||
PROCESS_INFORMATION pi;
|
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;
|
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)
|
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 commandStr[MAX_PATH + 20] = { 0 };
|
||||||
wchar_t baseCommandStr[MAX_PATH + 20] = { 0 };
|
wchar_t baseCommandStr[MAX_PATH + 20] = { 0 };
|
||||||
if (!single) {
|
if (single) {
|
||||||
swprintf_s(baseCommandStr, L"\"%s\"", exePath);
|
swprintf_s(baseCommandStr, L"\"%s\" /single", exePath);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
swprintf_s(baseCommandStr, L"\"%s\" /single", exePath);
|
swprintf_s(baseCommandStr, L"\"%s\"", exePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
|
if (cfgRoot.length() == 0) // '/c [path]' was NOT specified
|
||||||
@@ -586,7 +787,7 @@ struct cmderOptions
|
|||||||
std::wstring cmderTitle = L"Cmder";
|
std::wstring cmderTitle = L"Cmder";
|
||||||
std::wstring cmderIcon = L"";
|
std::wstring cmderIcon = L"";
|
||||||
std::wstring cmderRegScope = L"USER";
|
std::wstring cmderRegScope = L"USER";
|
||||||
std::wstring cmderConEmuArgs = L"";
|
std::wstring cmderTerminalArgs = L"";
|
||||||
bool cmderSingle = false;
|
bool cmderSingle = false;
|
||||||
bool cmderUserCfg = true;
|
bool cmderUserCfg = true;
|
||||||
bool registerApp = false;
|
bool registerApp = false;
|
||||||
@@ -600,11 +801,22 @@ cmderOptions GetOption()
|
|||||||
LPWSTR *szArgList;
|
LPWSTR *szArgList;
|
||||||
int argCount;
|
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);
|
szArgList = CommandLineToArgvW(GetCommandLine(), &argCount);
|
||||||
|
|
||||||
for (int i = 1; i < argCount; i++)
|
for (int i = 1; i < argCount; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
// MessageBox(NULL, szArgList[i], L"Arglist contents", MB_OK);
|
// MessageBox(NULL, szArgList[i], L"Arglist contents", MB_OK);
|
||||||
if (cmderOptions.error == false) {
|
if (cmderOptions.error == false) {
|
||||||
if (_wcsicmp(L"/c", szArgList[i]) == 0)
|
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);
|
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];
|
cmderOptions.cmderTask = szArgList[i + 1];
|
||||||
i++;
|
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];
|
cmderOptions.cmderTitle = szArgList[i + 1];
|
||||||
i++;
|
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];
|
cmderOptions.cmderIcon = szArgList[i + 1];
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
else if (_wcsicmp(L"/single", szArgList[i]) == 0)
|
else if (_wcsicmp(L"/single", szArgList[i]) == 0 && !PathFileExists(windowsTerminalDir) && PathFileExists(conEmuDir))
|
||||||
{
|
{
|
||||||
cmderOptions.cmderSingle = true;
|
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;
|
cmderOptions.cmderUserCfg = false;
|
||||||
}
|
}
|
||||||
@@ -693,7 +905,7 @@ cmderOptions GetOption()
|
|||||||
/* Used for passing arguments to conemu prog */
|
/* Used for passing arguments to conemu prog */
|
||||||
else if (_wcsicmp(L"/x", szArgList[i]) == 0)
|
else if (_wcsicmp(L"/x", szArgList[i]) == 0)
|
||||||
{
|
{
|
||||||
cmderOptions.cmderConEmuArgs = szArgList[i + 1];
|
cmderOptions.cmderTerminalArgs = szArgList[i + 1];
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
/* Bare double dash, remaining commandline is for conemu */
|
/* Bare double dash, remaining commandline is for conemu */
|
||||||
@@ -703,7 +915,7 @@ cmderOptions GetOption()
|
|||||||
auto doubledash = cmdline.find(L" -- ");
|
auto doubledash = cmdline.find(L" -- ");
|
||||||
if (doubledash != std::string::npos)
|
if (doubledash != std::string::npos)
|
||||||
{
|
{
|
||||||
cmderOptions.cmderConEmuArgs = cmdline.substr(doubledash + 4);
|
cmderOptions.cmderTerminalArgs = cmdline.substr(doubledash + 4);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -730,7 +942,11 @@ cmderOptions GetOption()
|
|||||||
cmderOptions.error = true;
|
cmderOptions.error = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!PathFileExists(windowsTerminalDir) && !PathFileExists(conEmuDir) && streqi(cmderOptions.cmderTask.c_str(), L""))
|
||||||
|
{
|
||||||
|
cmderOptions.cmderTask = L"cmder";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmderOptions.error == true)
|
if (cmderOptions.error == true)
|
||||||
@@ -759,12 +975,29 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
|||||||
|
|
||||||
cmderOptions cmderOptions = GetOption();
|
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)
|
if (cmderOptions.registerApp == true)
|
||||||
{
|
{
|
||||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
if (PathFileExists(windowsTerminalDir))
|
||||||
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_PATH_BACKGROUND, cmderOptions.cmderCfgRoot, cmderOptions.cmderSingle);
|
||||||
RegisterShellMenu(cmderOptions.cmderRegScope, SHELL_MENU_REGISTRY_DRIVE_PATH_LISTITEM, 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)
|
else if (cmderOptions.unRegisterApp == true)
|
||||||
{
|
{
|
||||||
@@ -779,8 +1012,8 @@ int APIENTRY _tWinMain(_In_ HINSTANCE hInstance,
|
|||||||
}
|
}
|
||||||
else
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -35,19 +35,19 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
|||||||
|
|
||||||
1 TEXTINCLUDE
|
1 TEXTINCLUDE
|
||||||
BEGIN
|
BEGIN
|
||||||
"resource.h\0"
|
"resource.h\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
2 TEXTINCLUDE
|
2 TEXTINCLUDE
|
||||||
BEGIN
|
BEGIN
|
||||||
"#include ""winres.h""\r\n"
|
"#include ""winres.h""\r\n"
|
||||||
"\0"
|
"\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
3 TEXTINCLUDE
|
3 TEXTINCLUDE
|
||||||
BEGIN
|
BEGIN
|
||||||
"\r\n"
|
"\r\n"
|
||||||
"\0"
|
"\0"
|
||||||
END
|
END
|
||||||
|
|
||||||
#endif // APSTUDIO_INVOKED
|
#endif // APSTUDIO_INVOKED
|
||||||
@@ -60,7 +60,7 @@ END
|
|||||||
// Icon with lowest ID value placed first to ensure application icon
|
// Icon with lowest ID value placed first to ensure application icon
|
||||||
// remains consistent on all systems.
|
// remains consistent on all systems.
|
||||||
IDI_CMDER ICON "..\\..\\icons\\cmder.ico"
|
IDI_CMDER ICON "..\\..\\icons\\cmder.ico"
|
||||||
#endif // English (United States) resources
|
#endif // not APSTUDIO_INVOKED
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ STRINGTABLE
|
|||||||
{
|
{
|
||||||
IDS_TITLE "Cmder Launcher"
|
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]"
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* WARNING: do NOT modify this file! the content of this file should be
|
* WARNING: This file should NOT be manually modified!
|
||||||
* automatically genereted before AppVeyor builds using the
|
* The contents will be automatically generated using the `.ps1` PowerShell scripts,
|
||||||
* respective .ps1 Powershell scripts.
|
* during builds by the CI.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -23,5 +23,6 @@ appveyor.yml
|
|||||||
vendor\cmder.sh
|
vendor\cmder.sh
|
||||||
vendor\git-prompt.sh
|
vendor\git-prompt.sh
|
||||||
config\user-*
|
config\user-*
|
||||||
|
config\user_*
|
||||||
clink_history*
|
clink_history*
|
||||||
*.log
|
*.log
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
.\build.ps1 -SourcesPath '~/custom/vendors.json'
|
.\build.ps1 -SourcesPath '~/custom/vendors.json'
|
||||||
|
|
||||||
Build cmder with your own packages. See vendor/sources.json for the syntax you need to copy.
|
Build Cmder with your own packages. See vendor/sources.json for the syntax you need to copy.
|
||||||
.NOTES
|
.NOTES
|
||||||
AUTHORS
|
AUTHORS
|
||||||
Samuel Vasko, Jack Bennett
|
Samuel Vasko, Jack Bennett
|
||||||
@@ -56,6 +56,9 @@ Param(
|
|||||||
# Using this option will skip all downloads, if you only need to build launcher
|
# Using this option will skip all downloads, if you only need to build launcher
|
||||||
[switch]$noVendor,
|
[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
|
# Build launcher if you have MSBuild tools installed
|
||||||
[switch]$Compile
|
[switch]$Compile
|
||||||
)
|
)
|
||||||
@@ -79,7 +82,7 @@ if ($Compile) {
|
|||||||
|
|
||||||
Write-Verbose "Building the launcher..."
|
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
|
msbuild CmderLauncher.vcxproj /t:Clean,Build /p:configuration=Release /m
|
||||||
|
|
||||||
if ($LastExitCode -ne 0) {
|
if ($LastExitCode -ne 0) {
|
||||||
@@ -113,15 +116,36 @@ if (-not $noVendor) {
|
|||||||
}
|
}
|
||||||
else { $ConEmuXml = "" }
|
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
|
# 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)) {
|
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 + "!")
|
Write-Verbose $("Stopping " + $ssh_agent.path + "!")
|
||||||
Stop-Process $ssh_agent.id
|
Stop-Process $ssh_agent.id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($s in $sources) {
|
foreach ($s in $sources) {
|
||||||
|
if ($terminal -eq "none") {
|
||||||
|
continue
|
||||||
|
} elseif ($s.name -eq "conemu-maximus5" -and $terminal -eq "windows-terminal") {
|
||||||
|
continue
|
||||||
|
} elseif ($s.name -eq "windows-terminal" -and $terminal -eq "conemu-maximus5") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
Write-Verbose "Getting vendored $($s.name) $($s.version)..."
|
Write-Verbose "Getting vendored $($s.name) $($s.version)..."
|
||||||
|
|
||||||
# We do not care about the extensions/type of archive
|
# 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
|
Download-File -Url $s.url -File $vend\$tempArchive -ErrorAction Stop
|
||||||
Extract-Archive $tempArchive $s.name
|
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) {
|
if ((Get-ChildItem $s.name).Count -eq 1) {
|
||||||
Flatten-Directory($s.name)
|
Flatten-Directory($s.name)
|
||||||
}
|
}
|
||||||
@@ -146,6 +180,12 @@ if (-not $noVendor) {
|
|||||||
Copy-Item $ConEmuXmlSave $ConEmuXml
|
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
|
# 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") ) ) {
|
if ( (Test-Path $($saveTo + "git-for-windows/etc/profile.d") ) ) {
|
||||||
Write-Verbose "Adding cmder.sh /etc/profile.d"
|
Write-Verbose "Adding cmder.sh /etc/profile.d"
|
||||||
|
|||||||
@@ -2,18 +2,18 @@
|
|||||||
.Synopsis
|
.Synopsis
|
||||||
Pack Cmder
|
Pack Cmder
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
Use this script to pack cmder into release archives
|
Use this script to pack Cmder into release archives
|
||||||
|
|
||||||
You will need to make this script executable by setting your Powershell Execution Policy to Remote signed
|
You will need to make this script executable by setting your Powershell Execution Policy to Remote signed
|
||||||
Then unblock the script for execution with UnblockFile .\pack.ps1
|
Then unblock the script for execution with UnblockFile .\pack.ps1
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
.\pack.ps1
|
.\pack.ps1
|
||||||
|
|
||||||
Creates default archives for cmder
|
Creates default archives for Cmder
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
.\pack.ps1 -verbose
|
.\pack.ps1 -verbose
|
||||||
|
|
||||||
Creates default archives for cmder with plenty of information
|
Creates default archives for Cmder with plenty of information
|
||||||
.NOTES
|
.NOTES
|
||||||
AUTHORS
|
AUTHORS
|
||||||
Samuel Vasko, Jack Bennett, Martin Kemp
|
Samuel Vasko, Jack Bennett, Martin Kemp
|
||||||
@@ -31,6 +31,9 @@ Param(
|
|||||||
# Path to the vendor configuration source file
|
# Path to the vendor configuration source file
|
||||||
[string]$cmderRoot = "$PSScriptRoot\..",
|
[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
|
# Vendor folder locaton
|
||||||
[string]$saveTo = "$PSScriptRoot\..\build"
|
[string]$saveTo = "$PSScriptRoot\..\build"
|
||||||
)
|
)
|
||||||
@@ -41,10 +44,36 @@ $cmderRoot = Resolve-Path $cmderRoot
|
|||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
Ensure-Executable "7z"
|
Ensure-Executable "7z"
|
||||||
|
|
||||||
$targets = @{
|
if ($terminal -eq "none") {
|
||||||
"cmder.7z" = "-t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -myx=7 -mqs=on";
|
$targets = @{
|
||||||
"cmder.zip" = "-mm=Deflate -mfb=128 -mpass=3";
|
"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_mini.zip" = "-xr!`"vendor\git-for-windows`"";
|
"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
|
Push-Location -Path $cmderRoot
|
||||||
|
|||||||
@@ -32,7 +32,11 @@ Param(
|
|||||||
# -whatif switch to not actually make changes
|
# -whatif switch to not actually make changes
|
||||||
|
|
||||||
# Path to the vendor configuration source file
|
# Path to the vendor configuration source file
|
||||||
[string]$sourcesPath = "$PSScriptRoot\..\vendor\sources.json"
|
[string]$sourcesPath = "$PSScriptRoot\..\vendor\sources.json",
|
||||||
|
|
||||||
|
# Include pre-release versions (RC, beta, alpha, etc.)
|
||||||
|
# By default, only stable releases are considered
|
||||||
|
[switch]$IncludePrerelease = $false
|
||||||
)
|
)
|
||||||
|
|
||||||
# Get the root directory of the cmder project.
|
# Get the root directory of the cmder project.
|
||||||
@@ -79,11 +83,39 @@ function Match-Filenames {
|
|||||||
return $position
|
return $position
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Checks if a release is a pre-release based on GitHub API flag and version tag keywords
|
||||||
|
# Pre-release keywords include: -rc (release candidate), -beta, -alpha, -preview, -pre
|
||||||
|
function Test-IsPrerelease {
|
||||||
|
param (
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
$release
|
||||||
|
)
|
||||||
|
|
||||||
|
# Check if marked as pre-release by GitHub
|
||||||
|
if ($release.prerelease -eq $true) {
|
||||||
|
return $true
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check for common pre-release keywords in tag name
|
||||||
|
# This catches versions like v2.50.0-rc, v1.0.0-beta, v1.0.0-alpha, etc.
|
||||||
|
$prereleaseKeywords = @('-rc', '-beta', '-alpha', '-preview', '-pre')
|
||||||
|
foreach ($keyword in $prereleaseKeywords) {
|
||||||
|
if ($release.tag_name -ilike "*$keyword*") {
|
||||||
|
return $true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $false
|
||||||
|
}
|
||||||
|
|
||||||
# Uses the GitHub api in order to fetch the current download links for the latest releases of the repo.
|
# Uses the GitHub api in order to fetch the current download links for the latest releases of the repo.
|
||||||
function Fetch-DownloadUrl {
|
function Fetch-DownloadUrl {
|
||||||
param (
|
param (
|
||||||
[Parameter(Mandatory = $true)]
|
[Parameter(Mandatory = $true)]
|
||||||
$urlStr
|
$urlStr,
|
||||||
|
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
[bool]$includePrerelease = $false
|
||||||
)
|
)
|
||||||
|
|
||||||
$url = [uri] $urlStr
|
$url = [uri] $urlStr
|
||||||
@@ -127,6 +159,13 @@ function Fetch-DownloadUrl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
:loop foreach ($i in $info) {
|
:loop foreach ($i in $info) {
|
||||||
|
# Skip pre-release versions unless explicitly included
|
||||||
|
# Pre-releases include RC (Release Candidate), beta, alpha, and other test versions
|
||||||
|
if (-not $includePrerelease -and (Test-IsPrerelease $i)) {
|
||||||
|
Write-Verbose "Skipping pre-release version: $($i.tag_name)"
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if (-not ($i.assets -is [array])) {
|
if (-not ($i.assets -is [array])) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -164,12 +203,26 @@ function Fetch-DownloadUrl {
|
|||||||
|
|
||||||
# Special case for archive downloads of repository
|
# Special case for archive downloads of repository
|
||||||
if (($null -eq $downloadLinks) -or (-not $downloadLinks)) {
|
if (($null -eq $downloadLinks) -or (-not $downloadLinks)) {
|
||||||
if ((($p | ForEach-Object { $_.Trim('/') }) -contains "archive") -and $info[0].tag_name) {
|
if ((($p | ForEach-Object { $_.Trim('/') }) -contains "archive")) {
|
||||||
for ($i = 0; $i -lt $p.Length; $i++) {
|
# Find the first release that matches our pre-release filtering criteria
|
||||||
if ($p[$i].Trim('/') -eq "archive") {
|
$selectedRelease = $null
|
||||||
$p[$i + 1] = $info[0].tag_name + ".zip"
|
foreach ($release in $info) {
|
||||||
$downloadLinks = $url.Scheme + "://" + $url.Host + ($p -join '')
|
# Apply the same filtering logic
|
||||||
return $downloadLinks
|
if (-not $includePrerelease -and (Test-IsPrerelease $release)) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
# Use the first release that passes the filter
|
||||||
|
$selectedRelease = $release
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($selectedRelease -and $selectedRelease.tag_name) {
|
||||||
|
for ($i = 0; $i -lt $p.Length; $i++) {
|
||||||
|
if ($p[$i].Trim('/') -eq "archive") {
|
||||||
|
$p[$i + 1] = $selectedRelease.tag_name + ".zip"
|
||||||
|
$downloadLinks = $url.Scheme + "://" + $url.Host + ($p -join '')
|
||||||
|
return $downloadLinks
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -215,7 +268,7 @@ foreach ($s in $sources) {
|
|||||||
|
|
||||||
Write-Verbose "Old Link: $($s.url)"
|
Write-Verbose "Old Link: $($s.url)"
|
||||||
|
|
||||||
$downloadUrl = Fetch-DownloadUrl $s.url
|
$downloadUrl = Fetch-DownloadUrl $s.url -includePrerelease $IncludePrerelease
|
||||||
|
|
||||||
if (($null -eq $downloadUrl) -or ($downloadUrl -eq '')) {
|
if (($null -eq $downloadUrl) -or ($downloadUrl -eq '')) {
|
||||||
Write-Verbose "No new links were found"
|
Write-Verbose "No new links were found"
|
||||||
|
|||||||
@@ -172,13 +172,13 @@ function Register-Cmder() {
|
|||||||
# Text for the context menu item.
|
# Text for the context menu item.
|
||||||
$MenuText = "Cmder Here"
|
$MenuText = "Cmder Here"
|
||||||
|
|
||||||
, # Defaults to the current cmder directory when run from cmder.
|
, # Defaults to the current Cmder directory when run from Cmder.
|
||||||
$PathToExe = (Join-Path $env:CMDER_ROOT "cmder.exe")
|
$PathToExe = (Join-Path $env:CMDER_ROOT "cmder.exe")
|
||||||
|
|
||||||
, # Commands the context menu will execute.
|
, # Commands the context menu will execute.
|
||||||
$Command = "%V"
|
$Command = "%V"
|
||||||
|
|
||||||
, # Defaults to the icons folder in the cmder package.
|
, # Defaults to the icons folder in the Cmder package.
|
||||||
$icon = (Split-Path $PathToExe | Join-Path -ChildPath 'icons/cmder.ico')
|
$icon = (Split-Path $PathToExe | Join-Path -ChildPath 'icons/cmder.ico')
|
||||||
)
|
)
|
||||||
Begin
|
Begin
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
choco install -y --force 7zip 7zip.install
|
|
||||||
choco install -y --force cmder
|
|
||||||
|
|
||||||
$env:path = "$env:path;c:/tools/cmder/vendor/git-for-windows/cmd"
|
|
||||||
c:
|
|
||||||
cd $env:userprofile
|
|
||||||
git clone https://github.com/cmderdev/cmder cmderdev
|
|
||||||
write-host "USERNAME: $env:USERNAME"
|
|
||||||
|
|
||||||
if ("$env:USERNAME" -eq "vagrant" -and -not (test-path "$env:userprofile/cmderdev/vendor/git-for-windows")) {
|
|
||||||
invoke-expression -command "TAKEOWN /F `"$env:userprofile/cmderdev`" /R /D y /s localhost /u vagrant /p vagrant"
|
|
||||||
}
|
|
||||||
|
|
||||||
cd cmderdev
|
|
||||||
git checkout vagrant
|
|
||||||
git pull origin vagrant
|
|
||||||
git remote add upstream https://github.com/cmderdev/cmder
|
|
||||||
git pull upstream master
|
|
||||||
|
|
||||||
# cmd.exe "/K" '"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvars64.bat" && powershell -command "& ''$env:userprofile/cmderdev/scripts/build.ps1'' -verbose -compile" && exit'
|
|
||||||
# copy $env:userprofile/cmderdev/launcher/x64/release/cmder.exe $env:userprofile/cmderdev
|
|
||||||
# cmd.exe "/K" '"C:/Program Files (x86)/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvars64.bat" && powershell -noexit -command "& ''build.ps1 -verbose -compile''"'
|
|
||||||
|
|
||||||
cd scripts
|
|
||||||
./build.ps1 -verbose
|
|
||||||
|
|
||||||
copy C:/Tools/Cmder/Cmder.exe $env:userprofile/cmderdev
|
|
||||||
|
|
||||||
# tabby
|
|
||||||
setx cmder_root "${env:userprofile}\cmderdev"
|
|
||||||
|
|
||||||
# C:\Users\vagrant\AppData\Roaming\Hyper
|
|
||||||
# // shell: '',
|
|
||||||
# shell: 'cmd.exe',
|
|
||||||
# // for setting shell arguments (i.e. for using interactive shellArgs: `['-i']`)
|
|
||||||
# // by default `['--login']` will be used
|
|
||||||
# // shellArgs: ['--login'],
|
|
||||||
# shellArgs: ['/k', 'C:\\users\\vagrant\\cmderdev\\vendor\\init.bat'],
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,283 +0,0 @@
|
|||||||
{
|
|
||||||
"$help": "https://aka.ms/terminal-documentation",
|
|
||||||
"$schema": "https://aka.ms/terminal-profiles-schema",
|
|
||||||
"actions":
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"command":
|
|
||||||
{
|
|
||||||
"action": "copy",
|
|
||||||
"singleLine": false
|
|
||||||
},
|
|
||||||
"keys": "ctrl+c"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"command": "paste",
|
|
||||||
"keys": "ctrl+v"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"command": "find",
|
|
||||||
"keys": "ctrl+shift+f"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"command":
|
|
||||||
{
|
|
||||||
"action": "splitPane",
|
|
||||||
"split": "auto",
|
|
||||||
"splitMode": "duplicate"
|
|
||||||
},
|
|
||||||
"keys": "alt+shift+d"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"copyFormatting": "none",
|
|
||||||
"copyOnSelect": false,
|
|
||||||
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
|
|
||||||
"profiles":
|
|
||||||
{
|
|
||||||
"defaults": {},
|
|
||||||
"list":
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"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"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
|
|
||||||
"hidden": false,
|
|
||||||
"name": "Azure Cloud Shell",
|
|
||||||
"source": "Windows.Terminal.Azure"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"guid": "{3b26d644-1d3b-5a0c-ab09-39d4dd9ae00e}",
|
|
||||||
"hidden": false,
|
|
||||||
"name": "Developer Command Prompt for VS 2022",
|
|
||||||
"source": "Windows.Terminal.VisualStudio"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"guid": "{589cd367-e65f-5e6a-a1c7-2b8d6f250da8}",
|
|
||||||
"hidden": false,
|
|
||||||
"name": "Developer PowerShell for VS 2022",
|
|
||||||
"source": "Windows.Terminal.VisualStudio"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"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": "#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": []
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"generatedProfiles" :
|
|
||||||
[
|
|
||||||
"{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
|
|
||||||
"{589cd367-e65f-5e6a-a1c7-2b8d6f250da8}",
|
|
||||||
"{3b26d644-1d3b-5a0c-ab09-39d4dd9ae00e}"
|
|
||||||
],
|
|
||||||
"settingsHash" : "6e0f2330b78337f3-01d95614596b3f65"
|
|
||||||
}
|
|
||||||
131
vendor/ConEmu.xml.default
vendored
131
vendor/ConEmu.xml.default
vendored
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<key name="Software">
|
<key name="Software">
|
||||||
<key name="ConEmu">
|
<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="ColorTable00" type="dword" data="00222827"/>
|
||||||
<value name="ColorTable01" type="dword" data="009e5401"/>
|
<value name="ColorTable01" type="dword" data="009e5401"/>
|
||||||
<value name="ColorTable02" type="dword" data="0004aa74"/>
|
<value name="ColorTable02" type="dword" data="0004aa74"/>
|
||||||
@@ -42,8 +42,8 @@
|
|||||||
<value name="PopBackColorIdx" type="hex" data="10"/>
|
<value name="PopBackColorIdx" type="hex" data="10"/>
|
||||||
<value name="ExtendFonts" type="hex" data="00"/>
|
<value name="ExtendFonts" type="hex" data="00"/>
|
||||||
<value name="ExtendFontNormalIdx" type="hex" data="01"/>
|
<value name="ExtendFontNormalIdx" type="hex" data="01"/>
|
||||||
<value name="ExtendFontBoldIdx" type="hex" data="0c"/>
|
<value name="ExtendFontBoldIdx" type="hex" data="0C"/>
|
||||||
<value name="ExtendFontItalicIdx" type="hex" data="0d"/>
|
<value name="ExtendFontItalicIdx" type="hex" data="0D"/>
|
||||||
<value name="CursorTypeActive" type="dword" data="000232c1"/>
|
<value name="CursorTypeActive" type="dword" data="000232c1"/>
|
||||||
<value name="CursorTypeInactive" type="dword" data="00823282"/>
|
<value name="CursorTypeInactive" type="dword" data="00823282"/>
|
||||||
<value name="ClipboardDetectLineEnd" type="hex" data="01"/>
|
<value name="ClipboardDetectLineEnd" type="hex" data="01"/>
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
<value name="TrueColorerSupport" type="hex" data="01"/>
|
<value name="TrueColorerSupport" type="hex" data="01"/>
|
||||||
<value name="FadeInactive" type="hex" data="01"/>
|
<value name="FadeInactive" type="hex" data="01"/>
|
||||||
<value name="FadeInactiveLow" type="hex" data="00"/>
|
<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="ComSpec.UncPaths" type="hex" data="01"/>
|
||||||
<value name="ConVisible" type="hex" data="00"/>
|
<value name="ConVisible" type="hex" data="00"/>
|
||||||
<value name="ConInMode" type="dword" data="ffffffff"/>
|
<value name="ConInMode" type="dword" data="ffffffff"/>
|
||||||
@@ -78,7 +78,6 @@
|
|||||||
<value name="StartFarEditors" type="hex" data="00"/>
|
<value name="StartFarEditors" type="hex" data="00"/>
|
||||||
<value name="StoreTaskbarkTasks" type="hex" data="00"/>
|
<value name="StoreTaskbarkTasks" type="hex" data="00"/>
|
||||||
<value name="StoreTaskbarCommands" 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="SingleInstance" type="hex" data="00"/>
|
||||||
<value name="ShowHelpTooltips" type="hex" data="01"/>
|
<value name="ShowHelpTooltips" type="hex" data="01"/>
|
||||||
<value name="Multi" type="hex" data="01"/>
|
<value name="Multi" type="hex" data="01"/>
|
||||||
@@ -113,13 +112,13 @@
|
|||||||
<value name="Monospace" type="hex" data="01"/>
|
<value name="Monospace" type="hex" data="01"/>
|
||||||
<value name="BackGround Image show" type="hex" data="00"/>
|
<value name="BackGround Image show" type="hex" data="00"/>
|
||||||
<value name="BackGround Image" type="string" data="c:\back.bmp"/>
|
<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="bgImageColors" type="dword" data="ffffffff"/>
|
||||||
<value name="bgOperation" type="hex" data="00"/>
|
<value name="bgOperation" type="hex" data="00"/>
|
||||||
<value name="bgPluginAllowed" type="hex" data="01"/>
|
<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="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="UserScreenTransparent" type="hex" data="00"/>
|
||||||
<value name="ColorKeyTransparent" type="hex" data="00"/>
|
<value name="ColorKeyTransparent" type="hex" data="00"/>
|
||||||
<value name="ColorKeyValue" type="dword" data="00010101"/>
|
<value name="ColorKeyValue" type="dword" data="00010101"/>
|
||||||
@@ -128,8 +127,8 @@
|
|||||||
<value name="ConWnd Width" type="dword" data="00000078"/>
|
<value name="ConWnd Width" type="dword" data="00000078"/>
|
||||||
<value name="ConWnd Height" type="dword" data="0000001e"/>
|
<value name="ConWnd Height" type="dword" data="0000001e"/>
|
||||||
<value name="Cascaded" type="hex" data="01"/>
|
<value name="Cascaded" type="hex" data="01"/>
|
||||||
<value name="ConWnd X" type="long" data="500"/>
|
<value name="ConWnd X" type="long" data="2194"/>
|
||||||
<value name="ConWnd Y" type="long" data="500"/>
|
<value name="ConWnd Y" type="long" data="95"/>
|
||||||
<value name="16bit Height" type="ulong" data="0"/>
|
<value name="16bit Height" type="ulong" data="0"/>
|
||||||
<value name="AutoSaveSizePos" type="hex" data="01"/>
|
<value name="AutoSaveSizePos" type="hex" data="01"/>
|
||||||
<value name="IntegralSize" type="hex" data="00"/>
|
<value name="IntegralSize" type="hex" data="00"/>
|
||||||
@@ -166,19 +165,19 @@
|
|||||||
<value name="CTS.ActMode" type="hex" data="02"/>
|
<value name="CTS.ActMode" type="hex" data="02"/>
|
||||||
<value name="CTS.RBtnAction" type="hex" data="03"/>
|
<value name="CTS.RBtnAction" type="hex" data="03"/>
|
||||||
<value name="CTS.MBtnAction" type="hex" data="00"/>
|
<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="ClipboardConfirmEnter" type="hex" data="01"/>
|
||||||
<value name="ClipboardConfirmLonger" type="ulong" data="200"/>
|
<value name="ClipboardConfirmLonger" type="ulong" data="200"/>
|
||||||
<value name="FarGotoEditorOpt" type="hex" data="01"/>
|
<value name="FarGotoEditorOpt" type="hex" data="01"/>
|
||||||
<value name="FarGotoEditorPath" type="string" data="far.exe /e%1:%2 "%3""/>
|
<value name="FarGotoEditorPath" type="string" data='far.exe /e%1:%2 "%3"'/>
|
||||||
<value name="FixFarBorders" type="hex" data="01"/>
|
<value name="FixFarBorders" type="hex" data="01"/>
|
||||||
<value name="FixFarBordersRanges" type="string" data="2013-25C4;"/>
|
<value name="FixFarBordersRanges" type="string" data="2013-25C4;"/>
|
||||||
<value name="ExtendUCharMap" type="hex" data="01"/>
|
<value name="ExtendUCharMap" type="hex" data="01"/>
|
||||||
<value name="EnhanceGraphics" type="hex" data="01"/>
|
<value name="EnhanceGraphics" type="hex" data="01"/>
|
||||||
<value name="EnhanceButtons" type="hex" data="00"/>
|
<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="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="PartBrushBlack" type="hex" data="20"/>
|
||||||
<value name="RightClick opens context menu" type="hex" data="02"/>
|
<value name="RightClick opens context menu" type="hex" data="02"/>
|
||||||
<value name="RightClickMacro2" type="string" data=""/>
|
<value name="RightClickMacro2" type="string" data=""/>
|
||||||
@@ -413,15 +412,15 @@
|
|||||||
<value name="Key.TileToLeft" type="dword" data="80808000"/>
|
<value name="Key.TileToLeft" type="dword" data="80808000"/>
|
||||||
<value name="Key.TileToRIght" type="dword" data="80808000"/>
|
<value name="Key.TileToRIght" type="dword" data="80808000"/>
|
||||||
<value name="KeyMacro01" type="dword" data="0012a031"/>
|
<value name="KeyMacro01" type="dword" data="0012a031"/>
|
||||||
<value name="KeyMacro01.Text" type="string" data="Task("cmd")"/>
|
<value name="KeyMacro01.Text" type="string" data='Task("cmd")'/>
|
||||||
<value name="KeyMacro02" type="dword" data="0012a032"/>
|
<value name="KeyMacro02" type="dword" data="0012a032"/>
|
||||||
<value name="KeyMacro02.Text" type="string" data="Task("PowerShell")"/>
|
<value name="KeyMacro02.Text" type="string" data='Task("PowerShell")'/>
|
||||||
<value name="KeyMacro03" type="dword" data="000011d0"/>
|
<value name="KeyMacro03" type="dword" data="000011d0"/>
|
||||||
<value name="KeyMacro03.Text" type="string" data="FontSetSize(1,2)"/>
|
<value name="KeyMacro03.Text" type="string" data="FontSetSize(1,2)"/>
|
||||||
<value name="KeyMacro04" type="dword" data="000011d1"/>
|
<value name="KeyMacro04" type="dword" data="000011d1"/>
|
||||||
<value name="KeyMacro04.Text" type="string" data="FontSetSize(1,-2)"/>
|
<value name="KeyMacro04.Text" type="string" data="FontSetSize(1,-2)"/>
|
||||||
<value name="KeyMacro05" type="dword" data="0012a033"/>
|
<value name="KeyMacro05" type="dword" data="0012a033"/>
|
||||||
<value name="KeyMacro05.Text" type="string" data="Task("PowerShell as Admin")"/>
|
<value name="KeyMacro05.Text" type="string" data='Task("PowerShell as Admin")'/>
|
||||||
<value name="KeyMacro06" type="dword" data="00000000"/>
|
<value name="KeyMacro06" type="dword" data="00000000"/>
|
||||||
<value name="KeyMacro06.Text" type="string" data=""/>
|
<value name="KeyMacro06.Text" type="string" data=""/>
|
||||||
<value name="KeyMacro07" type="dword" data="00000000"/>
|
<value name="KeyMacro07" type="dword" data="00000000"/>
|
||||||
@@ -484,12 +483,12 @@
|
|||||||
<value name="DndLKey" type="hex" data="00"/>
|
<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="WndDragKey" type="dword" data="00121101"/>
|
||||||
<key name="Tasks" modified="2018-02-22 06:02:12" build="171109">
|
<key name="Tasks" modified="2023-06-05 13:14:44" build="221218">
|
||||||
<value name="Count" type="long" data="9"/>
|
<value name="Count" type="long" data="11"/>
|
||||||
<key name="Task1" modified="2018-02-22 06:02:12" build="171109">
|
<key name="Task1" modified="2018-02-22 06:02:12" build="171109">
|
||||||
<value name="Name" type="string" data="{cmd::Cmder as Admin}"/>
|
<value name="Name" type="string" data="{cmd::Cmder as Admin}"/>
|
||||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
<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="Cmd1" type="string" data='*cmd /k ""%ConEmuDir%\..\init.bat" "'/>
|
||||||
<value name="Active" type="long" data="0"/>
|
<value name="Active" type="long" data="0"/>
|
||||||
<value name="Count" type="long" data="1"/>
|
<value name="Count" type="long" data="1"/>
|
||||||
<value name="Hotkey" type="dword" data="00000000"/>
|
<value name="Hotkey" type="dword" data="00000000"/>
|
||||||
@@ -497,8 +496,8 @@
|
|||||||
</key>
|
</key>
|
||||||
<key name="Task2" modified="2018-02-22 06:05:13" build="171109">
|
<key name="Task2" modified="2018-02-22 06:05:13" build="171109">
|
||||||
<value name="Name" type="string" data="{cmd::Cmder}"/>
|
<value name="Name" type="string" data="{cmd::Cmder}"/>
|
||||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
<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="Cmd1" type="string" data='cmd /k ""%ConEmuDir%\..\init.bat" "'/>
|
||||||
<value name="Active" type="long" data="0"/>
|
<value name="Active" type="long" data="0"/>
|
||||||
<value name="Count" type="long" data="1"/>
|
<value name="Count" type="long" data="1"/>
|
||||||
<value name="Hotkey" type="dword" data="00000000"/>
|
<value name="Hotkey" type="dword" data="00000000"/>
|
||||||
@@ -507,8 +506,8 @@
|
|||||||
<key name="Task3" modified="2018-02-22 06:05:13" build="171109">
|
<key name="Task3" modified="2018-02-22 06:05:13" build="171109">
|
||||||
<value name="Name" type="string" data="{PowerShell::PowerShell as Admin}"/>
|
<value name="Name" type="string" data="{PowerShell::PowerShell as Admin}"/>
|
||||||
<value name="Hotkey" type="dword" data="00000000"/>
|
<value name="Hotkey" type="dword" data="00000000"/>
|
||||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
<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 'Import-Module ''%ConEmuDir%\..\profile.ps1'''""/>
|
<value name="Cmd1" type="string" data='*PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression 'Import-Module ''%ConEmuDir%\..\profile.ps1'''"'/>
|
||||||
<value name="Active" type="long" data="0"/>
|
<value name="Active" type="long" data="0"/>
|
||||||
<value name="Count" type="long" data="1"/>
|
<value name="Count" type="long" data="1"/>
|
||||||
<value name="Flags" type="dword" data="00000000"/>
|
<value name="Flags" type="dword" data="00000000"/>
|
||||||
@@ -516,61 +515,78 @@
|
|||||||
<key name="Task4" modified="2018-02-22 06:05:13" build="171109">
|
<key name="Task4" modified="2018-02-22 06:05:13" build="171109">
|
||||||
<value name="Name" type="string" data="{PowerShell::PowerShell}"/>
|
<value name="Name" type="string" data="{PowerShell::PowerShell}"/>
|
||||||
<value name="Hotkey" type="dword" data="00000000"/>
|
<value name="Hotkey" type="dword" data="00000000"/>
|
||||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
<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 'Import-Module ''%ConEmuDir%\..\profile.ps1'''""/>
|
<value name="Cmd1" type="string" data='PowerShell -ExecutionPolicy Bypass -NoLogo -NoProfile -NoExit -Command "Invoke-Expression 'Import-Module ''%ConEmuDir%\..\profile.ps1'''"'/>
|
||||||
<value name="Cmd2" type="string" data=""%CMDER_ROOT%\vendor\git-for-windows\git-bash.exe""/>
|
<value name="Cmd2" type="string" data='"%CMDER_ROOT%\vendor\git-for-windows\git-bash.exe"'/>
|
||||||
<value name="Active" type="long" data="0"/>
|
<value name="Active" type="long" data="0"/>
|
||||||
<value name="Count" type="long" data="1"/>
|
<value name="Count" type="long" data="1"/>
|
||||||
<value name="Flags" type="dword" data="00000000"/>
|
<value name="Flags" type="dword" data="00000000"/>
|
||||||
</key>
|
</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="Name" type="string" data="{bash::mintty as Admin}"/>
|
||||||
<value name="Flags" type="dword" data="00000000"/>
|
<value name="Flags" type="dword" data="00000000"/>
|
||||||
<value name="Hotkey" type="dword" data="00000000"/>
|
<value name="Hotkey" type="dword" data="00000000"/>
|
||||||
<value name="GuiArgs" type="string" data="/icon "%ConEmuDir%\..\git-for-windows\usr\share\git\git-for-windows.ico""/>
|
<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="Active" type="long" data="0"/>
|
||||||
<value name="Count" type="long" data="1"/>
|
<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>
|
||||||
<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="Name" type="string" data="{bash::mintty}"/>
|
||||||
<value name="Flags" type="dword" data="00000000"/>
|
<value name="Flags" type="dword" data="00000000"/>
|
||||||
<value name="Hotkey" type="dword" data="00000000"/>
|
<value name="Hotkey" type="dword" data="00000000"/>
|
||||||
<value name="GuiArgs" type="string" data="/icon "%ConEmuDir%\..\git-for-windows\usr\share\git\git-for-windows.ico""/>
|
<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="Cmd1" type="string" data='"%ConEmuDir%\..\git-for-windows\usr\bin\mintty.exe" /bin/bash -l'/>
|
||||||
<value name="Active" type="long" data="0"/>
|
<value name="Active" type="long" data="0"/>
|
||||||
<value name="Count" type="long" data="1"/>
|
<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>
|
||||||
<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="Name" type="string" data="{bash::bash as Admin}"/>
|
||||||
<value name="Flags" type="dword" data="00000000"/>
|
<value name="Flags" type="dword" data="00000000"/>
|
||||||
<value name="Hotkey" type="dword" data="00000000"/>
|
<value name="Hotkey" type="dword" data="00000000"/>
|
||||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
<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="Active" type="long" data="0"/>
|
||||||
<value name="Count" type="long" data="1"/>
|
<value name="Count" type="long" data="1"/>
|
||||||
<value name="Cmd1" type="string" data="*set "PATH=%ConEmuDir%\..\git-for-windows\usr\bin;%PATH%" & %ConEmuDir%\..\git-for-windows\git-cmd.exe --no-cd --command=%ConEmuBaseDirShort%\conemu-msys2-64.exe "%ConEmuDir%\..\git-for-windows\usr\bin\bash.exe" --login -i"/>
|
|
||||||
</key>
|
</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="Name" type="string" data="{bash::bash}"/>
|
||||||
<value name="Flags" type="dword" data="00000000"/>
|
<value name="Flags" type="dword" data="00000000"/>
|
||||||
<value name="Hotkey" type="dword" data="00000000"/>
|
<value name="Hotkey" type="dword" data="00000000"/>
|
||||||
<value name="GuiArgs" type="string" data=" /icon "%CMDER_ROOT%\icons\cmder.ico""/>
|
<value name="GuiArgs" type="string" data=' /icon "%CMDER_ROOT%\icons\cmder.ico"'/>
|
||||||
<value name="Cmd1" type="string" data="set "PATH=%ConEmuDir%\..\git-for-windows\usr\bin;%PATH%" & %ConEmuDir%\..\git-for-windows\git-cmd.exe --no-cd --command=%ConEmuBaseDirShort%\conemu-msys2-64.exe "%ConEmuDir%\..\git-for-windows\usr\bin\bash.exe" --login -i"/>
|
|
||||||
<value name="Active" type="long" data="0"/>
|
<value name="Active" type="long" data="0"/>
|
||||||
<value name="Count" type="long" data="1"/>
|
<value name="Count" type="long" data="1"/>
|
||||||
|
<value name="Cmd1" type="string" data='cmd /c "%ConEmuDir%\..\start_git_bash.cmd"'/>
|
||||||
</key>
|
</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="Name" type="string" data="{WSL::bash}"/>
|
||||||
<value name="Flags" type="dword" data="00000000"/>
|
<value name="Flags" type="dword" data="00000000"/>
|
||||||
<value name="Hotkey" 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="GuiArgs" type="string" data='-icon "%USERPROFILE%\AppData\Local\lxss\bash.ico"'/>
|
||||||
<value name="Cmd1" type="string" data='set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pm:/mnt'/>
|
|
||||||
<value name="Active" type="long" data="0"/>
|
<value name="Active" type="long" data="0"/>
|
||||||
<value name="Count" type="long" data="1"/>
|
<value name="Count" type="long" data="1"/>
|
||||||
|
<value name="Cmd1" type="string" data='set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pm:/mnt'/>
|
||||||
</key>
|
</key>
|
||||||
</key>
|
</key>
|
||||||
|
|
||||||
<key name="Apps" modified="2018-02-22 06:05:13" build="171109">
|
<key name="Apps" modified="2018-02-22 06:05:13" build="171109">
|
||||||
<value name="Count" type="long" data="0"/>
|
<value name="Count" type="long" data="0"/>
|
||||||
</key>
|
</key>
|
||||||
@@ -676,7 +692,7 @@
|
|||||||
<value name="StatusBar.Hide.Dpi" type="hex" data="01"/>
|
<value name="StatusBar.Hide.Dpi" type="hex" data="01"/>
|
||||||
<value name="TabFlashChanged" type="long" data="8"/>
|
<value name="TabFlashChanged" type="long" data="8"/>
|
||||||
<value name="TabModifiedSuffix" type="string" data="[*]"/>
|
<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="KeyMacroVersion" type="hex" data="02"/>
|
||||||
<value name="Multi.Modifier" type="dword" data="00000011"/>
|
<value name="Multi.Modifier" type="dword" data="00000011"/>
|
||||||
<value name="Multi.ArrowsModifier" type="dword" data="0000005b"/>
|
<value name="Multi.ArrowsModifier" type="dword" data="0000005b"/>
|
||||||
@@ -845,13 +861,13 @@
|
|||||||
<value name="KeyMacro31.Text" type="string" data=""/>
|
<value name="KeyMacro31.Text" type="string" data=""/>
|
||||||
<value name="KeyMacro32" type="dword" data="00000000"/>
|
<value name="KeyMacro32" type="dword" data="00000000"/>
|
||||||
<value name="KeyMacro32.Text" type="string" data=""/>
|
<value name="KeyMacro32.Text" type="string" data=""/>
|
||||||
<value name="CTS.VkBlock" type="hex" data="a4"/>
|
<value name="CTS.VkBlock" type="hex" data="A4"/>
|
||||||
<value name="CTS.VkText" type="hex" data="a0"/>
|
<value name="CTS.VkText" type="hex" data="A0"/>
|
||||||
<value name="CTS.VkAct" type="hex" data="00"/>
|
<value name="CTS.VkAct" type="hex" data="00"/>
|
||||||
<value name="CTS.VkPrompt" 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="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="WndDragKey" type="dword" data="00121101"/>
|
||||||
<value name="Multi.Unfasten" type="dword" data="00000000"/>
|
<value name="Multi.Unfasten" type="dword" data="00000000"/>
|
||||||
<value name="Key.DebugProcess" type="dword" data="00105b44"/>
|
<value name="Key.DebugProcess" type="dword" data="00105b44"/>
|
||||||
@@ -869,10 +885,16 @@
|
|||||||
<value name="Key.BufPrUp" type="dword" data="00121121"/>
|
<value name="Key.BufPrUp" type="dword" data="00121121"/>
|
||||||
<value name="Key.BufPrDn" type="dword" data="00121122"/>
|
<value name="Key.BufPrDn" type="dword" data="00121122"/>
|
||||||
<value name="Key.ResetTerm" type="dword" data="00000000"/>
|
<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>
|
</key>
|
||||||
<value name="StartCreateDelay" type="ulong" data="100"/>
|
<value name="StartCreateDelay" type="ulong" data="100"/>
|
||||||
<value name="DefaultTerminalDebugLog" type="hex" data="00"/>
|
<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="Restore2ActiveMon" type="hex" data="00"/>
|
||||||
<value name="DownShowExOnTopMessage" type="hex" data="00"/>
|
<value name="DownShowExOnTopMessage" type="hex" data="00"/>
|
||||||
<value name="EnvironmentSet" type="multi">
|
<value name="EnvironmentSet" type="multi">
|
||||||
@@ -902,6 +924,15 @@
|
|||||||
<value name="StatusBar.Hide.TMode" type="hex" data="01"/>
|
<value name="StatusBar.Hide.TMode" type="hex" data="01"/>
|
||||||
<value name="StatusBar.Hide.RMode" type="hex" data="01"/>
|
<value name="StatusBar.Hide.RMode" type="hex" data="01"/>
|
||||||
<value name="StatusBar.Hide.CellI" 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>
|
</key>
|
||||||
</key>
|
</key>
|
||||||
|
|
||||||
|
|||||||
1
vendor/bin/add-cmderrootenvar.ps1
vendored
1
vendor/bin/add-cmderrootenvar.ps1
vendored
@@ -1 +0,0 @@
|
|||||||
setx cmder_root "${env:cmder_root}"
|
|
||||||
30
vendor/bin/add-cmdertodesktop.ps1
vendored
30
vendor/bin/add-cmdertodesktop.ps1
vendored
@@ -1,30 +0,0 @@
|
|||||||
if (test-path "${env:USERPROFILE}\cmderdev") {
|
|
||||||
$env:cmder_root = "${env:USERPROFILE}\cmderdev"
|
|
||||||
write-host "Creating '${env:USERPROFILE}\Desktop\Cmderdev.lnk'..."
|
|
||||||
|
|
||||||
$setShortcut = "$env:cmder_root\vendor\bin\set-shortcut.ps1"
|
|
||||||
|
|
||||||
start-process -NoNewWindow -filePath "powershell.exe" -ArgumentList "-file `"${setShortcut}`" -sourceexe `"${env:cmder_root}\Cmder.exe`" -DestinationPath `"${env:USERPROFILE}\Desktop\Cmderdev.lnk`" -WorkingDirectory `"${env:cmder_root}`""
|
|
||||||
}
|
|
||||||
|
|
||||||
if (test-path "${env:USERPROFILE}\cmder") {
|
|
||||||
$env:cmder_root = "${env:USERPROFILE}\cmder"
|
|
||||||
|
|
||||||
if (test-path "${cmder_root}\vendor\bin\set-shortcut.ps1") {
|
|
||||||
$setShortcut = "$env:cmder_root\vendor\bin\set-shortcut.ps1"
|
|
||||||
}
|
|
||||||
|
|
||||||
write-host "Creating '${env:USERPROFILE}\Desktop\Cmder.lnk'..."
|
|
||||||
start-process -NoNewWindow -filePath "powershell.exe" -ArgumentList "-file `"${setShortcut}`" -sourceexe `"$env:cmder_root\Cmder.exe`" -DestinationPath `"${env:USERPROFILE}\Desktop\Cmder.lnk`" -WorkingDirectory `"${env:USERPROFILE}`""
|
|
||||||
} elseif (test-path "C:\tools\cmder") {
|
|
||||||
$env:cmder_root = "C:\tools\cmder"
|
|
||||||
|
|
||||||
if (test-path "${cmder_root}\vendor\bin\set-shortcut.ps1") {
|
|
||||||
$setShortcut = "$env:cmder_root\vendor\bin\set-shortcut.ps1"
|
|
||||||
}
|
|
||||||
|
|
||||||
write-host "Creating '${env:USERPROFILE}\Desktop\Cmder.lnk'..."
|
|
||||||
start-process -NoNewWindow -filePath "powershell.exe" -ArgumentList "-file `"${setShortcut}`" -sourceexe `"$env:cmder_root\Cmder.exe`" -DestinationPath `"${env:USERPROFILE}\Desktop\Cmder.lnk`" -WorkingDirectory `"${env:USERPROFILE}`""
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
39
vendor/bin/add-vscodeprofile.ps1
vendored
39
vendor/bin/add-vscodeprofile.ps1
vendored
@@ -1,39 +0,0 @@
|
|||||||
# VSCode
|
|
||||||
$VSCodeUserSettings = "$env:APPDATA/Code/User"
|
|
||||||
$VSCodeSettings = "$VSCodeUserSettings/settings.json";
|
|
||||||
$VSCodeSettingsNew = $VSCodeSettings.replace('.json', '-new.json')
|
|
||||||
|
|
||||||
if (test-path $VSCodeSettings) {
|
|
||||||
$data = get-content -path $VSCodeSettings -ErrorAction silentlycontinue | out-string | ConvertFrom-Json
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
New-Item -ItemType directory $VSCodeUserSettings -force
|
|
||||||
$data = @{}
|
|
||||||
}
|
|
||||||
|
|
||||||
write-host $data
|
|
||||||
|
|
||||||
$data | Add-Member -force -Name 'terminal.integrated.defaultProfile.windows' -MemberType NoteProperty -Value "Cmder"
|
|
||||||
|
|
||||||
if ($null -eq $data.'terminal.integrated.profiles.windows') {
|
|
||||||
write-host "Adding 'terminal.integrated.profiles.windows'..."
|
|
||||||
$data | Add-Member -force -Name 'terminal.integrated.profiles.windows' -MemberType NoteProperty -Value @{}
|
|
||||||
}
|
|
||||||
|
|
||||||
write-host "Adding 'terminal.integrated.profiles.windows.Cmder' profile..."
|
|
||||||
$data.'terminal.integrated.profiles.windows'.'Cmder' = @{
|
|
||||||
"name" = "Cmder";
|
|
||||||
"path" = @(
|
|
||||||
"`${env:windir}/Sysnative/cmd.exe";
|
|
||||||
"`${env:windir}/System32/cmd.exe";
|
|
||||||
);
|
|
||||||
"args" = @(
|
|
||||||
"/k";
|
|
||||||
"`${env:USERPROFILE}/cmderdev/vendor/bin/vscode_init.cmd");
|
|
||||||
"icon" = "terminal-cmd";
|
|
||||||
"color" = "terminal.ansiGreen";
|
|
||||||
};
|
|
||||||
|
|
||||||
$data | ConvertTo-Json -depth 100 | set-content $VSCodeSettings
|
|
||||||
|
|
||||||
|
|
||||||
74
vendor/bin/add-windowsterminalprofiles.ps1
vendored
74
vendor/bin/add-windowsterminalprofiles.ps1
vendored
@@ -1,74 +0,0 @@
|
|||||||
# Windows Terminal
|
|
||||||
$windowsTerminalFolder = (dir "$env:userprofile/AppData/Local/Packages/Microsoft.WindowsTerminal_*").name
|
|
||||||
$windowsTerminalPath = "$env:userprofile/AppData/Local/Packages/$windowsTerminalFolder"
|
|
||||||
$windowsTerminalSettings = $windowsTerminalPath + '/localState/settings.json'
|
|
||||||
$windowsTerminalSettingsNew = $windowsTerminalPath + '/localState/settings-new.json'
|
|
||||||
|
|
||||||
if (test-path "$env:userprofile/Documents/windows_terminal_settings.json.default") {
|
|
||||||
if (test-path "$windowsTerminalPath/LocalState/settings.json") {
|
|
||||||
del "$env:userprofile/Documents/windows_terminal_settings.json.default"
|
|
||||||
} else {
|
|
||||||
move-item -path $env:userprofile/Documents/windows_terminal_settings.json.default -destination $windowsTerminalPath/LocalState/settings.json
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (test-path "$env:userprofile/Documents/windows_terminal_state.json.default") {
|
|
||||||
if (test-path "$windowsTerminalPath/LocalState/state.json") {
|
|
||||||
del "$env:userprofile/Documents/windows_terminal_state.json.default"
|
|
||||||
} else {
|
|
||||||
move-item -path $env:userprofile/Documents/windows_terminal_state.json.default -destination $windowsTerminalPath/LocalState/state.json
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (test-path "$windowsTerminalPath/LocalState/state.json") {
|
|
||||||
$json = get-content $windowsTerminalSettings | ConvertFrom-Json
|
|
||||||
|
|
||||||
$json.defaultProfile="{00000000-0000-0000-ba54-000000000132}"
|
|
||||||
|
|
||||||
$cmderFound = $false
|
|
||||||
$cmderAsAdminFound = $false
|
|
||||||
|
|
||||||
foreach ($profile in $json.profiles.list) {
|
|
||||||
if ($profile.Name -eq "Cmder") {
|
|
||||||
$cmderFound = $true
|
|
||||||
}
|
|
||||||
elseIf ($profile.Name -eq "Cmder as Admin") {
|
|
||||||
$cmderAsAdminFound = $true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (-not $cmderFound) {
|
|
||||||
write-host "Adding 'Cmder' to Windows Terminal..."
|
|
||||||
|
|
||||||
$json.profiles.list += @{
|
|
||||||
commandline="cmd.exe /k `"%USERPROFILE%/cmderdev/vendor/init.bat`"";
|
|
||||||
startingDirectory="%USERPROFILE%/cmderdev";
|
|
||||||
icon="%USERPROFILE%/cmderdev/icons/cmder.ico";
|
|
||||||
closeOnExit="graceful";
|
|
||||||
guid="{00000000-0000-0000-ba54-000000000132}";
|
|
||||||
hidden=$false;
|
|
||||||
name="Cmder"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (-not $cmderAsAdminFound) {
|
|
||||||
write-host "Adding 'Cmder as Admin' to Windows Terminal..."
|
|
||||||
|
|
||||||
$json.profiles.list += @{
|
|
||||||
commandline="cmd.exe /k `"%USERPROFILE%/cmderdev/vendor/init.bat`"";
|
|
||||||
startingDirectory="%USERPROFILE%/cmderdev";
|
|
||||||
icon="%USERPROFILE%/cmderdev/icons/cmder_red.ico";
|
|
||||||
closeOnExit="graceful";
|
|
||||||
guid="{00000000-0000-0000-ba54-000000000133}";
|
|
||||||
hidden=$false;
|
|
||||||
elevate=$true;
|
|
||||||
name="Cmder as Admin"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$json | ConvertTo-Json -depth 100 | set-content $windowsTerminalSettings
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
write-host "Cannot add profiles for Windows Terminal. The Windows Terminal settings file does not exist!"
|
|
||||||
}
|
|
||||||
|
|
||||||
4
vendor/bin/cmder_diag.cmd
vendored
4
vendor/bin/cmder_diag.cmd
vendored
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
(echo.
|
(echo.
|
||||||
echo ------------------------------------
|
echo ------------------------------------
|
||||||
echo set
|
echo Get Cmder env variables...
|
||||||
echo ------------------------------------
|
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.
|
||||||
echo ------------------------------------
|
echo ------------------------------------
|
||||||
|
|||||||
2
vendor/bin/cmder_shell.cmd
vendored
2
vendor/bin/cmder_shell.cmd
vendored
@@ -9,5 +9,5 @@ if "%cmder_init%" == "1" (
|
|||||||
)
|
)
|
||||||
|
|
||||||
pushd "%CMDER_ROOT%"
|
pushd "%CMDER_ROOT%"
|
||||||
call "%CMDER_ROOT%\vendor\init.bat" /f
|
call "%CMDER_ROOT%\vendor\init.bat" /f %*
|
||||||
popd
|
popd
|
||||||
|
|||||||
3
vendor/bin/create-cmdercfg.cmd
vendored
Normal file
3
vendor/bin/create-cmdercfg.cmd
vendored
Normal 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
30
vendor/bin/create-cmdercfg.ps1
vendored
Normal 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
14
vendor/bin/excd.cmd
vendored
@@ -1,6 +1,8 @@
|
|||||||
@if "%~1"=="/?" (@cd %*)
|
@echo off
|
||||||
@set excd=%*
|
set excd=%*
|
||||||
@set excd=%excd:"=%
|
set excd=%excd:"=%
|
||||||
@if "%excd:~0,1%"=="~" (@set excd=%userprofile%\%excd:~1%)
|
set excd_param=/d
|
||||||
@if not "%~1"=="/d" (@set excd_param="/d") else (@set excd_param=)
|
if /i "%excd:~0,2%"=="/d" set "excd=%excd:~2%"
|
||||||
@cd %excd_param% "%excd%"
|
if "%excd:~0,1%"=="~" (set excd=%userprofile%\%excd:~1%)
|
||||||
|
if "%excd:~0,1%"=="/" (set excd_param=)
|
||||||
|
cd %excd_param% %excd%
|
||||||
|
|||||||
21
vendor/bin/set-shortcut.ps1
vendored
21
vendor/bin/set-shortcut.ps1
vendored
@@ -1,21 +0,0 @@
|
|||||||
[CmdletBinding()]
|
|
||||||
param(
|
|
||||||
[Parameter()]
|
|
||||||
[string]$SourceExe,
|
|
||||||
[string]$Arguments,
|
|
||||||
[string]$DestinationPath,
|
|
||||||
[string]$WorkingDirectory,
|
|
||||||
[String]$IconLocation
|
|
||||||
)
|
|
||||||
|
|
||||||
if ($IconLocation -eq '') {
|
|
||||||
$IconLocation = $SourceExe
|
|
||||||
}
|
|
||||||
|
|
||||||
$WshShell = New-Object -comObject WScript.Shell
|
|
||||||
$Shortcut = $WshShell.CreateShortcut($destinationPath)
|
|
||||||
$Shortcut.TargetPath = $SourceExe
|
|
||||||
$Shortcut.Arguments = $Arguments
|
|
||||||
$shortcut.WorkingDirectory = $WorkingDirectory
|
|
||||||
$shortcut.IconLocation = $IconLocation
|
|
||||||
$Shortcut.Save()
|
|
||||||
24
vendor/bin/timer.cmd
vendored
24
vendor/bin/timer.cmd
vendored
@@ -11,6 +11,7 @@ set /a hours=%end_h%-%start_h%
|
|||||||
set /a mins=%end_m%-%start_m%
|
set /a mins=%end_m%-%start_m%
|
||||||
set /a secs=%end_s%-%start_s%
|
set /a secs=%end_s%-%start_s%
|
||||||
set /a ms=%end_ms%-%start_ms%
|
set /a ms=%end_ms%-%start_ms%
|
||||||
|
|
||||||
if %ms% lss 0 set /a secs = %secs% - 1 & set /a ms = 100%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 %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%
|
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
|
:: Mission accomplished
|
||||||
set /a totalsecs = %hours%*3600 + %mins%*60 + %secs%
|
set /a totalsecs = %hours%*3600 + %mins%*60 + %secs%
|
||||||
echo Elapsed Time: %hours%:%mins%:%secs%.%ms% (%totalsecs%.%ms%s total)
|
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=
|
||||||
|
|
||||||
|
|||||||
295
vendor/clink.lua
vendored
295
vendor/clink.lua
vendored
@@ -3,7 +3,12 @@
|
|||||||
-- !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
|
-- !!! THIS FILE IS OVERWRITTEN WHEN CMDER IS UPDATED
|
||||||
-- !!! Use "%CMDER_ROOT%\config\<whatever>.lua" to add your lua startup scripts
|
-- !!! Use "%CMDER_ROOT%\config\<whatever>.lua" to add your lua startup scripts
|
||||||
|
|
||||||
-- luacheck: globals clink
|
-- luacheck: globals CMDER_SESSION
|
||||||
|
-- luacheck: globals uah_color cwd_color lamb_color clean_color dirty_color conflict_color unknown_color
|
||||||
|
-- luacheck: globals prompt_homeSymbol prompt_lambSymbol prompt_type prompt_useHomeSymbol prompt_useUserAtHost
|
||||||
|
-- luacheck: globals prompt_singleLine prompt_includeVersionControl
|
||||||
|
-- luacheck: globals prompt_overrideGitStatusOptIn
|
||||||
|
-- luacheck: globals clink io.popenyield os.isdir settings.get
|
||||||
|
|
||||||
-- At first, load the original clink.lua file
|
-- At first, load the original clink.lua file
|
||||||
-- this is needed as we set the script path to this dir and therefore the original
|
-- this is needed as we set the script path to this dir and therefore the original
|
||||||
@@ -46,11 +51,37 @@ local function get_unknown_color()
|
|||||||
end
|
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)
|
local function escape_gsub_find_arg(text)
|
||||||
s = string.gsub(s, "%%", "%%%%")
|
return text and text:gsub("([-+*?.%%()%[%]$^])", "%%%1") or ""
|
||||||
return s
|
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
|
end
|
||||||
|
|
||||||
-- Extracts only the folder name from the input Path
|
-- Extracts only the folder name from the input Path
|
||||||
@@ -148,15 +179,15 @@ local function set_prompt_filter()
|
|||||||
end
|
end
|
||||||
|
|
||||||
if prompt_useHomeSymbol and string.find(cwd, clink.get_env("HOME")) then
|
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
|
end
|
||||||
|
|
||||||
uah = ''
|
local uah = ''
|
||||||
if prompt_useUserAtHost then
|
if prompt_useUserAtHost then
|
||||||
uah = clink.get_env("USERNAME") .. "@" .. clink.get_env("COMPUTERNAME") .. ' '
|
uah = clink.get_env("USERNAME") .. "@" .. clink.get_env("COMPUTERNAME") .. ' '
|
||||||
end
|
end
|
||||||
|
|
||||||
cr = "\n"
|
local cr = "\n"
|
||||||
if prompt_singleLine then
|
if prompt_singleLine then
|
||||||
cr = ' '
|
cr = ' '
|
||||||
end
|
end
|
||||||
@@ -170,15 +201,15 @@ local function set_prompt_filter()
|
|||||||
|
|
||||||
local version_control = prompt_includeVersionControl and "{git}{hg}{svn}" or ""
|
local version_control = prompt_includeVersionControl and "{git}{hg}{svn}" or ""
|
||||||
|
|
||||||
prompt = "{uah}{cwd}" .. version_control .. cr .. get_lamb_color() .. "{env}{lamb}\x1b[0m "
|
local prompt = "{uah}{cwd}" .. version_control .. cr .. get_lamb_color() .. "{env}{lamb}\x1b[0m "
|
||||||
prompt = string.gsub(prompt, "{uah}", uah)
|
prompt = gsub_plain(prompt, "{uah}", uah)
|
||||||
prompt = string.gsub(prompt, "{cwd}", cwd)
|
prompt = gsub_plain(prompt, "{cwd}", cwd)
|
||||||
prompt = string.gsub(prompt, "{env}", env)
|
prompt = gsub_plain(prompt, "{env}", env)
|
||||||
clink.prompt.value = string.gsub(prompt, "{lamb}", prompt_lambSymbol)
|
clink.prompt.value = gsub_plain(prompt, "{lamb}", prompt_lambSymbol)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function percent_prompt_filter()
|
local function percent_prompt_filter()
|
||||||
clink.prompt.value = string.gsub(clink.prompt.value, "{percent}", "%%")
|
clink.prompt.value = gsub_plain(clink.prompt.value, "{percent}", "%")
|
||||||
end
|
end
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -191,7 +222,7 @@ end
|
|||||||
local function get_dir_contains(path, dirname)
|
local function get_dir_contains(path, dirname)
|
||||||
|
|
||||||
-- return parent path for specified entry (either file or directory)
|
-- return parent path for specified entry (either file or directory)
|
||||||
local function pathname(path)
|
local function pathname(path) -- luacheck: ignore 432
|
||||||
local prefix = ""
|
local prefix = ""
|
||||||
local i = path:find("[\\/:][^\\/:]*$")
|
local i = path:find("[\\/:][^\\/:]*$")
|
||||||
if i then
|
if i then
|
||||||
@@ -201,14 +232,14 @@ local function get_dir_contains(path, dirname)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Navigates up one level
|
-- Navigates up one level
|
||||||
local function up_one_level(path)
|
local function up_one_level(path) -- luacheck: ignore 432
|
||||||
if path == nil then path = '.' end
|
if path == nil then path = '.' end
|
||||||
if path == '.' then path = clink.get_cwd() end
|
if path == '.' then path = clink.get_cwd() end
|
||||||
return pathname(path)
|
return pathname(path)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Checks if provided directory contains git directory
|
-- Checks if provided directory contains git directory
|
||||||
local function has_specified_dir(path, specified_dir)
|
local function has_specified_dir(path, specified_dir) -- luacheck: ignore 432
|
||||||
if path == nil then path = '.' end
|
if path == nil then path = '.' end
|
||||||
local found_dirs = clink.find_dirs(path..'/'..specified_dir)
|
local found_dirs = clink.find_dirs(path..'/'..specified_dir)
|
||||||
if #found_dirs > 0 then return true end
|
if #found_dirs > 0 then return true end
|
||||||
@@ -236,7 +267,7 @@ end
|
|||||||
local function get_git_dir(path)
|
local function get_git_dir(path)
|
||||||
|
|
||||||
-- return parent path for specified entry (either file or directory)
|
-- return parent path for specified entry (either file or directory)
|
||||||
local function pathname(path)
|
local function pathname(path) -- luacheck: ignore 432
|
||||||
local prefix = ""
|
local prefix = ""
|
||||||
local i = path:find("[\\/:][^\\/:]*$")
|
local i = path:find("[\\/:][^\\/:]*$")
|
||||||
if i then
|
if i then
|
||||||
@@ -255,7 +286,8 @@ local function get_git_dir(path)
|
|||||||
local gitfile = io.open(dir..'/.git')
|
local gitfile = io.open(dir..'/.git')
|
||||||
if not gitfile then return false end
|
if not gitfile then return false end
|
||||||
|
|
||||||
local git_dir = gitfile:read():match('gitdir: (.*)')
|
local line = gitfile:read() or ''
|
||||||
|
local git_dir = line:match('gitdir: (.*)')
|
||||||
gitfile:close()
|
gitfile:close()
|
||||||
|
|
||||||
if os.isdir then -- only available in Clink v1.0.0 and higher
|
if os.isdir then -- only available in Clink v1.0.0 and higher
|
||||||
@@ -303,6 +335,9 @@ local function get_git_branch(git_dir)
|
|||||||
local HEAD = head_file:read()
|
local HEAD = head_file:read()
|
||||||
head_file:close()
|
head_file:close()
|
||||||
|
|
||||||
|
-- If HEAD is missing, something is wrong.
|
||||||
|
if not HEAD then return end
|
||||||
|
|
||||||
-- if HEAD matches branch expression, then we're on named branch
|
-- if HEAD matches branch expression, then we're on named branch
|
||||||
-- otherwise it is a detached commit
|
-- otherwise it is a detached commit
|
||||||
local branch_name = HEAD:match('ref: refs/heads/(.+)')
|
local branch_name = HEAD:match('ref: refs/heads/(.+)')
|
||||||
@@ -315,13 +350,11 @@ end
|
|||||||
-- @return {false|mercurial branch information}
|
-- @return {false|mercurial branch information}
|
||||||
---
|
---
|
||||||
local function get_hg_branch()
|
local function get_hg_branch()
|
||||||
-- Return the branch information. The default is to get just the
|
-- Return the branch information.
|
||||||
-- branch name, but you could e.g. use the "hg-prompt" extension to
|
local file = io.popen("hg branch 2>nul")
|
||||||
-- get more information, such as any applied mq patches. Here's an
|
if not file then
|
||||||
-- example of that:
|
return false
|
||||||
-- local cmd = "hg prompt \"{branch}{status}{|{patch}}{update}\""
|
end
|
||||||
local cmd = "hg branch 2>nul"
|
|
||||||
local file = io.popen(cmd)
|
|
||||||
|
|
||||||
for line in file:lines() do
|
for line in file:lines() do
|
||||||
local m = line:match("(.+)$")
|
local m = line:match("(.+)$")
|
||||||
@@ -339,8 +372,12 @@ end
|
|||||||
-- Find out current branch
|
-- Find out current branch
|
||||||
-- @return {false|svn branch name}
|
-- @return {false|svn branch name}
|
||||||
---
|
---
|
||||||
local function get_svn_branch(svn_dir)
|
local function get_svn_branch()
|
||||||
local file = io_popenyield("svn info 2>nul")
|
local file = io_popenyield("svn info 2>nul")
|
||||||
|
if not file then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
for line in file:lines() do
|
for line in file:lines() do
|
||||||
local m = line:match("^Relative URL:")
|
local m = line:match("^Relative URL:")
|
||||||
if m then
|
if m then
|
||||||
@@ -359,12 +396,16 @@ end
|
|||||||
---
|
---
|
||||||
local function get_git_status()
|
local function get_git_status()
|
||||||
local file = io_popenyield("git --no-optional-locks status --porcelain 2>nul")
|
local file = io_popenyield("git --no-optional-locks status --porcelain 2>nul")
|
||||||
|
if not file then
|
||||||
|
return {}
|
||||||
|
end
|
||||||
|
|
||||||
local conflict_found = false
|
local conflict_found = false
|
||||||
local is_status = true
|
local is_status = true
|
||||||
for line in file:lines() do
|
for line in file:lines() do
|
||||||
local code = line:sub(1, 2)
|
local code = line:sub(1, 2)
|
||||||
-- print (string.format("code: %s, line: %s", code, line))
|
-- print (string.format("code: %s, line: %s", code, line))
|
||||||
if code == "DD" or code == "AU" or code == "UD" or code == "UA" or code == "DU" or code == "AA" or code == "UU" then
|
if code == "DD" or code == "AU" or code == "UD" or code == "UA" or code == "DU" or code == "AA" or code == "UU" then -- luacheck: no max line length
|
||||||
is_status = false
|
is_status = false
|
||||||
conflict_found = true
|
conflict_found = true
|
||||||
break
|
break
|
||||||
@@ -374,23 +415,29 @@ local function get_git_status()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
file:close()
|
file:close()
|
||||||
|
|
||||||
return { status = is_status, conflict = conflict_found }
|
return { status = is_status, conflict = conflict_found }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
-- Get the status of working dir
|
-- Get the status of working dir
|
||||||
-- @return {bool}
|
-- @return {bool}
|
||||||
---
|
---
|
||||||
local function get_hg_status()
|
local function get_hg_status()
|
||||||
local file = io.popen("hg status -0")
|
-- The default is to just use the branch name, but you could e.g. use the
|
||||||
for line in file:lines() do
|
-- "hg-prompt" extension to get more information, such as any applied mq
|
||||||
file:close()
|
-- patches. Here's an example of that:
|
||||||
return false
|
-- "hg prompt \"{branch}{status}{|{patch}}{update}\""
|
||||||
|
local pipe = io_popenyield("hg status -amrd 2>&1")
|
||||||
|
if not pipe then
|
||||||
|
return { error = true }
|
||||||
end
|
end
|
||||||
file:close()
|
|
||||||
|
|
||||||
return true
|
local output = pipe:read('*all')
|
||||||
|
pipe:close()
|
||||||
|
|
||||||
|
local dirty = (output ~= nil and output ~= "")
|
||||||
|
return { clean = not dirty }
|
||||||
end
|
end
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -398,14 +445,18 @@ end
|
|||||||
-- @return {bool}
|
-- @return {bool}
|
||||||
---
|
---
|
||||||
local function get_svn_status()
|
local function get_svn_status()
|
||||||
local file = io_popenyield("svn status -q")
|
local file = io_popenyield("svn status -q 2>nul")
|
||||||
for line in file:lines() do
|
if not file then
|
||||||
|
return { error = true }
|
||||||
|
end
|
||||||
|
|
||||||
|
for line in file:lines() do -- luacheck: ignore 512, no unused
|
||||||
file:close()
|
file:close()
|
||||||
return false
|
return { clean = false }
|
||||||
end
|
end
|
||||||
file:close()
|
file:close()
|
||||||
|
|
||||||
return true
|
return { clean = true }
|
||||||
end
|
end
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -433,24 +484,28 @@ local function get_git_status_setting()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local gitStatusConfig = io_popenyield("git --no-pager config cmder.status 2>nul")
|
local gitStatusConfig = io_popenyield("git --no-pager config cmder.status 2>nul")
|
||||||
for line in gitStatusConfig:lines() do
|
if gitStatusConfig then
|
||||||
if string.match(line, 'false') then
|
for line in gitStatusConfig:lines() do
|
||||||
gitStatusConfig:close()
|
if string.match(line, 'false') then
|
||||||
last_git_status_setting = false
|
gitStatusConfig:close()
|
||||||
return false
|
last_git_status_setting = false
|
||||||
|
return false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
gitStatusConfig:close()
|
||||||
end
|
end
|
||||||
gitStatusConfig:close()
|
|
||||||
|
|
||||||
local gitCmdStatusConfig = io_popenyield("git --no-pager config cmder.cmdstatus 2>nul")
|
local gitCmdStatusConfig = io_popenyield("git --no-pager config cmder.cmdstatus 2>nul")
|
||||||
for line in gitCmdStatusConfig:lines() do
|
if gitCmdStatusConfig then
|
||||||
if string.match(line, 'false') then
|
for line in gitCmdStatusConfig:lines() do
|
||||||
gitCmdStatusConfig:close()
|
if string.match(line, 'false') then
|
||||||
last_git_status_setting = false
|
gitCmdStatusConfig:close()
|
||||||
return false
|
last_git_status_setting = false
|
||||||
|
return false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
gitCmdStatusConfig:close()
|
||||||
end
|
end
|
||||||
gitCmdStatusConfig:close()
|
|
||||||
|
|
||||||
last_git_status_setting = true
|
last_git_status_setting = true
|
||||||
return true
|
return true
|
||||||
@@ -481,14 +536,6 @@ local function git_prompt_filter()
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Colors for git status
|
|
||||||
local colors = {
|
|
||||||
clean = get_clean_color(),
|
|
||||||
dirty = get_dirty_color(),
|
|
||||||
conflict = get_conflict_color(),
|
|
||||||
nostatus = get_unknown_color()
|
|
||||||
}
|
|
||||||
|
|
||||||
local git_dir = get_git_dir()
|
local git_dir = get_git_dir()
|
||||||
local color
|
local color
|
||||||
if git_dir then
|
if git_dir then
|
||||||
@@ -508,27 +555,40 @@ local function git_prompt_filter()
|
|||||||
local gitConflict = gitInfo.conflict
|
local gitConflict = gitInfo.conflict
|
||||||
|
|
||||||
if gitStatus == nil then
|
if gitStatus == nil then
|
||||||
color = colors.nostatus
|
color = get_unknown_color()
|
||||||
elseif gitStatus then
|
elseif gitStatus then
|
||||||
color = colors.clean
|
color = get_clean_color()
|
||||||
else
|
else
|
||||||
color = colors.dirty
|
color = get_dirty_color()
|
||||||
end
|
end
|
||||||
|
|
||||||
if gitConflict then
|
if gitConflict then
|
||||||
color = colors.conflict
|
color = get_conflict_color()
|
||||||
end
|
end
|
||||||
|
|
||||||
clink.prompt.value = string.gsub(clink.prompt.value, "{git}", " "..color.."("..verbatim(branch)..")")
|
local result = " "..color.."("..branch..")"
|
||||||
|
clink.prompt.value = gsub_plain(clink.prompt.value, "{git}", result)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- No git present or not in git file
|
-- 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
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function get_hg_info_table()
|
||||||
|
local info = clink_promptcoroutine(function ()
|
||||||
|
return get_hg_status() or {}
|
||||||
|
end)
|
||||||
|
if not info then
|
||||||
|
info = cached_info.hg_info or {}
|
||||||
|
else
|
||||||
|
cached_info.hg_info = info
|
||||||
|
end
|
||||||
|
return info
|
||||||
|
end
|
||||||
|
|
||||||
local function hg_prompt_filter()
|
local function hg_prompt_filter()
|
||||||
|
|
||||||
-- Don't do any hg processing if the prompt doesn't want to show hg info.
|
-- Don't do any hg processing if the prompt doesn't want to show hg info.
|
||||||
@@ -536,39 +596,50 @@ local function hg_prompt_filter()
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
local result = ""
|
|
||||||
|
|
||||||
local hg_dir = get_hg_dir()
|
local hg_dir = get_hg_dir()
|
||||||
if hg_dir then
|
if hg_dir then
|
||||||
-- Colors for mercurial status
|
local branch = get_hg_branch()
|
||||||
local colors = {
|
if branch and
|
||||||
clean = get_clean_color(),
|
|
||||||
dirty = get_dirty_color(),
|
|
||||||
nostatus = get_unknown_color()
|
|
||||||
}
|
|
||||||
local output = get_hg_branch()
|
|
||||||
|
|
||||||
-- strip the trailing newline from the branch name
|
|
||||||
local n = #output
|
|
||||||
while n > 0 and output:find("^%s", n) do n = n - 1 end
|
|
||||||
local branch = output:sub(1, n)
|
|
||||||
|
|
||||||
if branch ~= nil and
|
|
||||||
string.sub(branch,1,7) ~= "abort: " and -- not an HG working copy
|
string.sub(branch,1,7) ~= "abort: " and -- not an HG working copy
|
||||||
(not string.find(branch, "is not recognized")) then -- 'hg' not in path
|
(not string.find(branch, "is not recognized")) then -- 'hg' not in path
|
||||||
local color = colors.clean
|
-- If in a different repo or branch than last time, discard cached info
|
||||||
|
if cached_info.hg_dir ~= hg_dir or cached_info.hg_branch ~= branch then
|
||||||
|
cached_info.hg_info = nil
|
||||||
|
cached_info.hg_dir = hg_dir
|
||||||
|
cached_info.hg_branch = branch
|
||||||
|
end
|
||||||
|
|
||||||
local pipe = io.popen("hg status -amrd 2>&1")
|
local hgInfo = get_hg_info_table()
|
||||||
local output = pipe:read('*all')
|
|
||||||
local rc = { pipe:close() }
|
|
||||||
|
|
||||||
if output ~= nil and output ~= "" then color = colors.dirty end
|
local color
|
||||||
result = color .. "(" .. branch .. ")"
|
if not hgInfo or hgInfo.error then
|
||||||
|
color = get_unknown_color()
|
||||||
|
elseif hgInfo.clean then
|
||||||
|
color = get_clean_color()
|
||||||
|
else
|
||||||
|
color = get_dirty_color()
|
||||||
|
end
|
||||||
|
|
||||||
|
local result = " "..color.."("..branch..")"
|
||||||
|
clink.prompt.value = gsub_plain(clink.prompt.value, "{hg}", result)
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
clink.prompt.value = string.gsub(clink.prompt.value, "{hg}", " "..verbatim(result))
|
-- No hg present or not in hg repo
|
||||||
return false
|
clink.prompt.value = gsub_plain(clink.prompt.value, "{hg}", "")
|
||||||
|
end
|
||||||
|
|
||||||
|
local function get_svn_info_table()
|
||||||
|
local info = clink_promptcoroutine(function ()
|
||||||
|
return get_svn_status() or {}
|
||||||
|
end)
|
||||||
|
if not info then
|
||||||
|
info = cached_info.svn_info or {}
|
||||||
|
else
|
||||||
|
cached_info.svn_info = info
|
||||||
|
end
|
||||||
|
return info
|
||||||
end
|
end
|
||||||
|
|
||||||
local function svn_prompt_filter()
|
local function svn_prompt_filter()
|
||||||
@@ -578,18 +649,10 @@ local function svn_prompt_filter()
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Colors for svn status
|
|
||||||
local colors = {
|
|
||||||
clean = get_clean_color(),
|
|
||||||
dirty = get_dirty_color(),
|
|
||||||
nostatus = get_unknown_color()
|
|
||||||
}
|
|
||||||
|
|
||||||
local svn_dir = get_svn_dir()
|
local svn_dir = get_svn_dir()
|
||||||
if svn_dir then
|
if svn_dir then
|
||||||
-- if we're inside of svn repo then try to detect current branch
|
-- if we're inside of svn repo then try to detect current branch
|
||||||
local branch = get_svn_branch()
|
local branch = get_svn_branch()
|
||||||
local color
|
|
||||||
if branch then
|
if branch then
|
||||||
-- If in a different repo or branch than last time, discard cached info
|
-- If in a different repo or branch than last time, discard cached info
|
||||||
if cached_info.svn_dir ~= svn_dir or cached_info.svn_branch ~= branch then
|
if cached_info.svn_dir ~= svn_dir or cached_info.svn_branch ~= branch then
|
||||||
@@ -597,37 +660,25 @@ local function svn_prompt_filter()
|
|||||||
cached_info.svn_dir = svn_dir
|
cached_info.svn_dir = svn_dir
|
||||||
cached_info.svn_branch = branch
|
cached_info.svn_branch = branch
|
||||||
end
|
end
|
||||||
-- Get the svn status using coroutine if available and option is enabled. Otherwise use a blocking call
|
|
||||||
local svnStatus
|
local svnInfo = get_svn_info_table()
|
||||||
if clink.promptcoroutine and io.popenyield and settings.get("prompt.async") and prompt_overrideSvnStatusOptIn then
|
|
||||||
svnStatus = clink_promptcoroutine(function ()
|
local color
|
||||||
return get_svn_status()
|
if not svnInfo or svnInfo.error then
|
||||||
end)
|
color = get_unknown_color()
|
||||||
-- If the status result is pending, use the cached version instead, otherwise store it to the cache
|
elseif svnInfo.clean then
|
||||||
if svnStatus == nil then
|
color = get_clean_color()
|
||||||
svnStatus = cached_info.svn_info
|
|
||||||
else
|
|
||||||
cached_info.svn_info = svnStatus
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
svnStatus = get_svn_status()
|
color = get_dirty_color()
|
||||||
end
|
end
|
||||||
|
|
||||||
if svnStatus == nil then
|
clink.prompt.value = gsub_plain(clink.prompt.value, "{svn}", " "..color.."("..branch..")")
|
||||||
color = colors.nostatus
|
|
||||||
elseif svnStatus then
|
|
||||||
color = colors.clean
|
|
||||||
else
|
|
||||||
color = colors.dirty
|
|
||||||
end
|
|
||||||
|
|
||||||
clink.prompt.value = string.gsub(clink.prompt.value, "{svn}", " "..color.."("..verbatim(branch)..")")
|
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- No svn present or not in svn file
|
-- 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
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -651,6 +702,10 @@ for _,lua_module in ipairs(clink.find_files(completions_dir..'*.lua')) do
|
|||||||
end
|
end
|
||||||
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
|
if clink.get_env('CMDER_USER_CONFIG') then
|
||||||
local cmder_config_dir = clink.get_env('CMDER_ROOT')..'/config/'
|
local cmder_config_dir = clink.get_env('CMDER_ROOT')..'/config/'
|
||||||
for _,lua_module in ipairs(clink.find_files(cmder_config_dir..'*.lua')) do
|
for _,lua_module in ipairs(clink.find_files(cmder_config_dir..'*.lua')) do
|
||||||
|
|||||||
4
vendor/clink_settings.default
vendored
4
vendor/clink_settings.default
vendored
@@ -1,6 +1,10 @@
|
|||||||
# For explanation of these and other settings see:
|
# For explanation of these and other settings see:
|
||||||
# https://chrisant996.github.io/clink/clink.html
|
# 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
|
# name: Sets how command history expansion is applied
|
||||||
# type: enum
|
# type: enum
|
||||||
# options: off,on,not_squoted,not_dquoted,not_quoted
|
# options: off,on,not_squoted,not_dquoted,not_quoted
|
||||||
|
|||||||
6
vendor/cmder.sh
vendored
6
vendor/cmder.sh
vendored
@@ -22,7 +22,11 @@ function runProfiled {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# We do this for bash as admin sessions since $CMDER_ROOT is not being set
|
# 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
|
case "$ConEmuDir" in *\\*) CMDER_ROOT=$( cd "$(cygpath -u "$ConEmuDir")/../.." ; pwd );; esac
|
||||||
else
|
else
|
||||||
case "$CMDER_ROOT" in *\\*) CMDER_ROOT="$(cygpath -u "$CMDER_ROOT")";; esac
|
case "$CMDER_ROOT" in *\\*) CMDER_ROOT="$(cygpath -u "$CMDER_ROOT")";; esac
|
||||||
|
|||||||
19
vendor/cmder_exinit
vendored
19
vendor/cmder_exinit
vendored
@@ -26,15 +26,14 @@ function runProfiled {
|
|||||||
unset profile_d_scripts
|
unset profile_d_scripts
|
||||||
pushd "${1}" >/dev/null
|
pushd "${1}" >/dev/null
|
||||||
|
|
||||||
if [ ! "x${ZSH_VERSION}" = "x" ]; then
|
if [ -n "${ZSH_VERSION}" ]; then
|
||||||
profile_d_scripts=$(ls *.zsh 2>/dev/null)
|
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)
|
profile_d_scripts=$(ls *.sh 2>/dev/null)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! "x${profile_d_scripts}" = "x" ] ; then
|
if [ -n "${profile_d_scripts}" ] ; then
|
||||||
for x in ${profile_d_scripts} ; do
|
for x in ${profile_d_scripts} ; do
|
||||||
echo Sourcing "${1}/${x}"...
|
|
||||||
. "${1}/${x}"
|
. "${1}/${x}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
@@ -44,23 +43,23 @@ function runProfiled {
|
|||||||
# Check that we haven't already been sourced.
|
# Check that we haven't already been sourced.
|
||||||
[[ -z ${CMDER_EXINIT} ]] && CMDER_EXINIT="1" || return
|
[[ -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
|
# We do this for bash as admin sessions since $CMDER_ROOT is not being set
|
||||||
if [ "$CMDER_ROOT" = "" -a "$ConEmuDir" != "" ] ; then
|
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
|
case "$ConEmuDir" in *\\*) CMDER_ROOT=$( cd "$(cygpath -u "$ConEmuDir")/../.." ; pwd );; esac
|
||||||
else
|
|
||||||
echo "Running in ConEmu without Cmder, skipping Cmder integration."
|
|
||||||
fi
|
fi
|
||||||
elif [ "$CMDER_ROOT" != "" ] ; then
|
elif [ "$CMDER_ROOT" != "" ] ; then
|
||||||
case "$CMDER_ROOT" in *\\*) CMDER_ROOT="$(cygpath -u "$CMDER_ROOT")";; esac
|
case "$CMDER_ROOT" in *\\*) CMDER_ROOT="$(cygpath -u "$CMDER_ROOT")";; esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! "$CMDER_ROOT" = "" ] ; then
|
if [ -n "$CMDER_ROOT" ] ; then
|
||||||
# Remove any trailing '/'
|
# Remove any trailing '/'
|
||||||
CMDER_ROOT=$(echo $CMDER_ROOT | sed 's:/*$::')
|
CMDER_ROOT=$(echo $CMDER_ROOT | sed 's:/*$::')
|
||||||
|
|
||||||
echo "Using \"CMDER_ROOT\" at \"${CMDER_ROOT}\"."
|
|
||||||
|
|
||||||
export CMDER_ROOT
|
export CMDER_ROOT
|
||||||
|
|
||||||
PATH=${CMDER_ROOT}/bin:${CMDER_ROOT}/vendor/bin:$PATH:${CMDER_ROOT}
|
PATH=${CMDER_ROOT}/bin:${CMDER_ROOT}/vendor/bin:$PATH:${CMDER_ROOT}
|
||||||
|
|||||||
15
vendor/cmder_prompt_config.lua.default
vendored
15
vendor/cmder_prompt_config.lua.default
vendored
@@ -38,25 +38,20 @@ prompt_includeVersionControl = true
|
|||||||
-- NOTE: This only takes effect if using Clink v1.2.10 or higher.
|
-- NOTE: This only takes effect if using Clink v1.2.10 or higher.
|
||||||
prompt_overrideGitStatusOptIn = false
|
prompt_overrideGitStatusOptIn = false
|
||||||
|
|
||||||
-- OPTIONAL. If true then always ignore the cmder.status and cmder.cmdstatus svn config settings and run the svn prompt commands in the background.
|
|
||||||
-- default is false
|
|
||||||
-- NOTE: This only takes effect if using Clink v1.2.10 or higher.
|
|
||||||
prompt_overrideSvnStatusOptIn = false
|
|
||||||
|
|
||||||
-- Prompt Attributes
|
-- Prompt Attributes
|
||||||
--
|
--
|
||||||
-- Colors: https://github.com/cmderdev/cmder/wiki/Customization#list-of-colors
|
-- Colors: https://github.com/cmderdev/cmder/wiki/Customization#list-of-colors
|
||||||
-- Effects: https://github.com/cmderdev/cmder/wiki/Customization#list-of-effects
|
-- Effects: https://github.com/cmderdev/cmder/wiki/Customization#list-of-effects
|
||||||
--
|
--
|
||||||
-- Green: "\x1b[1;33;49m"
|
-- Green: "\x1b[1;32;49m"
|
||||||
-- Yellow: "\x1b[1;32;49m"
|
-- Yellow: "\x1b[1;33;49m"
|
||||||
-- Light Grey: "\x1b[1;30;49m"
|
-- Light Grey: "\x1b[1;30;49m"
|
||||||
|
|
||||||
-- Prompt Element Colors
|
-- Prompt Element Colors
|
||||||
uah_color = "\x1b[1;33;49m" -- Green = uah = [user]@[hostname]
|
uah_color = "\x1b[1;33;49m" -- Yellow uah = [user]@[hostname]
|
||||||
cwd_color = "\x1b[1;32;49m" -- Yellow cwd = Current Working Directory
|
cwd_color = "\x1b[1;32;49m" -- Green cwd = Current Working Directory
|
||||||
lamb_color = "\x1b[1;30;49m" -- Light Grey = Lambda Color
|
lamb_color = "\x1b[1;30;49m" -- Light Grey = Lambda Color
|
||||||
clean_color = "\x1b[37;1m"
|
clean_color = "\x1b[37;1m"
|
||||||
dirty_color = "\x1b[33;3m" -- Yellow, Italic
|
dirty_color = "\x1b[33;3m" -- Yellow, Italic
|
||||||
conflict_color = "\x1b[31;1m" -- Red, Bold
|
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
|
||||||
|
|||||||
109
vendor/git-prompt.sh
vendored
109
vendor/git-prompt.sh
vendored
@@ -1,26 +1,35 @@
|
|||||||
|
# Returns 1 if git status for Cmder is disabled, otherwise returns 0
|
||||||
function getGitStatusSetting() {
|
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 display for Cmder is disabled via config
|
||||||
|
# Matches: cmder.status=false or cmder.shstatus=false (Bash-specific)
|
||||||
|
if [[ $gitConfig =~ (^|$'\n')cmder\.(sh)?status=false($|$'\n') ]]
|
||||||
then
|
then
|
||||||
echo false
|
return 1 # disabled
|
||||||
else
|
|
||||||
echo true
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Prints current branch or detached HEAD short commit hash
|
||||||
function getSimpleGitBranch() {
|
function getSimpleGitBranch() {
|
||||||
gitDir=$(git rev-parse --git-dir 2>/dev/null)
|
local gitDir
|
||||||
if [ -z "$gitDir" ]; then
|
gitDir=$(git rev-parse --git-dir 2>/dev/null) || return 0
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
headContent=$(< "$gitDir/HEAD")
|
local headFile="$gitDir/HEAD"
|
||||||
if [[ "$headContent" == "ref: refs/heads/"* ]]
|
[ -f "$headFile" ] || return 0
|
||||||
|
|
||||||
|
local headContent
|
||||||
|
headContent=$(< "$headFile")
|
||||||
|
if [[ "$headContent" =~ ^ref:\ refs/heads/(.+)$ ]]
|
||||||
then
|
then
|
||||||
echo " (${headContent:16})"
|
echo " (${BASH_REMATCH[1]})"
|
||||||
else
|
else
|
||||||
echo " (HEAD detached at ${headContent:0:7})"
|
echo " (HEAD detached at ${headContent:0:7})"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,18 +42,50 @@ fi
|
|||||||
|
|
||||||
if test -f ~/.config/git/git-prompt.sh
|
if test -f ~/.config/git/git-prompt.sh
|
||||||
then
|
then
|
||||||
if [[ $(getGitStatusSetting) == true ]]
|
if getGitStatusSetting
|
||||||
then
|
then
|
||||||
. ~/.config/git/git-prompt.sh
|
. ~/.config/git/git-prompt.sh
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
PS1='\[\033]0;$MSYSTEM:${PWD//[^[:ascii:]]/?}\007\]' # set window title
|
|
||||||
# PS1="$PS1"'\n' # new line
|
# Setup OSC 133 shell integration for Windows Terminal
|
||||||
PS1="$PS1"'\[\033[32m\]' # change to green
|
if [ -n "$WT_SESSION" ]; then
|
||||||
|
__cmder_prompt_command() {
|
||||||
|
local exit_code=$?
|
||||||
|
# Emit OSC 133;D to mark the end of command execution with exit code
|
||||||
|
printf '\e]133;D;%s\a' "$exit_code"
|
||||||
|
return $exit_code
|
||||||
|
}
|
||||||
|
|
||||||
|
__cmder_preexec() {
|
||||||
|
# Emit OSC 133;C to mark the start of command execution
|
||||||
|
printf '\e]133;C\a'
|
||||||
|
}
|
||||||
|
|
||||||
|
# Append to PROMPT_COMMAND to emit sequences just before each prompt
|
||||||
|
if [ -z "$PROMPT_COMMAND" ]; then
|
||||||
|
PROMPT_COMMAND="__cmder_prompt_command"
|
||||||
|
else
|
||||||
|
PROMPT_COMMAND="__cmder_prompt_command;$PROMPT_COMMAND"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Use DEBUG trap to emit OSC 133;C before command execution
|
||||||
|
trap '__cmder_preexec' DEBUG
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Source: 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)
|
||||||
|
|
||||||
|
if [ -n "$WT_SESSION" ]; then
|
||||||
|
# Emit OSC 133;A to mark the start of prompt
|
||||||
|
PS1="$PS1"'\e]133;A\a'
|
||||||
|
fi
|
||||||
|
|
||||||
|
PS1="$PS1"'\[\033[32m\]' # change to green and bold
|
||||||
PS1="$PS1"'\u@\h ' # user@host<space>
|
PS1="$PS1"'\u@\h ' # user@host<space>
|
||||||
# PS1="$PS1"'\[\033[35m\]' # change to purple
|
PS1="$PS1${MSYSTEM:+\[\033[35m\]$MSYSTEM }" # show MSYSTEM in purple (if set)
|
||||||
# PS1="$PS1"'$MSYSTEM ' # show MSYSTEM
|
PS1="$PS1"'\[\033[1;33m\]' # change to dark yellow in bold
|
||||||
PS1="$PS1"'\[\033[33m\]' # change to brownish yellow
|
|
||||||
PS1="$PS1"'\w' # current working directory
|
PS1="$PS1"'\w' # current working directory
|
||||||
if test -z "$WINELOADERNOEXEC"
|
if test -z "$WINELOADERNOEXEC"
|
||||||
then
|
then
|
||||||
@@ -55,20 +96,38 @@ else
|
|||||||
if test -f "$COMPLETION_PATH/git-prompt.sh"
|
if test -f "$COMPLETION_PATH/git-prompt.sh"
|
||||||
then
|
then
|
||||||
. "$COMPLETION_PATH/git-completion.bash"
|
. "$COMPLETION_PATH/git-completion.bash"
|
||||||
if [[ $(getGitStatusSetting) == true ]]
|
if getGitStatusSetting
|
||||||
then
|
then
|
||||||
. "$COMPLETION_PATH/git-prompt.sh"
|
. "$COMPLETION_PATH/git-prompt.sh"
|
||||||
PS1="$PS1"'\[\033[36m\]' # change color to cyan
|
PS1="$PS1"'\[\033[36m\]' # change color to cyan
|
||||||
PS1="$PS1"'`__git_ps1`' # bash function
|
PS1="$PS1"'`__git_ps1`' # bash function
|
||||||
else
|
else
|
||||||
PS1="$PS1"'\[\033[37;1m\]' # change color to white
|
PS1="$PS1"'\[\033[37;1m\]' # change color to white
|
||||||
PS1="$PS1"'`getSimpleGitBranch`'
|
PS1="$PS1"'`getSimpleGitBranch`'
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
PS1="$PS1"'\[\033[0m\]' # change color
|
PS1="$PS1"'\[\033[0m\]' # reset color
|
||||||
PS1="$PS1"'\n' # new line
|
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
|
||||||
|
|
||||||
|
if [ -n "$WT_SESSION" ]; then
|
||||||
|
# Emit OSC 133;B to mark the end of prompt
|
||||||
|
PS1="$PS1"'\[\e]133;B\a\]'
|
||||||
|
fi
|
||||||
fi
|
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
|
||||||
|
|||||||
138
vendor/init.bat
vendored
138
vendor/init.bat
vendored
@@ -153,7 +153,8 @@ if not "%CMDER_SHELL%" == "cmd" (
|
|||||||
set CMDER_ALIASES=0
|
set CMDER_ALIASES=0
|
||||||
)
|
)
|
||||||
|
|
||||||
:: Pick right version of Clink
|
:: Pick the right version of Clink
|
||||||
|
:: TODO: Support for ARM
|
||||||
if "%PROCESSOR_ARCHITECTURE%"=="x86" (
|
if "%PROCESSOR_ARCHITECTURE%"=="x86" (
|
||||||
set clink_architecture=x86
|
set clink_architecture=x86
|
||||||
set architecture_bits=32
|
set architecture_bits=32
|
||||||
@@ -165,9 +166,24 @@ if "%PROCESSOR_ARCHITECTURE%"=="x86" (
|
|||||||
set CMDER_CLINK=0
|
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" (
|
if "%CMDER_CLINK%" == "1" (
|
||||||
REM TODO: If clink is already injected, goto :CLINK_FINISH
|
REM TODO: Detect if clink is already injected, if so goto :CLINK_FINISH
|
||||||
goto :INJECT_CLINK
|
goto :INJECT_CLINK
|
||||||
|
) else if "%CMDER_CLINK%" == "2" (
|
||||||
|
goto :CLINK_FINISH
|
||||||
)
|
)
|
||||||
|
|
||||||
goto :SKIP_CLINK
|
goto :SKIP_CLINK
|
||||||
@@ -204,9 +220,12 @@ goto :SKIP_CLINK
|
|||||||
)
|
)
|
||||||
|
|
||||||
"%CMDER_ROOT%\vendor\clink\clink_%clink_architecture%.exe" inject --quiet --profile "%CMDER_CONFIG_DIR%" --scripts "%CMDER_ROOT%\vendor"
|
"%CMDER_ROOT%\vendor\clink\clink_%clink_architecture%.exe" inject --quiet --profile "%CMDER_CONFIG_DIR%" --scripts "%CMDER_ROOT%\vendor"
|
||||||
|
set CMDER_CLINK=2
|
||||||
|
|
||||||
if errorlevel 1 (
|
:: Check if a fatal error occurred when trying to inject Clink
|
||||||
%print_error% "Clink initialization has failed with error code: %errorlevel%"
|
if errorlevel 2 (
|
||||||
|
REM %print_error% "Clink injection has failed with error code: %errorlevel%"
|
||||||
|
goto :SKIP_CLINK
|
||||||
)
|
)
|
||||||
|
|
||||||
goto :CLINK_FINISH
|
goto :CLINK_FINISH
|
||||||
@@ -219,6 +238,9 @@ goto :SKIP_CLINK
|
|||||||
|
|
||||||
:: Revert back to plain cmd.exe prompt without clink
|
:: Revert back to plain cmd.exe prompt without clink
|
||||||
prompt $E[1;32;49m$P$S$_$E[1;30;49mλ$S$E[0m
|
prompt $E[1;32;49m$P$S$_$E[1;30;49mλ$S$E[0m
|
||||||
|
|
||||||
|
:: Add Windows Terminal shell integration support (OSC 133 sequences)
|
||||||
|
if defined WT_SESSION (prompt $e]133;D$e\$e]133;A$e\$e]9;9;$P$e\%PROMPT%$e]133;B$e\)
|
||||||
|
|
||||||
chcp %cp%>nul
|
chcp %cp%>nul
|
||||||
|
|
||||||
@@ -237,8 +259,8 @@ if "%CMDER_CONFIGURED%" GTR "1" (
|
|||||||
:: Prepare for git-for-windows
|
:: Prepare for git-for-windows
|
||||||
|
|
||||||
:: Detect which git.exe version to use
|
:: Detect which git.exe version to use
|
||||||
:: * if the users points as to a specific git, use that
|
:: * if the user points to a specific git, use that
|
||||||
:: * test if a git is in path and if yes, use that
|
:: * test if git is in path and if yes, use that
|
||||||
:: * last, use our vendored git
|
:: * last, use our vendored git
|
||||||
:: also check that we have a recent enough version of git by examining the version string
|
:: also check that we have a recent enough version of git by examining the version string
|
||||||
if defined GIT_INSTALL_ROOT (
|
if defined GIT_INSTALL_ROOT (
|
||||||
@@ -296,7 +318,7 @@ if exist "%CMDER_ROOT%\vendor\git-for-windows" (
|
|||||||
)
|
)
|
||||||
|
|
||||||
:SPECIFIED_GIT
|
: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
|
goto :CONFIGURE_GIT
|
||||||
|
|
||||||
:FOUND_GIT
|
:FOUND_GIT
|
||||||
@@ -305,8 +327,13 @@ goto :CONFIGURE_GIT
|
|||||||
|
|
||||||
:CONFIGURE_GIT
|
:CONFIGURE_GIT
|
||||||
%print_debug% init.bat "Using Git from '%GIT_INSTALL_ROOT%..."
|
%print_debug% init.bat "Using Git from '%GIT_INSTALL_ROOT%..."
|
||||||
|
|
||||||
:: Add git to the path
|
:: 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`
|
:: Add the unix commands at the end to not shadow windows commands like `more` and `find`
|
||||||
if %nix_tools% equ 1 (
|
if %nix_tools% equ 1 (
|
||||||
@@ -317,16 +344,30 @@ if %nix_tools% equ 1 (
|
|||||||
set "path_position="
|
set "path_position="
|
||||||
)
|
)
|
||||||
|
|
||||||
|
%print_debug% init.bat "START - nix_tools(%path_position%): Env Var - PATH=%path%"
|
||||||
if %nix_tools% geq 1 (
|
if %nix_tools% geq 1 (
|
||||||
if exist "%GIT_INSTALL_ROOT%\mingw32" (
|
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" (
|
) 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" (
|
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
|
:SET_ENV
|
||||||
|
|
||||||
@@ -352,15 +393,14 @@ setlocal enabledelayedexpansion
|
|||||||
if defined git_locale (
|
if defined git_locale (
|
||||||
REM %print_debug% init.bat "Env Var - git_locale=!git_locale!"
|
REM %print_debug% init.bat "Env Var - git_locale=!git_locale!"
|
||||||
if not defined LANG (
|
if not defined LANG (
|
||||||
for /F "delims=" %%F in ('!git_locale! -uU 2') do (
|
for /F "delims=" %%F in ('"!git_locale!" -uU 2') do (
|
||||||
set "LANG=%%F"
|
set "LANG=%%F"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
endlocal && set LANG=%LANG%
|
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=%GIT_INSTALL_ROOT%'"
|
||||||
%print_debug% init.bat "Found Git in: '%GIT_INSTALL_ROOT%'"
|
|
||||||
goto :PATH_ENHANCE
|
goto :PATH_ENHANCE
|
||||||
|
|
||||||
:NO_GIT
|
:NO_GIT
|
||||||
@@ -368,14 +408,32 @@ goto :PATH_ENHANCE
|
|||||||
endlocal
|
endlocal
|
||||||
|
|
||||||
:PATH_ENHANCE
|
: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
|
:USER_CONFIG_START
|
||||||
%lib_path% enhance_path_recursive "%CMDER_ROOT%\bin" 0 %max_depth%
|
%print_debug% init.bat "START - bin(prepend): Env Var - PATH=%path%"
|
||||||
if defined CMDER_USER_BIN (
|
if %max_depth% gtr 1 (
|
||||||
%lib_path% enhance_path_recursive "%CMDER_USER_BIN%" 0 %max_depth%
|
%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"
|
:: Drop *.bat and *.cmd files into "%CMDER_ROOT%\config\profile.d"
|
||||||
:: to run them at startup.
|
:: to run them at startup.
|
||||||
@@ -423,7 +481,7 @@ if "%CMDER_ALIASES%" == "1" (
|
|||||||
)
|
)
|
||||||
|
|
||||||
:: Add aliases to the environment
|
:: 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" (
|
if "%ERRORLEVEL%" == "0" (
|
||||||
echo Migrating alias 'history' to new Clink 1.x.x...
|
echo Migrating alias 'history' to new Clink 1.x.x...
|
||||||
call "%CMDER_ROOT%\vendor\bin\alias.cmd" /d history
|
call "%CMDER_ROOT%\vendor\bin\alias.cmd" /d history
|
||||||
@@ -484,12 +542,40 @@ if "%CMDER_ALIASES%" == "1" if exist "%CMDER_ROOT%\bin\alias.bat" if exist "%CMD
|
|||||||
|
|
||||||
set initialConfig=
|
set initialConfig=
|
||||||
|
|
||||||
:CMDER_CONFIGURED
|
if not exist "%CMDER_CONFIG_DIR%\user_init.cmd" (
|
||||||
if not defined CMDER_CONFIGURED set CMDER_CONFIGURED=1
|
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 not exist "%CMDER_ROOT%\config\user_init.cmd" (
|
||||||
|
%print_error% "Failed to generate Cmder config"
|
||||||
if %time_init% gtr 0 (
|
)
|
||||||
"%cmder_root%\vendor\bin\timer.cmd" "%CMDER_INIT_START%" "%CMDER_INIT_END%"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
: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
|
exit /b
|
||||||
|
|||||||
66
vendor/lib/lib_base.cmd
vendored
66
vendor/lib/lib_base.cmd
vendored
@@ -4,15 +4,14 @@ set lib_base=call "%~dp0lib_base.cmd"
|
|||||||
|
|
||||||
if "%~1" == "/h" (
|
if "%~1" == "/h" (
|
||||||
%lib_base% help "%~0"
|
%lib_base% help "%~0"
|
||||||
) else if "%1" neq "" (
|
) else if "%~1" neq "" (
|
||||||
call :%*
|
call :%*
|
||||||
)
|
)
|
||||||
|
|
||||||
exit /b
|
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:
|
:::include:
|
||||||
:::.
|
:::.
|
||||||
@@ -20,16 +19,15 @@ exit /b
|
|||||||
:::.
|
:::.
|
||||||
:::usage:
|
:::usage:
|
||||||
:::.
|
:::.
|
||||||
::: %lib_base% show_subs "file"
|
::: %lib_base% help "file"
|
||||||
:::.
|
:::.
|
||||||
:::options:
|
:::options:
|
||||||
:::.
|
:::.
|
||||||
::: file <in> full path to file containing lib_routines to display
|
::: 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"=="." (
|
if "%%a"=="." (
|
||||||
echo.
|
echo.
|
||||||
) else if /i "%%a" == "usage" (
|
) else if /i "%%a" == "usage" (
|
||||||
@@ -44,9 +42,13 @@ exit /b
|
|||||||
pause
|
pause
|
||||||
exit /b
|
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:
|
:::include:
|
||||||
:::.
|
:::.
|
||||||
@@ -55,15 +57,30 @@ exit /b
|
|||||||
:::usage:
|
:::usage:
|
||||||
:::.
|
:::.
|
||||||
::: %lib_base% cmder_shell
|
::: %lib_base% cmder_shell
|
||||||
:::.
|
|
||||||
:::options:
|
|
||||||
:::.
|
|
||||||
::: file <in> full path to file containing lib_routines to display
|
|
||||||
:::.
|
|
||||||
:::-------------------------------------------------------------------------------
|
:::-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
:cmder_shell
|
||||||
call :detect_comspec %ComSpec%
|
call :detect_comspec %ComSpec%
|
||||||
exit /b
|
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
|
:detect_comspec
|
||||||
set CMDER_SHELL=%~n1
|
set CMDER_SHELL=%~n1
|
||||||
if not defined CMDER_CLINK (
|
if not defined CMDER_CLINK (
|
||||||
@@ -74,6 +91,27 @@ exit /b
|
|||||||
)
|
)
|
||||||
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
|
:update_legacy_aliases
|
||||||
type "%user_aliases%" | %WINDIR%\System32\findstr /i ";= Add aliases below here" >nul
|
type "%user_aliases%" | %WINDIR%\System32\findstr /i ";= Add aliases below here" >nul
|
||||||
if "%errorlevel%" == "1" (
|
if "%errorlevel%" == "1" (
|
||||||
|
|||||||
2
vendor/lib/lib_console.cmd
vendored
2
vendor/lib/lib_console.cmd
vendored
@@ -14,7 +14,7 @@ if %fast_init% gtr %verbose_output% if %fast_init% gtr %debug_output% exit /b
|
|||||||
|
|
||||||
if "%~1" == "/h" (
|
if "%~1" == "/h" (
|
||||||
%lib_base% help "%~0"
|
%lib_base% help "%~0"
|
||||||
) else if "%1" neq "" (
|
) else if "%~1" neq "" (
|
||||||
call :%*
|
call :%*
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
35
vendor/lib/lib_git.cmd
vendored
35
vendor/lib/lib_git.cmd
vendored
@@ -1,18 +1,17 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
call "%~dp0lib_base.cmd"
|
call "%~dp0lib_base.cmd"
|
||||||
call "%%~dp0lib_console.cmd"
|
call "%~dp0lib_console.cmd"
|
||||||
set lib_git=call "%~dp0lib_git.cmd"
|
set lib_git=call "%~dp0lib_git.cmd"
|
||||||
|
|
||||||
if "%~1" == "/h" (
|
if "%~1" == "/h" (
|
||||||
%lib_base% help "%~0"
|
%lib_base% help "%~0"
|
||||||
) else if "%1" neq "" (
|
) else if "%~1" neq "" (
|
||||||
call :%*
|
call :%*
|
||||||
)
|
)
|
||||||
|
|
||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
:read_version
|
|
||||||
:::===============================================================================
|
:::===============================================================================
|
||||||
:::read_version - Get the git.exe 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
|
::: GIT_VERSION_[GIT SCOPE] <out> Env variable containing Git semantic version string
|
||||||
:::-------------------------------------------------------------------------------
|
:::-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
:read_version
|
||||||
:: clear the variables
|
:: clear the variables
|
||||||
set GIT_VERSION_%~1=
|
set GIT_VERSION_%~1=
|
||||||
|
|
||||||
@@ -55,6 +55,7 @@ exit /b
|
|||||||
set "GIT_VERSION=%%C"
|
set "GIT_VERSION=%%C"
|
||||||
) else (
|
) else (
|
||||||
echo "'git --version' returned an improper version string!"
|
echo "'git --version' returned an improper version string!"
|
||||||
|
%print_debug% :read_version "returned string: '%%A %%B %%C' by executable path: %git_executable%"
|
||||||
pause
|
pause
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
@@ -63,7 +64,6 @@ exit /b
|
|||||||
|
|
||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
:parse_version
|
|
||||||
:::===============================================================================
|
:::===============================================================================
|
||||||
:::parse_version - Parse semantic version string 'x.x.x.x' and return the pieces
|
:::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.
|
::: [SCOPE]_BUILD <out> Scoped Build version.
|
||||||
:::-------------------------------------------------------------------------------
|
:::-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
:parse_version
|
||||||
:: process a `x.x.x.xxxx.x` formatted string
|
:: process a `x.x.x.xxxx.x` formatted string
|
||||||
%print_debug% :parse_version "ARGV[1]=%~1, ARGV[2]=%~2"
|
%print_debug% :parse_version "ARGV[1]=%~1, ARGV[2]=%~2"
|
||||||
|
|
||||||
@@ -110,9 +111,8 @@ exit /b
|
|||||||
|
|
||||||
:endlocal_set_git_version
|
: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:
|
:::include:
|
||||||
:::.
|
:::.
|
||||||
@@ -128,6 +128,7 @@ exit /b
|
|||||||
::: [VERSION] <in> Semantic version String. Ex: 1.2.3.4
|
::: [VERSION] <in> Semantic version String. Ex: 1.2.3.4
|
||||||
:::-------------------------------------------------------------------------------
|
:::-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
:validate_version
|
||||||
:: now parse the version information into the corresponding variables
|
:: now parse the version information into the corresponding variables
|
||||||
%print_debug% :validate_version "ARGV[1]=%~1, ARGV[2]=%~2"
|
%print_debug% :validate_version "ARGV[1]=%~1, ARGV[2]=%~2"
|
||||||
|
|
||||||
@@ -142,9 +143,8 @@ exit /b
|
|||||||
)
|
)
|
||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
:compare_versions
|
|
||||||
:::===============================================================================
|
:::===============================================================================
|
||||||
:::compare_version - Compare semantic versions return latest version.
|
:::compare_version - Compare semantic versions and return latest version
|
||||||
:::.
|
:::.
|
||||||
:::include:
|
:::include:
|
||||||
:::.
|
:::.
|
||||||
@@ -160,6 +160,7 @@ exit /b
|
|||||||
::: [SCOPE2] <in> Example: VENDOR
|
::: [SCOPE2] <in> Example: VENDOR
|
||||||
:::-------------------------------------------------------------------------------
|
:::-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
:compare_versions
|
||||||
:: checks all major, minor, patch and build variables for the given arguments.
|
:: 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.
|
:: 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
|
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:
|
:::include:
|
||||||
:::.
|
:::.
|
||||||
@@ -201,7 +207,7 @@ exit /b
|
|||||||
|
|
||||||
:is_git_shim
|
:is_git_shim
|
||||||
pushd "%~1"
|
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
|
setlocal enabledelayedexpansion
|
||||||
if exist git.shim (
|
if exist git.shim (
|
||||||
for /F "tokens=2 delims== " %%I in (git.shim) do (
|
for /F "tokens=2 delims== " %%I in (git.shim) do (
|
||||||
@@ -218,7 +224,7 @@ exit /b
|
|||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
:::===============================================================================
|
:::===============================================================================
|
||||||
:::compare_git_versions
|
:::compare_git_versions - Compare the user git version against the vendored version
|
||||||
:::.
|
:::.
|
||||||
:::include:
|
:::include:
|
||||||
:::.
|
:::.
|
||||||
@@ -252,7 +258,7 @@ exit /b
|
|||||||
:: if the user provided git executable is not found
|
:: if the user provided git executable is not found
|
||||||
IF ERRORLEVEL -255 IF NOT ERRORLEVEL -254 (
|
IF ERRORLEVEL -255 IF NOT ERRORLEVEL -254 (
|
||||||
:: if not exist "%git_executable%" (
|
:: 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=
|
set test_dir=
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -261,7 +267,7 @@ exit /b
|
|||||||
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:
|
:::include:
|
||||||
:::.
|
:::.
|
||||||
@@ -277,5 +283,4 @@ exit /b
|
|||||||
%lib_git% read_version USER "%test_dir%" 2>nul
|
%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%"
|
%print_debug% ":get_user_git_version" "get_user_git_version GIT_VERSION_USER: %GIT_VERSION_USER%"
|
||||||
%lib_git% validate_version USER %GIT_VERSION_USER%
|
%lib_git% validate_version USER %GIT_VERSION_USER%
|
||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
|
|||||||
104
vendor/lib/lib_path.cmd
vendored
104
vendor/lib/lib_path.cmd
vendored
@@ -1,16 +1,22 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
|
|
||||||
call "%~dp0lib_base.cmd"
|
call "%~dp0lib_base.cmd"
|
||||||
call "%%~dp0lib_console"
|
call "%~dp0lib_console.cmd"
|
||||||
set lib_path=call "%~dp0lib_path.cmd"
|
set lib_path=call "%~dp0lib_path.cmd"
|
||||||
|
|
||||||
if "%~1" == "/h" (
|
if "%~1" == "/h" (
|
||||||
%lib_base% help "%~0"
|
%lib_base% help "%~0"
|
||||||
) else if "%1" neq "" (
|
) else if "%~1" neq "" (
|
||||||
call :%*
|
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
|
exit /b
|
||||||
|
|
||||||
:enhance_path
|
:enhance_path
|
||||||
@@ -32,18 +38,17 @@ exit /b
|
|||||||
:::options:
|
:::options:
|
||||||
:::
|
:::
|
||||||
::: append <in> Append to the path env variable rather than pre-pend.
|
::: append <in> Append to the path env variable rather than pre-pend.
|
||||||
::B
|
:::
|
||||||
:::
|
:::
|
||||||
:::output:
|
:::output:
|
||||||
:::
|
:::
|
||||||
::: path <out> Sets the path env variable if required.
|
::: path <out> Sets the path env variable if required.
|
||||||
:::-------------------------------------------------------------------------------
|
:::-------------------------------------------------------------------------------
|
||||||
|
|
||||||
if "%~1" neq "" (
|
if "%~1" neq "" (
|
||||||
set "add_path=%~1"
|
set "add_path=%~1"
|
||||||
) else (
|
) else (
|
||||||
%print_error% "You must specify a directory to add to the path!"
|
%print_error% "You must specify a directory to add to the path!"
|
||||||
exit 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
if "%~2" neq "" if /i "%~2" == "append" (
|
if "%~2" neq "" if /i "%~2" == "append" (
|
||||||
@@ -52,7 +57,8 @@ exit /b
|
|||||||
set "position="
|
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" (
|
if "%ERRORLEVEL%" == "0" (
|
||||||
set "add_to_path=%add_path%"
|
set "add_to_path=%add_path%"
|
||||||
) else (
|
) else (
|
||||||
@@ -66,7 +72,7 @@ exit /b
|
|||||||
set "PATH=%add_to_path%;%PATH%"
|
set "PATH=%add_to_path%;%PATH%"
|
||||||
)
|
)
|
||||||
goto :end_enhance_path
|
goto :end_enhance_path
|
||||||
) else if "add_to_path" equ "" (
|
) else if "%add_to_path%" equ "" (
|
||||||
goto :end_enhance_path
|
goto :end_enhance_path
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -78,23 +84,23 @@ exit /b
|
|||||||
|
|
||||||
setlocal enabledelayedexpansion
|
setlocal enabledelayedexpansion
|
||||||
if "!found!" == "0" (
|
if "!found!" == "0" (
|
||||||
echo "!path!"|!WINDIR!\System32\findstr >nul /I /R /C:";!find_query!;"
|
echo "!PATH!"|!WINDIR!\System32\findstr >nul /I /R /C:";!find_query!;"
|
||||||
call :set_found
|
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 /i "!position!" == "append" (
|
||||||
if "!found!" == "0" (
|
if "!found!" == "0" (
|
||||||
echo "!path!"|!WINDIR!\System32\findstr >nul /I /R /C:";!find_query!\"$"
|
echo "!PATH!"|!WINDIR!\System32\findstr >nul /I /R /C:";!find_query!\"$"
|
||||||
call :set_found
|
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 (
|
) else (
|
||||||
if "!found!" == "0" (
|
if "!found!" == "0" (
|
||||||
echo "!path!"|!WINDIR!\System32\findstr >nul /I /R /C:"^\"!find_query!;"
|
echo "!PATH!"|!WINDIR!\System32\findstr >nul /I /R /C:"^\"!find_query!;"
|
||||||
call :set_found
|
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%
|
endlocal & set found=%found%
|
||||||
|
|
||||||
@@ -113,7 +119,8 @@ exit /b
|
|||||||
:end_enhance_path
|
:end_enhance_path
|
||||||
set "PATH=%PATH:;;=;%"
|
set "PATH=%PATH:;;=;%"
|
||||||
|
|
||||||
REM echo %path%|"C:\Users\dgames\cmder - dev\vendor\git-for-windows\usr\bin\wc" -c
|
REM echo %path%|wc -c
|
||||||
|
|
||||||
if "%fast_init%" == "1" exit /b
|
if "%fast_init%" == "1" exit /b
|
||||||
|
|
||||||
if not "%OLD_PATH:~0,3000%" == "%OLD_PATH:~0,3001%" goto :toolong
|
if not "%OLD_PATH:~0,3000%" == "%OLD_PATH:~0,3001%" goto :toolong
|
||||||
@@ -121,21 +128,27 @@ exit /b
|
|||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
:toolong
|
:toolong
|
||||||
echo "%OLD_PATH%">"%temp%\cmder_lib_pathA"
|
set "_rand=%RANDOM%"
|
||||||
echo "%PATH%">"%temp%\cmder_lib_pathB"
|
if exist "%temp%\%_rand%_cmder_lib_pathA" del "%temp%\%_rand%_cmder_lib_pathA" 2>nul 1>nul
|
||||||
fc /b "%temp%\cmder_lib_pathA" "%temp%\cmder_lib_pathB" 2>nul 1>nul
|
if exist "%temp%\%_rand%_cmder_lib_pathB" del "%temp%\%_rand%_cmder_lib_pathB" 2>nul 1>nul
|
||||||
if errorlevel 1 ( del "%temp%\cmder_lib_pathA" & del "%temp%\cmder_lib_pathB" & goto :changed )
|
if exist "%temp%\%_rand%_cmder_lib_pathA" goto :toolong
|
||||||
del "%temp%\cmder_lib_pathA" & del "%temp%\cmder_lib_pathB"
|
if exist "%temp%\%_rand%_cmder_lib_pathB" goto :toolong
|
||||||
|
echo "%OLD_PATH%">"%temp%\%_rand%_cmder_lib_pathA"
|
||||||
|
if errorlevel 1 ( if exist "%temp%\%_rand%_cmder_lib_pathA" del "%temp%\%_rand%_cmder_lib_pathA" & goto :toolong )
|
||||||
|
echo "%PATH%">"%temp%\%_rand%_cmder_lib_pathB"
|
||||||
|
if errorlevel 1 ( if exist "%temp%\%_rand%_cmder_lib_pathA" del "%temp%\%_rand%_cmder_lib_pathA" & if exist "%temp%\%_rand%_cmder_lib_pathB" del "%temp%\%_rand%_cmder_lib_pathB" & goto :toolong )
|
||||||
|
fc /b "%temp%\%_rand%_cmder_lib_pathA" "%temp%\%_rand%_cmder_lib_pathB" 2>nul 1>nul
|
||||||
|
if errorlevel 1 ( del "%temp%\%_rand%_cmder_lib_pathA" & del "%temp%\%_rand%_cmder_lib_pathB" & set "_rand=" & goto :changed )
|
||||||
|
del "%temp%\%_rand%_cmder_lib_pathA" & del "%temp%\%_rand%_cmder_lib_pathB" & set "_rand="
|
||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
:changed
|
:changed
|
||||||
%print_debug% :enhance_path "END Env Var - PATH=%path%"
|
%print_debug% :enhance_path "END Env Var - PATH=%PATH%"
|
||||||
%print_debug% :enhance_path "Env Var %find_query% - found=%found%"
|
%print_debug% :enhance_path "Env Var %find_query% - found=%found%"
|
||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
|
|
||||||
:set_found
|
:set_found
|
||||||
if "%ERRORLEVEL%" == "0" (
|
if "%ERRORLEVEL%" == "0" (
|
||||||
set found=1
|
set found=1
|
||||||
@@ -144,8 +157,12 @@ exit /b
|
|||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
:enhance_path_recursive
|
: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.
|
::: required.
|
||||||
:::.
|
:::.
|
||||||
:::include:
|
:::include:
|
||||||
@@ -154,7 +171,7 @@ exit /b
|
|||||||
:::.
|
:::.
|
||||||
:::usage:
|
:::usage:
|
||||||
:::.
|
:::.
|
||||||
::: call "%~DP0lib_path" enhance_path_recursive "[dir_path]" [max_depth] [append]
|
::: call "%~DP0lib_path" set_path_recursive "[dir_path]" [max_depth] [append]
|
||||||
:::.
|
:::.
|
||||||
:::required:
|
:::required:
|
||||||
:::.
|
:::.
|
||||||
@@ -174,7 +191,7 @@ exit /b
|
|||||||
set "add_path=%~1"
|
set "add_path=%~1"
|
||||||
) else (
|
) else (
|
||||||
%print_error% "You must specify a directory to add to the path!"
|
%print_error% "You must specify a directory to add to the path!"
|
||||||
exit 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
set "depth=%~2"
|
set "depth=%~2"
|
||||||
@@ -186,7 +203,7 @@ exit /b
|
|||||||
set "position="
|
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" (
|
if "%ERRORLEVEL%" == "0" (
|
||||||
set "add_to_path=%add_path%"
|
set "add_to_path=%add_path%"
|
||||||
@@ -196,7 +213,11 @@ exit /b
|
|||||||
|
|
||||||
if "%fast_init%" == "1" (
|
if "%fast_init%" == "1" (
|
||||||
if "%add_to_path%" neq "" (
|
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 +226,19 @@ exit /b
|
|||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
|
|
||||||
%print_debug% :enhance_path_recursive "Env Var - add_path=%add_to_path%"
|
%print_debug% :set_path_recursive "Env Var - add_path=%add_to_path%"
|
||||||
%print_debug% :enhance_path_recursive "Env Var - position=%position%"
|
%print_debug% :set_path_recursive "Env Var - position=%position%"
|
||||||
%print_debug% :enhance_path_recursive "Env Var - depth=%depth%"
|
%print_debug% :set_path_recursive "Env Var - depth=%depth%"
|
||||||
%print_debug% :enhance_path_recursive "Env Var - max_depth=%max_depth%"
|
%print_debug% :set_path_recursive "Env Var - max_depth=%max_depth%"
|
||||||
|
|
||||||
if %max_depth% gtr %depth% (
|
if %max_depth% gtr %depth% (
|
||||||
if "%add_to_path%" neq "" (
|
if "%add_to_path%" neq "" (
|
||||||
%print_debug% :enhance_path_recursive "Adding parent directory - '%add_to_path%'"
|
%print_debug% :set_path_recursive "Adding parent directory - '%add_to_path%'"
|
||||||
call :enhance_path "%add_to_path%" %position%
|
if "%position%" == "append" (
|
||||||
|
set "path=%path%;%add_to_path%"
|
||||||
|
) else (
|
||||||
|
set "path=%add_to_path%;%path%"
|
||||||
|
)
|
||||||
)
|
)
|
||||||
call :set_depth
|
call :set_depth
|
||||||
call :loop_depth
|
call :loop_depth
|
||||||
@@ -223,7 +248,7 @@ exit /b
|
|||||||
|
|
||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
: set_depth
|
:set_depth
|
||||||
set /a "depth=%depth%+1"
|
set /a "depth=%depth%+1"
|
||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
@@ -233,10 +258,9 @@ exit /b
|
|||||||
)
|
)
|
||||||
|
|
||||||
for /d %%i in ("%add_path%\*") do (
|
for /d %%i in ("%add_path%\*") do (
|
||||||
%print_debug% :enhance_path_recursive "Env Var BEFORE - depth=%depth%"
|
%print_debug% :set_path_recursive "Env Var BEFORE - depth=%depth%"
|
||||||
%print_debug% :enhance_path_recursive "Found Subdirectory - '%%~fi'"
|
%print_debug% :set_path_recursive "Found Subdirectory - '%%~fi'"
|
||||||
call :enhance_path_recursive "%%~fi" %depth% %max_depth% %position%
|
call :set_path_recursive "%%~fi" %depth% %max_depth% %position%
|
||||||
%print_debug% :enhance_path_recursive "Env Var AFTER- depth=%depth%"
|
%print_debug% :set_path_recursive "Env Var AFTER- depth=%depth%"
|
||||||
)
|
)
|
||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
|
|||||||
23
vendor/lib/lib_profile.cmd
vendored
23
vendor/lib/lib_profile.cmd
vendored
@@ -1,37 +1,37 @@
|
|||||||
@echo off
|
@echo off
|
||||||
|
|
||||||
call "%~dp0lib_base.cmd"
|
call "%~dp0lib_base.cmd"
|
||||||
call "%%~dp0lib_console"
|
call "%~dp0lib_console.cmd"
|
||||||
set lib_profile=call "%~dp0lib_profile.cmd"
|
set lib_profile=call "%~dp0lib_profile.cmd"
|
||||||
|
|
||||||
if "%~1" == "/h" (
|
if "%~1" == "/h" (
|
||||||
%lib_base% help "%~0"
|
%lib_base% help "%~0"
|
||||||
) else if "%1" neq "" (
|
) else if "%~1" neq "" (
|
||||||
call :%*
|
call :%*
|
||||||
)
|
)
|
||||||
|
|
||||||
exit /b
|
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:
|
:::include:
|
||||||
:::
|
:::.
|
||||||
::: call "lib_profile.cmd"
|
::: call "lib_profile.cmd"
|
||||||
:::
|
:::.
|
||||||
:::usage:
|
:::usage:
|
||||||
:::
|
:::.
|
||||||
::: %lib_profile% "[dir_path]"
|
::: %lib_profile% "[dir_path]"
|
||||||
:::
|
:::.
|
||||||
:::required:
|
:::required:
|
||||||
:::
|
:::.
|
||||||
::: [dir_path] <in> Fully qualified directory path containing init *.cmd|*.bat.
|
::: [dir_path] <in> Fully qualified directory path containing init *.cmd|*.bat.
|
||||||
::: Example: "c:\bin"
|
::: Example: "c:\bin"
|
||||||
:::
|
:::.
|
||||||
::: path <out> Sets the path env variable if required.
|
::: path <out> Sets the path env variable if required.
|
||||||
:::-------------------------------------------------------------------------------
|
:::-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
:run_profile_d
|
||||||
if not exist "%~1" (
|
if not exist "%~1" (
|
||||||
mkdir "%~1"
|
mkdir "%~1"
|
||||||
)
|
)
|
||||||
@@ -43,4 +43,3 @@ exit /b
|
|||||||
)
|
)
|
||||||
popd
|
popd
|
||||||
exit /b
|
exit /b
|
||||||
|
|
||||||
|
|||||||
112
vendor/profile.ps1
vendored
112
vendor/profile.ps1
vendored
@@ -7,15 +7,11 @@
|
|||||||
|
|
||||||
$CMDER_INIT_START = Get-Date
|
$CMDER_INIT_START = Get-Date
|
||||||
|
|
||||||
# Compatibility with PS major versions <= 2
|
# Determine the script root if not already set
|
||||||
if (!$PSScriptRoot) {
|
if (!$PSScriptRoot) {
|
||||||
$PSScriptRoot = Split-Path $Script:MyInvocation.MyCommand.Path
|
$PSScriptRoot = Split-Path $Script:MyInvocation.MyCommand.Path
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($ENV:CMDER_USER_CONFIG) {
|
|
||||||
Write-Verbose "CMDER IS ALSO USING INDIVIDUAL USER CONFIG FROM '$ENV:CMDER_USER_CONFIG'!"
|
|
||||||
}
|
|
||||||
|
|
||||||
# We do this for Powershell as Admin Sessions because CMDER_ROOT is not being set.
|
# We do this for Powershell as Admin Sessions because CMDER_ROOT is not being set.
|
||||||
if (!$ENV:CMDER_ROOT) {
|
if (!$ENV:CMDER_ROOT) {
|
||||||
if ($ENV:ConEmuDir) {
|
if ($ENV:ConEmuDir) {
|
||||||
@@ -28,41 +24,61 @@ if (!$ENV:CMDER_ROOT) {
|
|||||||
# Remove trailing '\'
|
# Remove trailing '\'
|
||||||
$ENV:CMDER_ROOT = ($ENV:CMDER_ROOT).TrimEnd("\")
|
$ENV:CMDER_ROOT = ($ENV:CMDER_ROOT).TrimEnd("\")
|
||||||
|
|
||||||
# Do not load bundled PsGet if a module installer is already available
|
# Recent PowerShell versions include PowerShellGet out of the box
|
||||||
# -> recent PowerShell versions include PowerShellGet out of the box
|
|
||||||
$moduleInstallerAvailable = [bool](Get-Command -Name 'Install-Module' -ErrorAction SilentlyContinue)
|
$moduleInstallerAvailable = [bool](Get-Command -Name 'Install-Module' -ErrorAction SilentlyContinue)
|
||||||
|
|
||||||
|
# Enable Debug and Verbose output if CMDER_DEBUG environment variable is set to '1' or 'true'
|
||||||
|
if ($env:CMDER_DEBUG -and ($env:CMDER_DEBUG -match '^(1|true)$')) {
|
||||||
|
$DebugPreference = 'Continue'
|
||||||
|
$VerbosePreference = 'Continue'
|
||||||
|
}
|
||||||
|
|
||||||
# Add Cmder modules directory to the autoload path.
|
# Add Cmder modules directory to the autoload path.
|
||||||
$CmderModulePath = Join-path $PSScriptRoot "psmodules/"
|
$CmderModulePath = Join-path $PSScriptRoot "psmodules/"
|
||||||
|
|
||||||
|
# Import Cmder functions
|
||||||
$CmderFunctions = Join-Path $CmderModulePath "Cmder.ps1"
|
$CmderFunctions = Join-Path $CmderModulePath "Cmder.ps1"
|
||||||
. $CmderFunctions
|
. $CmderFunctions
|
||||||
|
|
||||||
if(-not $moduleInstallerAvailable -and -not $env:PSModulePath.Contains($CmderModulePath) ) {
|
# Configure PSModulePath to include Cmder modules if not already present
|
||||||
|
if (-not $moduleInstallerAvailable -and -not $env:PSModulePath.Contains($CmderModulePath) ) {
|
||||||
$env:PSModulePath = $env:PSModulePath.Insert(0, "$CmderModulePath;")
|
$env:PSModulePath = $env:PSModulePath.Insert(0, "$CmderModulePath;")
|
||||||
}
|
}
|
||||||
|
|
||||||
$gitVersionVendor = (readVersion -gitPath "$ENV:CMDER_ROOT\vendor\git-for-windows\cmd")
|
if ($env:CMDER_USER_CONFIG) {
|
||||||
Write-Debug "GIT VENDOR: ${gitVersionVendor}"
|
Write-Verbose "CMDER IS ALSO USING INDIVIDUAL USER CONFIG FROM '$ENV:CMDER_USER_CONFIG'!"
|
||||||
|
}
|
||||||
|
|
||||||
# Get user installed Git Version[s] and Compare with vendored if found.
|
# Read vendored Git Version
|
||||||
|
$gitVendorPath = Join-Path $ENV:CMDER_ROOT 'vendor\git-for-windows\cmd'
|
||||||
|
$gitVersionVendor = Get-GitVersion -GitPath $gitVendorPath
|
||||||
|
if (-not [string]::IsNullOrEmpty($gitVersionVendor)) {
|
||||||
|
Write-Debug "GIT VENDOR: ${gitVersionVendor}"
|
||||||
|
} else {
|
||||||
|
Write-Debug "GIT VENDOR is not present at '$gitVendorPath'"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Get user installed Git version(s) if found, and compare them with vendored version.
|
||||||
foreach ($git in (Get-Command -ErrorAction SilentlyContinue 'git')) {
|
foreach ($git in (Get-Command -ErrorAction SilentlyContinue 'git')) {
|
||||||
Write-Debug "GIT PATH: {$git.Path}"
|
Write-Debug "GIT USER PATH: $($git.Path)"
|
||||||
$gitDir = Split-Path -Path $git.Path
|
$gitDir = Split-Path -Path $git.Path
|
||||||
$gitDir = isGitShim -gitPath $gitDir
|
$gitDir = Get-GitShimPath -GitPath $gitDir
|
||||||
$gitVersionUser = (readVersion -gitPath $gitDir)
|
$gitVersionUser = Get-GitVersion -GitPath $gitDir
|
||||||
Write-Debug "GIT USER: ${gitVersionUser}"
|
Write-Debug "GIT USER VERSION: ${gitVersionUser}"
|
||||||
|
|
||||||
$useGitVersion = compare_git_versions -userVersion $gitVersionUser -vendorVersion $gitVersionVendor
|
$useGitVersion = Compare-GitVersion -UserVersion $gitVersionUser -VendorVersion $gitVersionVendor
|
||||||
Write-Debug "Using Git Version: ${useGitVersion}"
|
Write-Debug "Using Git Version: ${useGitVersion}"
|
||||||
|
|
||||||
# Use user installed Git
|
# Use user installed Git
|
||||||
if ($null -eq $gitPathUser) {
|
if ($null -eq $gitPathUser) {
|
||||||
|
Write-Debug "Detected Git from mingw bin directory"
|
||||||
|
Write-Debug "Git Dir: ${gitDir}"
|
||||||
if ($gitDir -match '\\mingw32\\bin' -or $gitDir -match '\\mingw64\\bin') {
|
if ($gitDir -match '\\mingw32\\bin' -or $gitDir -match '\\mingw64\\bin') {
|
||||||
$gitPathUser = ($gitDir.subString(0,$gitDir.Length - 12))
|
$gitPathUser = $gitDir.subString(0, $gitDir.Length - 12)
|
||||||
} else {
|
} else {
|
||||||
$gitPathUser = ($gitDir.subString(0,$gitDir.Length - 4))
|
$gitPathUser = $gitDir.subString(0, $gitDir.Length - 4)
|
||||||
}
|
}
|
||||||
|
Write-Debug "Git Path User: ${gitDir}"
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($useGitVersion -eq $gitVersionUser) {
|
if ($useGitVersion -eq $gitVersionUser) {
|
||||||
@@ -73,7 +89,7 @@ foreach ($git in (Get-Command -ErrorAction SilentlyContinue 'git')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# User vendored Git.
|
# Use vendored Git if no user Git found or user Git is older than vendored Git
|
||||||
if ($null -eq $ENV:GIT_INSTALL_ROOT -and $null -ne $gitVersionVendor) {
|
if ($null -eq $ENV:GIT_INSTALL_ROOT -and $null -ne $gitVersionVendor) {
|
||||||
$ENV:GIT_INSTALL_ROOT = "$ENV:CMDER_ROOT\vendor\git-for-windows"
|
$ENV:GIT_INSTALL_ROOT = "$ENV:CMDER_ROOT\vendor\git-for-windows"
|
||||||
$ENV:GIT_INSTALL_TYPE = 'VENDOR'
|
$ENV:GIT_INSTALL_TYPE = 'VENDOR'
|
||||||
@@ -83,23 +99,43 @@ Write-Debug "GIT_INSTALL_ROOT: ${ENV:GIT_INSTALL_ROOT}"
|
|||||||
Write-Debug "GIT_INSTALL_TYPE: ${ENV:GIT_INSTALL_TYPE}"
|
Write-Debug "GIT_INSTALL_TYPE: ${ENV:GIT_INSTALL_TYPE}"
|
||||||
|
|
||||||
if ($null -ne $ENV:GIT_INSTALL_ROOT) {
|
if ($null -ne $ENV:GIT_INSTALL_ROOT) {
|
||||||
$env:Path = Configure-Git -gitRoot "$ENV:GIT_INSTALL_ROOT" -gitType $ENV:GIT_INSTALL_TYPE -gitPathUser $gitPathUser
|
$env:Path = Set-GitPath -GitRoot "$ENV:GIT_INSTALL_ROOT" -GitType $ENV:GIT_INSTALL_TYPE -GitPathUser $gitPathUser
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Create 'vi' alias for 'vim' if vim is available
|
||||||
if (Get-Command -Name "vim" -ErrorAction SilentlyContinue) {
|
if (Get-Command -Name "vim" -ErrorAction SilentlyContinue) {
|
||||||
New-Alias -name "vi" -value vim
|
New-Alias -name "vi" -value vim -errorAction SilentlyContinue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# PSReadline configuration
|
||||||
if (Get-Module PSReadline -ErrorAction "SilentlyContinue") {
|
if (Get-Module PSReadline -ErrorAction "SilentlyContinue") {
|
||||||
|
# Display an extra prompt line between the prompt and the command input
|
||||||
Set-PSReadlineOption -ExtraPromptLineCount 1
|
Set-PSReadlineOption -ExtraPromptLineCount 1
|
||||||
|
|
||||||
|
# Invoked when Enter is pressed to submit a command
|
||||||
|
if ($env:WT_SESSION) {
|
||||||
|
Set-PSReadLineKeyHandler -Key Enter -ScriptBlock {
|
||||||
|
# Get the current command line
|
||||||
|
$line = $null
|
||||||
|
$cursor = $null
|
||||||
|
[Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$line, [ref]$cursor)
|
||||||
|
|
||||||
|
# Accept the line first
|
||||||
|
[Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine()
|
||||||
|
|
||||||
|
# Emit OSC 133;C to mark start of command output
|
||||||
|
# This is written directly to the console after the command is accepted
|
||||||
|
[Console]::Write("$([char]0x1B)]133;C$([char]7)")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Pre-assign default prompt hooks so the first run of cmder gets a working prompt.
|
# Pre-assign default prompt hooks so the first run of Cmder gets a working prompt
|
||||||
$env:gitLoaded = $null
|
$env:gitLoaded = $null
|
||||||
[ScriptBlock]$PrePrompt = {}
|
[ScriptBlock]$PrePrompt = {}
|
||||||
[ScriptBlock]$PostPrompt = {}
|
[ScriptBlock]$PostPrompt = {}
|
||||||
[ScriptBlock]$CmderPrompt = {
|
[ScriptBlock]$CmderPrompt = {
|
||||||
# Check if we're currently running under Admin privileges.
|
# Check if we're currently running under Admin privileges
|
||||||
$identity = [Security.Principal.WindowsIdentity]::GetCurrent()
|
$identity = [Security.Principal.WindowsIdentity]::GetCurrent()
|
||||||
$principal = [Security.Principal.WindowsPrincipal] $identity
|
$principal = [Security.Principal.WindowsPrincipal] $identity
|
||||||
$adminRole = [Security.Principal.WindowsBuiltInRole]::Administrator
|
$adminRole = [Security.Principal.WindowsBuiltInRole]::Administrator
|
||||||
@@ -108,7 +144,7 @@ $env:gitLoaded = $null
|
|||||||
$Host.UI.RawUI.ForegroundColor = "White"
|
$Host.UI.RawUI.ForegroundColor = "White"
|
||||||
Microsoft.PowerShell.Utility\Write-Host "PS " -NoNewline -ForegroundColor $color
|
Microsoft.PowerShell.Utility\Write-Host "PS " -NoNewline -ForegroundColor $color
|
||||||
Microsoft.PowerShell.Utility\Write-Host $pwd.ProviderPath -NoNewLine -ForegroundColor Green
|
Microsoft.PowerShell.Utility\Write-Host $pwd.ProviderPath -NoNewLine -ForegroundColor Green
|
||||||
checkGit($pwd.ProviderPath)
|
Show-GitStatus -Path $pwd.ProviderPath
|
||||||
Microsoft.PowerShell.Utility\Write-Host "`nλ" -NoNewLine -ForegroundColor "DarkGray"
|
Microsoft.PowerShell.Utility\Write-Host "`nλ" -NoNewLine -ForegroundColor "DarkGray"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,6 +233,28 @@ if ( $(Get-Command prompt).Definition -match 'PS \$\(\$executionContext.SessionS
|
|||||||
[ScriptBlock]$Prompt = {
|
[ScriptBlock]$Prompt = {
|
||||||
$lastSUCCESS = $?
|
$lastSUCCESS = $?
|
||||||
$realLastExitCode = $LastExitCode
|
$realLastExitCode = $LastExitCode
|
||||||
|
|
||||||
|
# Terminal-specific escape sequences for Windows Terminal and ConEmu
|
||||||
|
if ($env:WT_SESSION -or $env:ConEmuPID) {
|
||||||
|
# Emit OSC 133;D to mark the end of command execution with exit code
|
||||||
|
if ($env:WT_SESSION) {
|
||||||
|
Microsoft.PowerShell.Utility\Write-Host -NoNewline "$([char]0x1B)]133;D;$realLastExitCode$([char]7)"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Emit OSC 9;9 to enable directory tracking
|
||||||
|
# Enables "Duplicate Tab" and "Split Pane" to preserve the working directory
|
||||||
|
$loc = $executionContext.SessionState.Path.CurrentLocation
|
||||||
|
if ($loc.Provider.Name -eq "FileSystem") {
|
||||||
|
Microsoft.PowerShell.Utility\Write-Host -NoNewline "$([char]0x1B)]9;9;`"$($loc.ProviderPath)`"$([char]0x1B)\"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Emit OSC 133;A to mark the start of the prompt
|
||||||
|
# Enables features like command navigation, selection, and visual separators
|
||||||
|
if ($env:WT_SESSION) {
|
||||||
|
Microsoft.PowerShell.Utility\Write-Host -NoNewline "$([char]0x1B)]133;A$([char]7)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$host.UI.RawUI.WindowTitle = Microsoft.PowerShell.Management\Split-Path $pwd.ProviderPath -Leaf
|
$host.UI.RawUI.WindowTitle = Microsoft.PowerShell.Management\Split-Path $pwd.ProviderPath -Leaf
|
||||||
Microsoft.PowerShell.Utility\Write-Host -NoNewline "$([char]0x200B)`r$([char]0x1B)[K"
|
Microsoft.PowerShell.Utility\Write-Host -NoNewline "$([char]0x200B)`r$([char]0x1B)[K"
|
||||||
if ($lastSUCCESS -or ($LastExitCode -ne 0)) {
|
if ($lastSUCCESS -or ($LastExitCode -ne 0)) {
|
||||||
@@ -205,6 +263,12 @@ if ( $(Get-Command prompt).Definition -match 'PS \$\(\$executionContext.SessionS
|
|||||||
PrePrompt | Microsoft.PowerShell.Utility\Write-Host -NoNewline
|
PrePrompt | Microsoft.PowerShell.Utility\Write-Host -NoNewline
|
||||||
CmderPrompt
|
CmderPrompt
|
||||||
PostPrompt | Microsoft.PowerShell.Utility\Write-Host -NoNewline
|
PostPrompt | Microsoft.PowerShell.Utility\Write-Host -NoNewline
|
||||||
|
|
||||||
|
# Emit OSC 133;B to mark the start of command input (after prompt, before user types)
|
||||||
|
if ($env:WT_SESSION) {
|
||||||
|
Microsoft.PowerShell.Utility\Write-Host -NoNewline "$([char]0x1B)]133;B$([char]7)"
|
||||||
|
}
|
||||||
|
|
||||||
$global:LastExitCode = $realLastExitCode
|
$global:LastExitCode = $realLastExitCode
|
||||||
return " "
|
return " "
|
||||||
}
|
}
|
||||||
|
|||||||
333
vendor/psmodules/Cmder.ps1
vendored
333
vendor/psmodules/Cmder.ps1
vendored
@@ -1,178 +1,277 @@
|
|||||||
function readVersion($gitPath) {
|
function Get-GitVersion {
|
||||||
$gitExecutable = "${gitPath}\git.exe"
|
param(
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]$GitPath
|
||||||
|
)
|
||||||
|
|
||||||
if (-not (Test-Path "$gitExecutable")) {
|
$gitExecutable = Join-Path $GitPath "git.exe"
|
||||||
|
|
||||||
|
if (-not (Test-Path $gitExecutable)) {
|
||||||
return $null
|
return $null
|
||||||
}
|
}
|
||||||
|
|
||||||
$gitVersion = (cmd /c "${gitExecutable}" --version)
|
# Execute 'git --version' and capture output
|
||||||
|
$gitVersion = & $gitExecutable --version 2>$null
|
||||||
|
|
||||||
if ($gitVersion -match 'git version') {
|
if ($gitVersion -match 'git version\s+(\S+)') {
|
||||||
($trash1, $trash2, $gitVersion) = $gitVersion.split(' ', 3)
|
return $Matches[1]
|
||||||
} else {
|
|
||||||
pause
|
|
||||||
return $null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $gitVersion.toString()
|
Write-Debug "Git executable path: $gitExecutable"
|
||||||
|
Write-Error "'git --version' returned an improper version string!"
|
||||||
|
Write-Error "Unable to determine Git version from output: $gitVersion"
|
||||||
|
|
||||||
|
return $null
|
||||||
}
|
}
|
||||||
|
|
||||||
function isGitShim($gitPath) {
|
function Get-GitShimPath {
|
||||||
# check if there's shim - and if yes follow the path
|
param(
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]$GitPath
|
||||||
|
)
|
||||||
|
# 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") {
|
$shimFile = Join-Path $GitPath "git.shim"
|
||||||
$shim = (get-content "${gitPath}\git.shim")
|
if (Test-Path $shimFile) {
|
||||||
($trash, $gitPath) = $shim.replace(' ', '').split('=')
|
$shimContent = Get-Content $shimFile -Raw
|
||||||
|
if ($shimContent -match '^\s*path\s*=\s*(.+)\s*$') {
|
||||||
$gitPath = $gitPath.replace('\git.exe', '')
|
$GitPath = $Matches[1].Trim().Replace('\git.exe', '')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $gitPath.toString()
|
return $GitPath
|
||||||
}
|
}
|
||||||
|
|
||||||
function compareVersions($userVersion, $vendorVersion) {
|
function Compare-Version {
|
||||||
if ($null -ne $userVersion) {
|
param(
|
||||||
($userMajor, $userMinor, $userPatch, $userBuild) = $userVersion.split('.', 4)
|
[Parameter(Mandatory = $false)]
|
||||||
} else {
|
[AllowNull()]
|
||||||
return -1
|
[string]$UserVersion,
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
[AllowNull()]
|
||||||
|
[string]$VendorVersion
|
||||||
|
)
|
||||||
|
|
||||||
|
if ([string]::IsNullOrEmpty($UserVersion)) { return -1 }
|
||||||
|
if ([string]::IsNullOrEmpty($VendorVersion)) { return 1 }
|
||||||
|
|
||||||
|
# Split version strings by dots to compare segment by segment
|
||||||
|
# For "2.49.0.windows.1", we get: ["2", "49", "0", "windows", "1"]
|
||||||
|
$userParts = $UserVersion -split '\.'
|
||||||
|
$vendorParts = $VendorVersion -split '\.'
|
||||||
|
|
||||||
|
$maxLength = [Math]::Max($userParts.Count, $vendorParts.Count)
|
||||||
|
|
||||||
|
for ($i = 0; $i -lt $maxLength; $i++) {
|
||||||
|
$userPart = if ($i -lt $userParts.Count) { $userParts[$i] } else { '' }
|
||||||
|
$vendorPart = if ($i -lt $vendorParts.Count) { $vendorParts[$i] } else { '' }
|
||||||
|
|
||||||
|
# Check if both parts are purely numeric
|
||||||
|
$userIsNumeric = $userPart -match '^\d+$'
|
||||||
|
$vendorIsNumeric = $vendorPart -match '^\d+$'
|
||||||
|
|
||||||
|
if ($userIsNumeric -and $vendorIsNumeric) {
|
||||||
|
# Both numeric: compare as integers (so 49 > 5, not lexicographic)
|
||||||
|
$userNum = [int]$userPart
|
||||||
|
$vendorNum = [int]$vendorPart
|
||||||
|
|
||||||
|
if ($userNum -gt $vendorNum) { return 1 }
|
||||||
|
if ($userNum -lt $vendorNum) { return -1 }
|
||||||
|
}
|
||||||
|
elseif ($userIsNumeric -and -not $vendorIsNumeric) {
|
||||||
|
# Numeric segment comes before text segment (e.g., "2.0" < "2.0.rc1")
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
elseif (-not $userIsNumeric -and $vendorIsNumeric) {
|
||||||
|
# Text segment comes after numeric segment
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
# Both are text: use case-insensitive lexicographic comparison
|
||||||
|
$cmp = [string]::Compare($userPart, $vendorPart, $true)
|
||||||
|
if ($cmp -ne 0) { return [Math]::Sign($cmp) }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($null -ne $vendorVersion) {
|
|
||||||
($vendorMajor, $vendorMinor, $vendorPatch, $vendorBuild) = $vendorVersion.split('.', 4)
|
|
||||||
} else {
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
if (($userMajor -eq $vendorMajor) -and ($userMinor -eq $vendorMinor) -and ($userPatch -eq $vendorPatch) -and ($userBuild -eq $vendorBuild)) {
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($userMajor -gt $vendorMajor) { return 1 }
|
|
||||||
if ($userMajor -lt $vendorMajor) { return -1 }
|
|
||||||
|
|
||||||
if ($userMinor -gt $vendorMinor) { return 1 }
|
|
||||||
if ($userMinor -lt $vendorMinor) { return -1 }
|
|
||||||
|
|
||||||
if ($userPatch -gt $vendorPatch) { return 1 }
|
|
||||||
if ($userPatch -lt $vendorPatch) { return -1 }
|
|
||||||
|
|
||||||
if ($userBuild -gt $vendorBuild) { return 1 }
|
|
||||||
if ($userBuild -lt $vendorBuild) { return -1 }
|
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
function compare_git_versions($userVersion, $vendorVersion) {
|
function Compare-GitVersion {
|
||||||
$result = compareVersions -userVersion $userVersion -vendorVersion $vendorVersion
|
param(
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
[AllowNull()]
|
||||||
|
[string]$UserVersion,
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
[AllowNull()]
|
||||||
|
[string]$VendorVersion
|
||||||
|
)
|
||||||
|
|
||||||
Write-Debug "Compare Versions Result: ${result}"
|
$result = Compare-Version -UserVersion $UserVersion -VendorVersion $VendorVersion
|
||||||
|
|
||||||
|
Write-Debug "Compare Versions Result: $result"
|
||||||
if ($result -ge 0) {
|
if ($result -ge 0) {
|
||||||
return $userVersion
|
return $UserVersion
|
||||||
}
|
|
||||||
else {
|
|
||||||
return $vendorVersion
|
|
||||||
}
|
}
|
||||||
|
return $VendorVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Configure-Git($gitRoot, $gitType, $gitPathUser) {
|
function Set-GitPath {
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]$GitRoot,
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]$GitType,
|
||||||
|
[Parameter(Mandatory = $false)]
|
||||||
|
[string]$GitPathUser
|
||||||
|
)
|
||||||
|
|
||||||
# Proposed Behavior
|
# Proposed Behavior
|
||||||
|
|
||||||
# Modify the path if we are using VENDORED Git, do nothing if using USER Git.
|
# Modify the path if we are using VENDORED Git, do nothing if using USER Git.
|
||||||
# If User Git is installed but is older, match its path config adding paths
|
# If User Git is installed but is older, match its path config adding paths
|
||||||
# in the same path positions allowing a user to configure Cmder Git path
|
# in the same path positions allowing a user to configure Cmder Git path
|
||||||
# using locally installed Git Path Config.
|
# using locally installed Git Path Config.
|
||||||
if ($gitType -eq 'VENDOR') {
|
|
||||||
# If User Git is installed replace its path config with Newer Vendored Git Path
|
|
||||||
if (($null -ne $gitPathUser) -and ($gitPathUser -ne '')) {
|
|
||||||
Write-Verbose "Cmder 'profile.ps1': Replacing older user Git path '$gitPathUser' with newer vendored Git path '$gitRoot' in the system path..."
|
|
||||||
|
|
||||||
$newPath = ($env:path -ireplace [regex]::Escape($gitPathUser), $gitRoot)
|
if ($GitType -ne 'VENDOR') {
|
||||||
}
|
return $env:Path
|
||||||
else {
|
|
||||||
if (-not ($env:Path -match [regex]::Escape("$gitRoot\cmd"))) {
|
|
||||||
Write-Debug "Adding $gitRoot\cmd to the path"
|
|
||||||
$newPath = $($gitRoot + "\cmd" + ";" + $env:Path)
|
|
||||||
}
|
|
||||||
|
|
||||||
# Add "$gitRoot\mingw[32|64]\bin" to the path if exists and not done already
|
|
||||||
if ((Test-Path "$gitRoot\mingw32\bin") -and -not ($env:path -match [regex]::Escape("$gitRoot\mingw32\bin"))) {
|
|
||||||
Write-Debug "Adding $gitRoot\mingw32\bin to the path"
|
|
||||||
$newPath = "$newPath;$gitRoot\mingw32\bin"
|
|
||||||
}
|
|
||||||
elseif ((Test-Path "$gitRoot\mingw64\bin") -and -not ($env:path -match [regex]::Escape("$gitRoot\mingw64\bin"))) {
|
|
||||||
Write-Debug "Adding $gitRoot\mingw64\bin to the path"
|
|
||||||
$newPath = "$newPath;$gitRoot\mingw64\bin"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Add "$gitRoot\usr\bin" to the path if exists and not done already
|
|
||||||
if ((Test-Path "$gitRoot\usr\bin") -and -not ($env:path -match [regex]::Escape("$gitRoot\usr\bin"))) {
|
|
||||||
Write-Debug "Adding $gitRoot\usr\bin to the path"
|
|
||||||
$newPath = "$newPath;$gitRoot\usr\bin"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $newPath
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $env:path
|
$newPath = $env:Path
|
||||||
|
|
||||||
|
# Replace user Git path with vendored Git if user path exists
|
||||||
|
if ($GitPathUser) {
|
||||||
|
Write-Verbose "Cmder 'profile.ps1': Replacing older user Git path '$GitPathUser' with newer vendored Git path '$GitRoot' in the system path..."
|
||||||
|
$newPath = $newPath -ireplace [regex]::Escape($GitPathUser), $GitRoot
|
||||||
|
} else {
|
||||||
|
# Add Git cmd directory to the path
|
||||||
|
$gitCmd = Join-Path $GitRoot "cmd"
|
||||||
|
if (-not ($newPath -match [regex]::Escape($gitCmd))) {
|
||||||
|
Write-Debug "Adding $gitCmd to the path"
|
||||||
|
$newPath = "$gitCmd;$newPath"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Add mingw[32|64]\bin directories to the path, if they exist and not already present
|
||||||
|
# Prefer mingw64 on 64-bit systems, mingw32 on 32-bit systems
|
||||||
|
$is64Bit = [Environment]::Is64BitOperatingSystem
|
||||||
|
$mingwDirs = if ($is64Bit) { @('mingw64', 'mingw32') } else { @('mingw32') }
|
||||||
|
|
||||||
|
foreach ($mingw in $mingwDirs) {
|
||||||
|
$mingwBin = Join-Path $GitRoot "$mingw\bin"
|
||||||
|
if ((Test-Path $mingwBin) -and -not ($newPath -match [regex]::Escape($mingwBin))) {
|
||||||
|
Write-Debug "Adding $mingwBin to the path"
|
||||||
|
$newPath = "$newPath;$mingwBin"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Add usr\bin directory to the path
|
||||||
|
$usrBin = Join-Path $GitRoot "usr\bin"
|
||||||
|
if ((Test-Path $usrBin) -and -not ($newPath -match [regex]::Escape($usrBin))) {
|
||||||
|
Write-Debug "Adding $usrBin to the path"
|
||||||
|
$newPath = "$newPath;$usrBin"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $newPath
|
||||||
}
|
}
|
||||||
|
|
||||||
function Import-Git() {
|
function Import-Git {
|
||||||
$GitModule = Get-Module -Name Posh-Git -ListAvailable
|
$gitModule = Get-Module -Name Posh-Git -ListAvailable
|
||||||
if ($GitModule | Select-Object version | Where-Object version -le ([version]"0.6.1.20160330")) {
|
|
||||||
Import-Module Posh-Git > $null
|
if (-not $gitModule) {
|
||||||
}
|
Microsoft.PowerShell.Utility\Write-Host -NoNewline "`r`n"
|
||||||
if ($GitModule | Select-Object version | Where-Object version -ge ([version]"1.0.0")) {
|
|
||||||
Import-Module Posh-Git > $null
|
|
||||||
$GitPromptSettings.AnsiConsole = $false
|
|
||||||
}
|
|
||||||
if (-not $GitModule) {
|
|
||||||
Write-Host -NoNewline "`r`n"
|
|
||||||
Write-Warning "Missing git support, install posh-git with 'Install-Module posh-git' and restart Cmder."
|
Write-Warning "Missing git support, install posh-git with 'Install-Module posh-git' and restart Cmder."
|
||||||
Write-Host -NoNewline "`r$([char]0x1B)[A"
|
Microsoft.PowerShell.Utility\Write-Host -NoNewline "`r$([char]0x1B)[A"
|
||||||
return $false
|
return $false
|
||||||
}
|
}
|
||||||
# Make sure we only run once by always returning true
|
|
||||||
|
# Import posh-git module (works for all versions)
|
||||||
|
Import-Module Posh-Git -ErrorAction SilentlyContinue | Out-Null
|
||||||
|
|
||||||
|
# Apply version-specific settings for posh-git 1.0.0+
|
||||||
|
if (($gitModule.Version -ge [version]"1.0.0") -and (Get-Variable -Name GitPromptSettings -ErrorAction SilentlyContinue)) {
|
||||||
|
$GitPromptSettings.AnsiConsole = $false
|
||||||
|
}
|
||||||
|
|
||||||
return $true
|
return $true
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkGit($Path) {
|
function Show-GitStatus {
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]$Path
|
||||||
|
)
|
||||||
|
|
||||||
if (-not (Get-Command git -ErrorAction SilentlyContinue)) {
|
if (-not (Get-Command git -ErrorAction SilentlyContinue)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (-not (Test-Path -Path (Join-Path $Path '.git'))) {
|
|
||||||
$SplitPath = Split-Path $path
|
$gitDir = Join-Path $Path '.git'
|
||||||
if ($SplitPath) { checkGit($SplitPath) }
|
if (-not (Test-Path $gitDir)) {
|
||||||
|
$parentPath = Split-Path $Path
|
||||||
|
if ($parentPath) {
|
||||||
|
Show-GitStatus -Path $parentPath
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (getGitStatusSetting -eq $true) {
|
|
||||||
|
if (Get-GitStatusSetting) {
|
||||||
if ($null -eq $env:gitLoaded) {
|
if ($null -eq $env:gitLoaded) {
|
||||||
$env:gitLoaded = Import-Git
|
$env:gitLoaded = Import-Git
|
||||||
}
|
}
|
||||||
if ($env:gitLoaded -eq $true) {
|
if ($env:gitLoaded -eq $true) {
|
||||||
Write-VcsStatus
|
Write-VcsStatus
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
$headFile = Join-Path $gitDir 'HEAD'
|
||||||
$headContent = Get-Content (Join-Path $Path '.git/HEAD')
|
if (Test-Path $headFile) {
|
||||||
if ($headContent -like "ref: refs/heads/*") {
|
$headContent = Get-Content $headFile -Raw
|
||||||
$branchName = $headContent.Substring(16)
|
if ($headContent -match 'ref: refs/heads/(.+)') {
|
||||||
|
$branchName = $Matches[1].Trim()
|
||||||
|
} else {
|
||||||
|
$shortHash = $headContent.Substring(0, [Math]::Min(7, $headContent.Length))
|
||||||
|
$branchName = "HEAD detached at $shortHash"
|
||||||
|
}
|
||||||
|
Microsoft.PowerShell.Utility\Write-Host " [$branchName]" -NoNewline -ForegroundColor White
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
$branchName = "HEAD detached at $($headContent.Substring(0, 7))"
|
|
||||||
}
|
|
||||||
Write-Host " [$branchName]" -NoNewline -ForegroundColor White
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getGitStatusSetting() {
|
function Get-GitStatusSetting {
|
||||||
$gitStatus = (git --no-pager config -l) | Out-String
|
$gitConfig = git --no-pager config -l 2>$null | Out-String
|
||||||
|
|
||||||
foreach ($line in $($gitStatus -split "`r`n")) {
|
# Check if git status display is disabled via config
|
||||||
if (($line -match 'cmder.status=false') -or ($line -match 'cmder.psstatus=false')) {
|
# Matches: cmder.status=false or cmder.psstatus=false (PowerShell-specific)
|
||||||
return $false
|
if ($gitConfig -match '(?m)^cmder\.(ps)?status=false$') {
|
||||||
}
|
return $false
|
||||||
}
|
}
|
||||||
|
|
||||||
return $true
|
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!"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
2155
vendor/psmodules/PsGet/PsGet.psm1
vendored
2155
vendor/psmodules/PsGet/PsGet.psm1
vendored
File diff suppressed because it is too large
Load Diff
21
vendor/sources.json
vendored
21
vendor/sources.json
vendored
@@ -1,22 +1,27 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": "git-for-windows",
|
"name": "git-for-windows",
|
||||||
"version": "2.40.0-rc2.windows.1",
|
"version": "2.51.2.windows.1",
|
||||||
"url": "https://github.com/git-for-windows/git/releases/download/v2.40.0-rc2.windows.1/PortableGit-2.40.0-rc2-64-bit.7z.exe"
|
"url": "https://github.com/git-for-windows/git/releases/download/v2.51.2.windows.1/PortableGit-2.51.2-64-bit.7z.exe"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "clink",
|
"name": "clink",
|
||||||
"version": "1.4.22",
|
"version": "1.8.8",
|
||||||
"url": "https://github.com/chrisant996/clink/releases/download/v1.4.22/clink.1.4.22.33f515.zip"
|
"url": "https://github.com/chrisant996/clink/releases/download/v1.8.8/clink.1.8.8.a63364.zip"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "conemu-maximus5",
|
"name": "conemu-maximus5",
|
||||||
"version": "22.12.18",
|
"version": "23.07.24",
|
||||||
"url": "https://github.com/Maximus5/ConEmu/releases/download/v22.12.18/ConEmuPack.221218.7z"
|
"url": "https://github.com/ConEmu/ConEmu/releases/download/v23.07.24/ConEmuPack.230724.7z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "windows-terminal",
|
||||||
|
"version": "1.23.12811.0",
|
||||||
|
"url": "https://github.com/microsoft/terminal/releases/download/v1.23.12811.0/Microsoft.WindowsTerminal_1.23.12811.0_x64.zip"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "clink-completions",
|
"name": "clink-completions",
|
||||||
"version": "0.4.7",
|
"version": "0.6.6",
|
||||||
"url": "https://github.com/vladimir-kotikov/clink-completions/archive/v0.4.7.zip"
|
"url": "https://github.com/vladimir-kotikov/clink-completions/archive/v0.6.6.zip"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
51
vendor/start_git_bash.cmd
vendored
Normal file
51
vendor/start_git_bash.cmd
vendored
Normal 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
40
vendor/start_git_mintty.cmd
vendored
Normal 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
174
vendor/user_init.cmd.template
vendored
Normal 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
|
||||||
|
|
||||||
|
|
||||||
390
vendor/windows_terminal_default_settings.json
vendored
Normal file
390
vendor/windows_terminal_default_settings.json
vendored
Normal 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"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user