moved electron-specific parts of tabby-local into tabby-electron

This commit is contained in:
Eugene Pankov
2023-03-19 12:39:31 +01:00
parent 2e72774548
commit 35ca7015c8
52 changed files with 120 additions and 110 deletions

View File

@@ -16,8 +16,12 @@
],
"author": "Eugene Pankov",
"license": "MIT",
"dependencies": {
"hasbin": "^1.2.3"
},
"peerDependencies": {
"@angular/core": "^9.1.9"
"@angular/core": "^9.1.9",
"tabby-local": "*"
},
"devDependencies": {
"electron-promise-ipc": "^2.2.4",

View File

@@ -0,0 +1 @@
<svg viewBox="0 0 61.028 59.731" xmlns="http://www.w3.org/2000/svg"><style>.st1{fill:#86da2f}.st2{fill:#24c2ff}.st3{fill:#ffcb12}.st4{fill:#0069da}.st5{fill:#ff4649}</style><path class="st1" d="M56.114 33.731c2.6-.2 4.7 1.5 4.9 4.1.2 2.7-1.7 4.9-4.3 5.1-2.5.2-4.7-1.7-4.9-4.2-.2-2.7 1.6-4.7 4.3-5z"/><path class="st2" d="M24.514 55.031c0-2.6 2-4.6 4.4-4.6s4.7 2.2 4.7 4.7c0 2.4-2 4.5-4.3 4.6-2.9 0-4.8-1.8-4.8-4.7z"/><path class="st3" d="M31.614 25.831c-.4.2-.6-.1-.7-.4-3.7-6.9-2.6-15.6 3.9-20.8 1.7-1.4 4.9-1.7 6.3-.3.6.5.7 1.1.8 1.8.2 1.5.5 3 1.5 4.2 1.1 1.3 2.5 1.8 4.1 1.7 1.4 0 2.8-.2 3.7 1.4.5.9.3 4.4-.5 5.1-.4.3-.7.1-1 0-2.3-.9-4.7-.9-7.1-.5-.8.1-1.2-.1-1.2-1-.1-1.5-.4-2.9-1.2-4.2-1.5-2.7-4.3-2.8-6.1-.3-1.5 2-1.9 4.4-2.3 6.8-.4 2.1-.3 4.3-.2 6.5 0 0-.1 0 0 0z"/><path class="st1" d="M34.114 27.331c-.2-.3-.1-.6.2-.8 5.7-5.2 14.2-6.2 20.8-1.1 1.7 1.4 2.8 4.3 1.9 6-.4.7-.9 1-1.5 1.2-1.4.6-2.7 1.2-3.6 2.5s-1.1 2.8-.7 4.4c.3 1.3.8 2.7-.5 3.9-.7.7-4.1 1.3-5 .7-.4-.3-.3-.6-.2-1 .3-2.5-.3-4.8-1.2-7-.3-.8-.2-1.2.6-1.4 1.4-.4 2.7-1.1 3.7-2.1 2.2-2.1 1.7-4.8-1.2-6-2.3-1-4.7-.8-7-.6-2.2.1-4.3.7-6.3 1.3z"/><path class="st2" d="M32.814 29.931c.3-.3.5-.2.8 0 6.6 4 10 11.9 7 19.6-.8 2-3.4 4-5.3 3.5-.8-.2-1.2-.6-1.6-1.1-.9-1.2-1.9-2.3-3.4-2.8-1.6-.5-3-.2-4.4.6-1.2.7-2.4 1.6-3.9.7-.9-.5-2.4-3.6-2.1-4.6.2-.4.6-.4 1-.4 2.5-.4 4.5-1.6 6.4-3.2.6-.5 1.1-.5 1.6.2.8 1.2 1.8 2.2 3.1 2.9 2.6 1.5 5.1.2 5.4-2.8.3-2.5-.6-4.7-1.4-6.9-.9-2-2-3.9-3.2-5.7z"/><path class="st4" d="M29.614 30.531c-.4 2-1.3 3.9-2.5 5.6-3.6 5.4-8.8 7.6-15.2 7-2.3-.2-4.2-2.1-4.4-4-.1-.8.1-1.4.6-2 .7-.9 1.3-1.7 1.6-2.8.6-2.2-.2-4-1.8-5.6-2.2-2.2-1.9-4.2.7-5.8.3-.2.7-.4 1.1-.6.6-.3 1.1-.3 1.3.4.9 2.3 2.7 4 4.7 5.4.7.6.7 1 .1 1.7-1.2 1.3-1.9 2.9-2 4.7-.2 2.2 1.1 3.6 3.3 3.6 1.4 0 2.7-.5 3.9-1.1 3.1-1.6 5.5-3.9 7.8-6.3.3-.1.4-.3.8-.2z"/><path class="st5" d="M13.214 9.531c.2 0 .7.1 1.2.2 3.7.7 6-.6 7.2-4.1.8-2.3 2.5-3 4.7-1.8.1 0 .1.1.2.1 2.3 1.3 2.3 1.5.9 3.5-1.2 1.6-1.8 3.4-2.1 5.3-.2 1.1-.6 1.3-1.6.9-1.6-.6-3.3-.6-5 0-1.9.6-2.7 2.3-2.1 4.2.8 2.5 3 3.6 4.9 4.9s4.1 2 6.2 2.9c.3.1.8.1.7.6-.1.3-.5.3-.9.3-4.5.2-8.8-.5-12.3-3.5-3.3-2.7-5.7-6-5.3-10.6.3-1.5 1.4-2.6 3.3-2.9z"/><path class="st4" d="M5.014 37.631c-2.4.3-4.8-1.7-5-4.2-.2-2.4 1.8-4.8 4.1-5 2.6-.3 5 1.5 5.2 3.9.1 2.3-1.4 5.1-4.3 5.3z"/><path class="st3" d="M47.014 2.031c2.5-.2 4.9 1.8 5.1 4.3.2 2.4-1.8 4.7-4.2 4.9-2.6.2-4.9-1.7-5.1-4.2s1.6-4.8 4.2-5z"/><path class="st5" d="M20.914 3.931c.3 2.6-1.5 4.8-4.2 5.2-2.3.3-4.7-1.6-5-3.8-.3-2.9 1.3-5 4-5.3 2.5-.3 4.9 1.6 5.2 3.9z"/></svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="300" height="300" fill="#fff" fill-rule="evenodd" stroke="#000" stroke-linecap="round" stroke-linejoin="round" font-family="Roboto" font-size="14" text-anchor="middle" viewBox="0 0 65 57"><defs><style type="text/css"/></defs><use x=".5" y=".5" xlink:href="#A"/><symbol id="A" overflow="visible"><g fill="#0d597f" fill-rule="nonzero" stroke="none"><path d="M23.252 34.527v-6.745l-4.855 4.864c.474.333.968.635 1.48.906.463.243.87.434 1.303.58a7.97 7.97 0 0 0 1.13.304c.348.064.66.093.95.096m24.822-.562a1.17 1.17 0 0 0 .142.1c.123.078.252.145.385.203a2.93 2.93 0 0 0 .637.194c.296.06.598.088.9.087a5.84 5.84 0 0 0 .955-.087 7.24 7.24 0 0 0 1.138-.301c.453-.16.895-.354 1.32-.58.52-.274 1.02-.58 1.503-.918l-3.685-3.6-12.2-12.258-5.356 5.356-7.23-7.455L8.44 32.647c.48.337.98.644 1.5.918.47.246.9.434 1.317.58a7.18 7.18 0 0 0 1.135.301 5.53 5.53 0 0 0 .955.087 4.53 4.53 0 0 0 .9-.087 3.29 3.29 0 0 0 .637-.194c.134-.054.263-.12.385-.197l.145-.104 8.193-8.193 2.924-2.808 8.106 8.106 2.837 2.912c.046.037.094.07.145.1.122.078.25.145.385.2a3.49 3.49 0 0 0 .637.194c.255.052.556.087.903.087a5.84 5.84 0 0 0 .955-.087c.387-.068.768-.168 1.138-.3a9.94 9.94 0 0 0 1.32-.579c.52-.274 1.02-.58 1.503-.918l-6.508-6.37 1.2-1.2 5.63 5.63 3.283 3.254M47.996.02l15.998 27.714-15.99 27.694H15.998L0 27.714 15.998 0z"/><path d="M38.022 26.367L33.76 22.11l.304-.304 4.3 4.244z"/></g></symbol></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" class="svg-inline--fa fa-windows fa-w-14 fa-2x" data-icon="windows" data-prefix="fab" focusable="false" role="img" viewBox="0 0 448 512"><path fill="#0ff" stroke="none" stroke-width="1" d="M0 93.7l183.6-25.3v177.4H0V93.7zm0 324.6l183.6 25.3V268.4H0v149.9zm203.8 28L448 480V268.4H203.8v177.9zm0-380.6v180.1H448V32L203.8 65.7z"/></svg>

After

Width:  |  Height:  |  Size: 392 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" class="svg-inline--fa fa-windows fa-w-14 fa-2x" data-icon="windows" data-prefix="fab" focusable="false" role="img" viewBox="0 0 448 512"><path fill="#fff" stroke="none" stroke-width="1" d="M0 93.7l183.6-25.3v177.4H0V93.7zm0 324.6l183.6 25.3V268.4H0v149.9zm203.8 28L448 480V268.4H203.8v177.9zm0-380.6v180.1H448V32L203.8 65.7z"/></svg>

After

Width:  |  Height:  |  Size: 392 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" class="svg-inline--fa fa-lambda fa-w-14 fa-2x" data-icon="lambda" data-prefix="fas" focusable="false" role="img" viewBox="0 0 448 512"><path fill="#0ff" stroke="none" stroke-width="1" d="M424 384h-43.5L197.6 48.68A32.018 32.018 0 0 0 169.5 32H24C10.75 32 0 42.74 0 56v48c0 13.25 10.75 24 24 24h107.5l4.63 8.49L3.25 446.55C-3.53 462.38 8.08 480 25.31 480h52.23c9.6 0 18.28-5.72 22.06-14.55l95.02-221.72L314.4 463.32A32.018 32.018 0 0 0 342.5 480H424c13.25 0 24-10.75 24-24v-48c0-13.26-10.75-24-24-24z"/></svg>

After

Width:  |  Height:  |  Size: 567 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" class="svg-inline--fa fa-lambda fa-w-14 fa-2x" data-icon="lambda" data-prefix="fas" focusable="false" role="img" viewBox="0 0 448 512"><path fill="#8ab91d" stroke="none" stroke-width="1" d="M424 384h-43.5L197.6 48.68A32.018 32.018 0 0 0 169.5 32H24C10.75 32 0 42.74 0 56v48c0 13.25 10.75 24 24 24h107.5l4.63 8.49L3.25 446.55C-3.53 462.38 8.08 480 25.31 480h52.23c9.6 0 18.28-5.72 22.06-14.55l95.02-221.72L314.4 463.32A32.018 32.018 0 0 0 342.5 480H424c13.25 0 24-10.75 24-24v-48c0-13.26-10.75-24-24-24z"/></svg>

After

Width:  |  Height:  |  Size: 570 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><g stroke-linejoin="round" stroke-width="4"><path fill="#eee" d="M94,19l-28-9h-39c-9,0-19,9-19,19v47c0,9,10,19,19,19h39l28-10l-28-9h-26c-9,0-13-3-13-13v-22c0-10,4-13,13-13h26z"/><path fill="#0f0" d="M94,52l-41-11h-13v3c10,0,10,16,0,16v3h13z"/></g></svg>

After

Width:  |  Height:  |  Size: 315 B

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

@@ -0,0 +1 @@
<svg viewBox="-5.724 -43.601 714.54 512.74" xmlns="http://www.w3.org/2000/svg"><g fill="#0091e2"><path d="M701.77 149.96c-1.938-1.539-20.029-15.199-58.181-15.199a185.562 185.562 0 00-30.061 2.584c-7.384-50.612-49.228-75.288-51.104-76.395l-10.245-5.908-6.738 9.723a137.318 137.318 0 00-18.214 42.582c-6.831 28.891-2.677 56.027 11.999 79.226-17.722 9.876-46.151 12.307-51.904 12.522H16.642c-12.294.017-22.27 9.952-22.337 22.245a338.726 338.726 0 0020.614 120.95c16.214 42.521 40.336 73.842 71.719 93.01 35.167 21.537 92.302 33.844 157.07 33.844a468.88 468.88 0 0087.226-7.907 364.663 364.663 0 00113.84-41.352 312.969 312.969 0 0077.688-63.596c37.29-42.213 59.505-89.226 76.026-131.01h6.584c40.828 0 65.935-16.338 79.78-30.029a87.08 87.08 0 0021.045-31.167l2.923-8.553z"/><path d="M60.271 185.31h63.073a5.507 5.507 0 005.507-5.507v-56.182a5.507 5.507 0 00-5.476-5.538H60.271a5.507 5.507 0 00-5.507 5.507V179.802a5.507 5.507 0 005.507 5.508M147.19 185.31h63.073a5.507 5.507 0 005.507-5.507v-56.182a5.507 5.507 0 00-5.477-5.538h-63.104a5.537 5.537 0 00-5.538 5.538v56.181a5.54 5.54 0 005.539 5.508M235.43 185.31h63.073a5.507 5.507 0 005.507-5.507v-56.182a5.507 5.507 0 00-5.477-5.538h-63.104a5.507 5.507 0 00-5.507 5.507V179.802a5.51 5.51 0 005.508 5.508M322.62 185.31h63.073a5.537 5.537 0 005.538-5.507v-56.182a5.537 5.537 0 00-5.538-5.538H322.62a5.507 5.507 0 00-5.507 5.507V179.802a5.508 5.508 0 005.507 5.508M147.19 104.48h63.073a5.539 5.539 0 005.507-5.538V42.761a5.507 5.507 0 00-5.507-5.507H147.19a5.538 5.538 0 00-5.538 5.507v56.181a5.568 5.568 0 005.538 5.538M235.43 104.48h63.073a5.539 5.539 0 005.507-5.538V42.761a5.507 5.507 0 00-5.507-5.507H235.43a5.507 5.507 0 00-5.507 5.507v56.181a5.539 5.539 0 005.507 5.538M322.62 104.48h63.073a5.568 5.568 0 005.538-5.538V42.761a5.537 5.537 0 00-5.538-5.507H322.62a5.507 5.507 0 00-5.507 5.507v56.181a5.539 5.539 0 005.507 5.538M322.62 23.626h63.073a5.538 5.538 0 005.538-5.507v-56.213a5.537 5.537 0 00-5.538-5.507H322.62a5.506 5.506 0 00-5.507 5.507v56.212a5.508 5.508 0 005.507 5.508M410.59 185.31h63.073a5.537 5.537 0 005.538-5.507v-56.182a5.537 5.537 0 00-5.538-5.538H410.59a5.508 5.508 0 00-5.507 5.507V179.802a5.508 5.508 0 005.507 5.508"/></g></svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 113.925 113.923"><defs><clipPath id="aaaaaaaa"><path d="M0 0h2183.73v912H0V0z"/></clipPath><clipPath id="bbbbbbbb"><path d="M230.892 51.977L181.15 2.238a7.336 7.336 0 00-10.375 0l-10.328 10.33 13.102 13.102c3.046-1.028 6.537-.339 8.964 2.089a8.72 8.72 0 012.07 9.02l12.627 12.627c3.055-1.053 6.58-.373 9.02 2.07a8.727 8.727 0 010 12.346 8.729 8.729 0 01-12.349 0 8.734 8.734 0 01-1.9-9.494L180.204 42.55v30.99a8.806 8.806 0 012.309 1.652c3.41 3.409 3.41 8.933 0 12.347-3.411 3.41-8.938 3.41-12.346 0-3.41-3.414-3.41-8.938 0-12.347a8.735 8.735 0 012.859-1.905V42.009a8.636 8.636 0 01-2.859-1.905 8.728 8.728 0 01-1.88-9.544L155.37 17.642l-34.106 34.105a7.339 7.339 0 000 10.378l49.742 49.74a7.338 7.338 0 0010.376 0l49.509-49.51a7.341 7.341 0 000-10.378" fill="#f03c2e"/></clipPath></defs><g transform="translate(-119.116 -.075)" clip-path="url(#bbbbbbbb)"><path d="M230.435-10.813l-49.742-49.739a7.336 7.336 0 00-10.374 0l-49.51 49.51a7.339 7.339 0 000 10.378l49.741 49.738a7.338 7.338 0 0010.376 0l49.51-49.508a7.341 7.341 0 000-10.379" fill="#ff8080"/><path d="M293.393 51.928L243.65 2.188a7.336 7.336 0 00-10.375 0c-16.502 16.505-33.006 33.007-49.51 49.51a7.339 7.339 0 000 10.378l49.742 49.739a7.338 7.338 0 0010.376 0l49.509-49.509a7.341 7.341 0 000-10.378" fill="#8dd35f"/><path d="M167.436 51.52L117.693 1.783a7.336 7.336 0 00-10.374 0l-49.51 49.509a7.339 7.339 0 000 10.378l49.741 49.74a7.338 7.338 0 0010.376-.001l49.51-49.508a7.341 7.341 0 000-10.38" fill="#80b3ff"/><path d="M230.13 114.117l-49.743-49.739a7.336 7.336 0 00-10.374 0l-49.51 49.51a7.339 7.339 0 000 10.378l49.741 49.738a7.338 7.338 0 0010.376 0l49.51-49.508a7.341 7.341 0 000-10.379" fill="#ffe680"/></g></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1 @@
<svg version="1" viewBox="0 0 459.36 233.64" xmlns="http://www.w3.org/2000/svg"><path d="M448.2.54c-1.708-.456-3.412-.54-5.177-.54H15.093C8.67.05 3.033 4.105.898 10.144c-.697 1.963-.9 3.95-.9 6.01v202.42c.238 8.434 6.837 15.012 15.194 15.033 17.519.023 53.594-.063 53.594-.063l-.064-15.665h-52.62c-.279-1.683-.208-199.78.064-200.69 1.612-.225 425.79-.144 426.72.074.257 1.528.182 199.65-.098 200.69H88.048v15.667s1.384 0 2.018.023h354.25a15.182 15.182 0 0014.147-10.038c.697-1.908.898-3.875.898-5.886v-202.8c-.134-6.7-4.693-12.585-11.143-14.365zM88.06 174.55v-40.512c0-.914.257-1.556 1.003-2.135 3.129-2.474 6.216-5.019 9.303-7.545.308-.228.608-.432.992-.712.333.43.613.783.872 1.17 5.248 7.572 10.5 15.136 15.746 22.696 6.436 9.313 12.883 18.583 19.306 27.852.356.538.684.946 1.475.946 6.762-.023 13.519-.023 20.273-.023.223 0 .453-.074.81-.155-14.956-21.781-29.85-43.412-44.79-65.174 3.005-3.49 5.913-6.847 8.817-10.288 2.912-3.37 5.814-6.75 8.721-10.142 2.903-3.384 5.785-6.774 8.696-10.161 2.904-3.395 5.813-6.783 8.685-10.168a1556.02 1556.02 0 008.827-10.347h-1.704c-6.12 0-12.237.037-18.358-.023-1.125 0-1.835.326-2.578 1.2a41266 41266 0 01-45.178 53.398c-.2.228-.46.432-.894.832V70.965c0-3.666.063-7.343 0-11.012H69.175v116.15c1.501.264 17.926.21 18.94-.063v-1.477zm100.96 1.682c.152-.44.326-.818.459-1.227 3.055-8.681 6.114-17.348 9.178-26.037a136.3 136.3 0 001.478-4.203c.182-.585.48-.892 1.098-.817.2.023.432 0 .635 0h43.136c3.9 10.803 7.772 21.529 11.63 32.255h20.192a186785 186785 0 01-43.549-116.77h-20.649c-.132.254-.23.44-.282.614-14.377 38.55-28.737 77.119-43.11 115.66-.062.063-.062.182-.062.256v.124c0 .05.063.074.074.132h19.734zm17.457-50.036c3.977-11.515 8.01-22.98 11.885-34.526 1.555-4.64 2.727-9.427 4.05-14.16.113-.358.183-.718.334-1.257.2.305.356.491.41.692 3.159 11.794 7.477 23.237 11.398 34.807 1.63 4.814 3.316 9.599 4.974 14.415.126.431.251.862.404 1.395H206.05c.152-.502.28-.934.426-1.365zm102.24-57.278c0-3.008.11-5.988-.087-8.967h-18.675c-.315 1.452-.238 115.33.063 116.29h68.021v-16.18h-32.812c-2.758 0-5.538.023-8.284 0-2.707-.023-5.403.1-8.21-.063V68.94zm81.201-8.251c0-.18 0-.33-.063-.518 0-.05-.062-.063-.062-.099 0-.023-.075-.063-.075-.063h-18.74v116.22h18.839c.063-.195.11-.3.11-.43V60.667z" clip-rule="evenodd" fill="#367bf0" fill-rule="evenodd"/></svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 205 KiB

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="36.777mm" height="36.777mm" version="1.1" viewBox="0 0 36.777 36.777" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<metadata>
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title/>
</cc:Work>
</rdf:RDF>
</metadata>
<g transform="translate(-122.71 -169.49)">
<g transform="translate(36.844 36.777)" fill="#999">
<path d="m118.48 154.39c-0.21263-0.77937-0.60053-0.53763-3.7786-0.53763-4.2381 0-4.51 0.21718-2.6541-2.4472 2.457-3.5274 3.4906-5.924 2.8085-6.965-0.4719-0.72022-1.0125-0.62449-1.9271 0.34127-0.84859 0.89603-1.8689 0.41779-1.8689-0.95587 0-2.012 2.8056-3.9999 5.3894-3.9922 1.614 5e-3 2.4364 0.4039 3.2158 1.5604 1.1203 1.6624 0.73145 3.8557-1.134 6.397-1.5438 2.1031-0.73385 3.6126 0.95572 1.7811 1.4629-1.6879 1.5595 0.86073 1.491 1.7028-0.2309 2.6962-2.077 4.6571-2.4976 3.1153z" fill="#999" stroke-width=".26458"/>
</g>
<g stroke-width=".50508">
<path transform="matrix(.26458 0 0 .26458 122.71 169.49)" d="m9.2551 97.323c-1.1562-0.7536-0.31598-3.2576 3.2531-9.6944 5.9813-10.787 19.737-40.139 25.544-54.507 3.4471-8.5282 3.725-10.717 1.5808-12.448-1.1414-0.92159-1.2907-1.285-0.8373-2.0393 1.6696-2.7778 11.294-3.9702 15.358-1.9029 4.5286 2.3035 6.6098 7.8684 9.3407 24.976 2.1781 13.645 3.7862 22.817 4.0853 23.301 0.80633 1.3047 2.407-1.8854 8.4838-16.908 8.5152-21.05 12.267-27.812 16.696-30.091 1.962-1.0097 3.3986-1.3036 7.1792-1.469 6.0598-0.26504 6.2396-0.12365 6.2324 4.9003-9e-3 6.5148-0.30491 7.4305-2.886 8.9432-4.8227 2.8263-8.1944 7.5856-8.2016 11.577-0.0099 5.4798 4.0769 7.1796 7.8338 3.2583 0.7854-0.81978 1.6128-1.4905 1.8386-1.4905s0.4119 2.1024 0.4135 4.672c2e-3 2.5696 0.21897 5.9911 0.48302 7.6033 0.54393 3.3211 0.62062 3.1596-6.937 14.613-4.1978 6.362-4.5659 7.2622-3.4332 8.3967 0.6867 0.6878 2.275 0.85452 9.4046 0.9872l8.5784 0.15964 2.1125 2.798c2.5812 3.4188 2.7454 5.2892 0.6996 7.9714-1.8668 2.4475-5.6125 5.1245-8.1753 5.8427-3.7415 1.0486-8.4103-1.013-12.47-5.5062-5.2081-5.7647-7.5396-14.899-8.239-32.278-0.24251-6.0259-0.52471-8.6733-0.91083-8.5446-0.30771 0.10257-3.7635 7.5753-7.6796 16.606-12.423 28.649-13.924 31.318-17.16 30.506-2.025-0.50825-5.0993-4.014-7.2197-8.2328-4.1934-8.3436-6.5579-19.088-7.6998-34.988-0.32917-4.5836-0.78831-8.5453-1.0203-8.8039-0.51357-0.57238-2.2088 3.1103-7.8764 17.11-7.6151 18.811-10.569 24.729-14.439 28.927-3.2899 3.5691-11.857 7.1072-13.933 5.7541z" fill="#f9f9f9"/>
<g fill="#d35e64">
<path transform="matrix(.26458 0 0 .26458 122.71 169.49)" d="m75.664 122.46c-1.2249-0.96348-1.34-1.3378-1.2045-3.9143l0.14983-2.849h1.7351c1.6821 0 1.7361 0.0617 1.7678 2.0203l0.03266 2.0203 2.6573 0.15286c2.0366 0.11715 2.7277-0.0306 2.9587-0.63248 0.60362-1.573-0.4054-3.3932-3.728-6.7251-1.8658-1.871-3.9062-4.071-4.5342-4.8889-1.4589-1.8999-1.5437-5.2283-0.17634-6.917 0.88504-1.093 1.3438-1.1924 5.5028-1.1924 5.1756 0 6.3427 0.6042 6.8174 3.5294 0.4355 2.6837-0.25445 4.5518-1.6811 4.5518-1.0066 0-1.2918-0.36987-1.7526-2.2728-0.50287-2.0764-0.69656-2.287-2.2406-2.4363-0.92959-0.0899-2.2269-0.0288-2.883 0.13589-2.2502 0.56476-1.4227 2.1852 3.6054 7.0604l4.7982 4.6523v3.4083c0 5.2086-0.1649 5.3622-5.758 5.3622-4.0289 0-4.9088-0.1545-6.0667-1.0653z"/>
<path transform="matrix(.26458 0 0 .26458 122.71 169.49)" d="m95.774 130.77c0.17811-1.0634 0.45153-3.9789 0.60759-6.479 0.26576-4.2574 0.13359-5.1223-2.0838-13.637-1.3021-5.0002-2.4843-9.6028-2.6269-10.228-0.22442-0.98323-0.05554-1.1364 1.2529-1.1364 0.83175 0 1.7665 0.30628 2.0771 0.68062 0.31067 0.37434 1.1434 3.2722 1.8506 6.4397 1.5777 7.0668 1.7138 7.5269 2.2267 7.5269 0.6014 0 1.3464-2.1279 2.8279-8.0775 1.4724-5.913 1.8338-6.5697 3.6148-6.5697 1.4844 0 1.7436-1.6442-2.6503 16.81-1.7714 7.44-3.5154 14.145-3.8755 14.9-0.44524 0.93333-1.1172 1.4255-2.0998 1.5381-1.4138 0.162-1.4381 0.1237-1.1212-1.7678z"/>
<path transform="matrix(.26458 0 0 .26458 122.71 169.49)" d="m123.48 114.84-5e-3 3.943s0.15696 3.7633-0.40862 4.2971c-0.57517 0.54286-2.7589 0.44883-5.7918 0.44883-5.2692 0-5.5498-0.0541-6.3116-1.2168-0.5398-0.82384-0.74743-2.0878-0.64299-3.9143 0.15002-2.6234 0.19573-2.6976 1.6626-2.6976 1.1206 0 1.5476 0.25963 1.6612 1.0102 0.49591 3.2773 0.50129 3.283 3.0918 3.283 5.0292 0 4.4851-2.8078-1.5873-8.1914-3.7309-3.3076-4.9304-5.0912-4.9196-7.3146 0.0189-3.8712 1.6713-5.2021 6.4586-5.2021 5.461 0 7.1715 1.3886 7.1715 5.8219 0 3.2126-3.0514 3.8315-3.5569 0.7215-0.42706-2.6273-0.8307-3.0079-3.1904-3.0079-2.2332 0-3.3512 0.66414-3.3585 1.995-2e-3 0.43058 2.2137 2.8835 4.9245 5.4509"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@@ -0,0 +1 @@
<svg viewBox="0 0 80.14 56.1" xmlns="http://www.w3.org/2000/svg"><defs><style>.cls-2{fill:#002fa7}</style></defs><g data-name="图层 2"><g data-name="图层 1"><path class="cls-2" d="M75.101 9.097c-4.08-1.06-9-.05-11.16 2.28s-.92 5.49 3.27 6.82c4.39 1.4 9.92.3 12.07-2.42s.08-5.53-4.18-6.68zM48.941 40.017a12.32 12.32 0 00-13.77 2.64c-3.54 3.79-3.15 9.12 1.26 11.87 4.68 2.93 11.67 1.64 15.18-2.82a7.39 7.39 0 00-2.67-11.69zM57.421 4.527a12.49 12.49 0 00-6.13.12 11.3 11.3 0 01-4.76-.14 3.68 3.68 0 01-2.66-1.92 1.58 1.58 0 00-.1-.43v-.06a3.38 3.38 0 00-2.45-1.72.61.61 0 00-.13 0 10.14 10.14 0 00-4.78-.17c-3.55.66-6.15 2.71-5.81 4.58a10.21 10.21 0 01-.06 1 4.34 4.34 0 01-1.79 2.46 8.39 8.39 0 01-3.2 1.69 14.83 14.83 0 01-2 .26 19.55 19.55 0 00-2.81.17 5.75 5.75 0 00-3.17 1.59 3.78 3.78 0 00-.88 3 5.5 5.5 0 01.06 1.29 5.55 5.55 0 01-2.37 3.67 12.93 12.93 0 01-5.41 2.49 13.54 13.54 0 00-5.87 2.6c-3.38 2.64-4.16 6.12-1.53 7.76 1.54 1 3.89 1.06 6.29.41a8 8 0 015.15.72 4.42 4.42 0 011.78 1.81 3.24 3.24 0 01.32 1 4.12 4.12 0 01.07.78 4.91 4.91 0 002.25 5.21c3.57 2.22 9.6 1.06 13.14-2.55 3.38-3.45 3-7.63-.64-9.39a10.13 10.13 0 00-6.91-.37 8.66 8.66 0 01-5.24-.66 3.54 3.54 0 01-2.14-3.24 6.83 6.83 0 01.42-1.64 9.92 9.92 0 012.16-3.13 9.55 9.55 0 014.44-2.36c.68-.18 1.79-.41 2-.43a10.64 10.64 0 014.93.41c1.41.57 2.45 1.5 2.54 2.66a4.47 4.47 0 002.8 4 11.61 11.61 0 0011.84-2.37c2.7-2.76 1.8-6-1.78-7.24a11.39 11.39 0 00-6.5-.08 10 10 0 01-5-.35c-1.46-.55-2.42-1.44-2.47-2.48a5.59 5.59 0 011.77-3.87 11.79 11.79 0 013.91-2 12.63 12.63 0 011.85-.43 11.79 11.79 0 014.69.19c1.4.42 2.68 1.19 2.72 2 .06 1.1 1.15 2.41 3.13 3 3.55 1.14 8.47.13 10.77-2.21s1.05-4.72-2.44-5.63z"/></g></g></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1 @@
<svg viewBox="0 0 31.4 19.8" xmlns="http://www.w3.org/2000/svg"><path d="M9.9 19.8C4.4 19.8 0 15.4 0 9.9S4.4 0 9.9 0h11.6c5.5 0 9.9 4.4 9.9 9.9s-4.4 9.9-9.9 9.9H9.9m11.3-3.5c3.6 0 6.4-2.9 6.4-6.4 0-3.6-2.9-6.4-6.4-6.4h-11c-3.6 0-6.4 2.9-6.4 6.4s2.9 6.4 6.4 6.4h11" fill="#c74634"/></svg>

After

Width:  |  Height:  |  Size: 287 B

View File

@@ -0,0 +1 @@
<svg viewBox="0 0 120 90.001" xmlns="http://www.w3.org/2000/svg"><linearGradient id="1652546273" x1="95.267" x2="26.7" y1="91.926" y2="30.68" gradientTransform="translate(-4.002 -19)" gradientUnits="userSpaceOnUse"><stop stop-color="#A9C8FF" offset="0"/><stop stop-color="#C7E6FF" offset="1"/></linearGradient><path d="M5.03 90c-1.632 0-3.045-.638-3.977-1.798-.952-1.185-1.28-2.814-.896-4.47L18.143 5.821C18.897 2.557 22.06 0 25.347 0h89.623c1.634 0 3.047.638 3.978 1.798.952 1.184 1.279 2.814.896 4.47l-17.986 77.911c-.753 3.264-3.917 5.822-7.203 5.822H5.03z" clip-rule="evenodd" fill="url(#1652546273)" fill-rule="evenodd" opacity=".8"/><g transform="translate(-4.002 -19)"><linearGradient id="1652546298" x1="26.585" x2="93.585" y1="30.778" y2="90.278" gradientUnits="userSpaceOnUse"><stop stop-color="#2D4664" offset="0"/><stop stop-color="#29405B" offset=".169"/><stop stop-color="#1E2F43" offset=".445"/><stop stop-color="#0C131B" offset=".79"/><stop offset="1"/></linearGradient><path d="M118.5 20H29.634c-2.769 0-5.53 2.259-6.168 5.045l-17.834 77.91C4.995 105.742 6.722 108 9.491 108h88.865c2.769 0 5.53-2.258 6.168-5.045l17.834-77.911c.638-2.785-1.09-5.044-3.858-5.044z" clip-rule="evenodd" fill="url(#1652546298)" fill-rule="evenodd"/></g><g clip-rule="evenodd" fill-rule="evenodd"><path d="M60.163 68.558h21.613c2.513 0 4.55 2.125 4.55 4.746s-2.037 4.747-4.55 4.747H60.163c-2.513 0-4.55-2.125-4.55-4.747 0-2.621 2.037-4.746 4.55-4.746zM74.182 47.455c-.372.749-1.144 1.575-2.509 2.534L31.56 78.798c-2.19 1.591-5.334 1.001-7.021-1.319s-1.28-5.49.91-7.082l36.173-26.194v-.538L38.894 19.487c-1.854-1.972-1.661-5.161.431-7.124 2.092-1.962 5.29-1.954 7.144.018L73.74 41.393c1.548 1.647 1.663 4.141.442 6.062z" fill="#2c5591"/><path d="M73.182 46.455c-.372.749-1.144 1.575-2.509 2.534L30.56 77.798c-2.19 1.591-5.334 1.001-7.021-1.319s-1.28-5.49.91-7.082l36.173-26.194v-.538L37.894 18.487c-1.854-1.972-1.661-5.161.431-7.124 2.092-1.962 5.29-1.954 7.144.018L72.74 40.393c1.548 1.647 1.663 4.141.442 6.062zM59.548 68h21.613c2.513 0 4.55 2.015 4.55 4.5s-2.037 4.5-4.55 4.5H59.548c-2.513 0-4.55-2.015-4.55-4.5s2.037-4.5 4.55-4.5z" fill="#fff"/></g></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -0,0 +1 @@
<svg viewBox="0 0 118.99 90.001" xmlns="http://www.w3.org/2000/svg"><linearGradient id="1652546342" x1="95.123" x2="26.855" y1="91.805" y2="30.825" gradientTransform="translate(-4.503 -19)" gradientUnits="userSpaceOnUse"><stop stop-color="#5391FE" offset="0"/><stop stop-color="#3E6DBF" offset="1"/></linearGradient><path d="M4.988 90c-1.62 0-3.021-.638-3.944-1.798-.944-1.185-1.268-2.814-.89-4.47L17.99 5.821C18.736 2.557 21.873 0 25.13 0h88.866c1.62 0 3.02.638 3.945 1.798.944 1.184 1.268 2.814.889 4.47l-17.834 77.911c-.747 3.264-3.884 5.822-7.143 5.822H4.988z" clip-rule="evenodd" fill="url(#1652546342)" fill-rule="evenodd"/><linearGradient id="1652546328" x1="26.178" x2="93.748" y1="30.015" y2="90.738" gradientTransform="translate(-4.503 -19)" gradientUnits="userSpaceOnUse"><stop stop-color="#5391FE" offset="0"/><stop stop-color="#3E6DBF" offset="1"/></linearGradient><g clip-rule="evenodd" fill-rule="evenodd"><path d="M25.131 1h88.866c2.769 0 4.496 2.259 3.858 5.045l-17.834 77.911c-.638 2.786-3.399 5.045-6.168 5.045H4.988c-2.769 0-4.496-2.258-3.858-5.045L18.964 6.045C19.601 3.259 22.363 1 25.131 1z" fill="url(#1652546328)"/><path d="M59.662 68.558h21.613c2.513 0 4.55 2.125 4.55 4.746s-2.037 4.747-4.55 4.747H59.662c-2.513 0-4.55-2.125-4.55-4.747 0-2.621 2.037-4.746 4.55-4.746zM73.681 47.455c-.372.749-1.144 1.575-2.509 2.534L31.059 78.798c-2.19 1.591-5.334 1.001-7.021-1.319s-1.28-5.49.91-7.082l36.173-26.194v-.538L38.393 19.487c-1.854-1.972-1.661-5.161.431-7.124 2.092-1.962 5.29-1.954 7.144.018l27.271 29.012c1.548 1.647 1.663 4.141.442 6.062z" fill="#2c5591"/><path d="M72.681 46.455c-.372.749-1.144 1.575-2.509 2.534L30.059 77.798c-2.19 1.591-5.334 1.001-7.021-1.319s-1.28-5.49.91-7.082l36.173-26.194v-.538L37.393 18.487c-1.854-1.972-1.661-5.161.431-7.124 2.092-1.962 5.29-1.954 7.144.018l27.271 29.012c1.548 1.647 1.663 4.141.442 6.062zM59.047 68H80.66c2.513 0 4.55 2.015 4.55 4.5S83.173 77 80.66 77H59.047c-2.513 0-4.55-2.015-4.55-4.5s2.037-4.5 4.55-4.5z" fill="#fff"/></g></svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" id="svg8" width="256" height="256" version="1.1" viewBox="0 0 256 256"><metadata id="metadata5"/><g id="layer1" transform="matrix(6.9999999,0,0,6.9999736,16,-7617.6082)" style="fill:#73ba25;fill-opacity:1"><g style="fill:#73ba25;fill-opacity:1" id="g838" transform="matrix(0.26458333,0,0,0.26458333,-10.590624,-38.473045)"><circle id="path872" cx="507.464" cy="3582.83" r="0" style="opacity:.3;fill:#73ba25;fill-opacity:1;stroke:none;stroke-width:1.90573967;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/><path id="path819" d="m 100.5002,4267.059 a 60.472077,60.472442 0 0 0 -47.607132,23.2988 c 7.375955,1.9706 12.596534,3.6642 14.160064,4.1895 0.0245,-0.9593 0.183589,-9.5391 0.183589,-9.5391 0,0 0.0202,-0.1964 0.124999,-0.2988 0.13497,-0.1318 0.330078,-0.092 0.330078,-0.092 1.939989,0.281 43.348482,6.4189 60.802382,16.5899 2.15548,1.261 3.21941,2.6017 4.5488,3.9609 4.82477,4.99 11.19998,25.7389 11.88469,30.0176 0.0269,0.1681 -0.18083,0.3507 -0.26953,0.4199 h -0.002 c -0.4957,0.3868 -1.03554,0.789 -1.57616,1.1484 -4.12998,2.7709 -13.64449,9.4312 -25.85142,8.3438 -10.96493,-0.97 -25.290388,-7.2597 -42.560284,-18.6387 1.69799,3.9756 3.371,7.9635 5.04489,11.9492 2.500985,1.299 26.640524,13.5997 38.554464,13.3594 9.59593,-0.1999 19.85892,-4.8804 23.96469,-7.3516 0,0 0.90227,-0.5436 1.29491,-0.2402 0.4295,0.3318 0.31068,0.8402 0.20898,1.3594 -0.25259,1.1786 -0.82764,3.3289 -1.21873,4.3496 l -0.33008,0.832 c -0.46999,1.2592 -0.92111,2.4296 -1.79101,3.1504 -2.41868,2.1993 -6.27908,3.9491 -12.32804,6.5781 -9.34995,4.09 -24.51938,6.6911 -38.603293,6.6016 -5.04437,-0.1123 -9.91781,-0.672 -14.197174,-1.1719 -8.782187,-0.9915 -15.927854,-1.7959 -20.285038,1.3555 a 60.472077,60.472442 0 0 0 45.517305,20.7734 60.472077,60.472442 0 0 0 60.47229,-60.4726 60.472077,60.472442 0 0 0 -60.47229,-60.4727 z m 13.4882,35.0879 c -4.73327,-0.1509 -9.24668,1.5194 -12.70695,4.75 -3.458684,3.2199 -5.437952,7.6097 -5.613251,12.3399 -0.326998,9.7581 7.334241,17.9803 17.083881,18.3398 4.75477,0.1596 9.25839,-1.5118 12.71867,-4.7617 3.44988,-3.2099 5.42915,-7.5999 5.61325,-12.3301 0.335,-9.7494 -7.33546,-17.9889 -17.0956,-18.3379 z m -0.14844,5.2188 c 6.82096,0.242 12.16127,5.972 11.93157,12.791 -0.1053,3.2885 -1.49253,6.3369 -3.90231,8.5976 -2.41329,2.2502 -5.56743,3.4203 -8.87691,3.3203 -6.80516,-0.251 -12.14564,-5.9877 -11.91594,-12.8085 0.1,-3.3008 1.51475,-6.3495 3.91403,-8.5997 2.39919,-2.2502 5.53828,-3.42 8.84956,-3.3007 z m 2.02147,6.2011 c -3.03067,0 -5.47848,1.631 -5.47848,3.6602 0,2.01 2.44781,3.6504 5.47848,3.6504 3.02888,0 5.4863,-1.6405 5.4863,-3.6504 0,-2.0292 -2.45572,-3.6602 -5.4863,-3.6602 z" style="opacity:1;fill:#73ba25;fill-opacity:1;stroke:none;stroke-width:1.90559804;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256" preserveAspectRatio="xMidYMid" version="1.1" viewBox="0 0 256 256"><g><path fill="#DD4814" d="M255.637396,127.683191 C255.637396,198.196551 198.47207,255.363378 127.954205,255.363378 C57.4348387,255.363378 0.27026393,198.196551 0.27026393,127.683191 C0.27026393,57.1653255 57.4355894,0 127.954205,0 C198.472821,0 255.637396,57.1653255 255.637396,127.683191 L255.637396,127.683191 Z"/><path fill="#FFF" d="M41.1334194,110.63254 C31.7139707,110.63254 24.0827683,118.264493 24.0827683,127.683191 C24.0827683,137.097384 31.7139707,144.728587 41.1334194,144.728587 C50.5476129,144.728587 58.1788152,137.097384 58.1788152,127.683191 C58.1788152,118.264493 50.5476129,110.63254 41.1334194,110.63254 L41.1334194,110.63254 Z M162.848282,188.111202 C154.694569,192.820551 151.898839,203.240727 156.608938,211.389935 C161.313032,219.543648 171.733208,222.338628 179.886921,217.629279 C188.039883,212.925185 190.835613,202.505009 186.126264,194.350545 C181.42217,186.202088 170.995988,183.407109 162.848282,188.111202 L162.848282,188.111202 Z M78.1618299,127.683191 C78.1618299,110.836739 86.5295015,95.9534545 99.3332551,86.9409032 L86.8703343,66.0667683 C71.9555191,76.0365044 60.8581818,91.271132 56.2464282,109.113806 C61.6276833,113.504845 65.0720469,120.189372 65.0720469,127.68244 C65.0720469,135.171003 61.6276833,141.855531 56.2464282,146.246569 C60.852176,164.094499 71.9495132,179.329877 86.8703343,189.299613 L99.3332551,168.420223 C86.5295015,159.412927 78.1618299,144.530393 78.1618299,127.683191 L78.1618299,127.683191 Z M127.954205,77.8855601 C153.967109,77.8855601 175.30895,97.8302874 177.549138,123.265877 L201.839859,122.907777 C200.644692,104.129689 192.441431,87.2719765 179.836622,74.875871 C173.354792,77.3247625 165.86773,76.9501466 159.396411,73.2197537 C152.91383,69.4788504 148.849361,63.1681877 147.738276,56.3177478 C141.438123,54.5790499 134.807648,53.6271202 127.952704,53.6271202 C116.168446,53.6271202 105.026815,56.3950733 95.1344047,61.2913548 L106.979472,82.5175836 C113.351695,79.5521877 120.460387,77.8855601 127.954205,77.8855601 L127.954205,77.8855601 Z M127.954205,177.475566 C120.460387,177.475566 113.351695,175.808188 106.980223,172.843543 L95.1351554,194.069021 C105.027566,198.971308 116.169196,201.740012 127.954205,201.740012 C134.80915,201.740012 141.439625,200.787331 147.739026,199.043378 C148.850111,192.192938 152.916082,185.888282 159.397161,182.140622 C165.872985,178.404223 173.355543,178.036364 179.837372,180.485255 C192.442182,168.08915 200.645443,151.231437 201.84061,132.453349 L177.543883,132.095249 C175.30895,157.537595 153.967859,177.475566 127.954205,177.475566 L127.954205,177.475566 Z M162.842276,67.2446686 C170.995988,71.9532669 181.416915,69.1642933 186.121009,61.0105806 C190.830358,52.856868 188.041384,42.4359413 179.886921,37.7258416 C171.733208,33.0217478 161.313032,35.8167273 156.602182,43.9704399 C151.898839,52.1196481 154.693818,62.5405748 162.842276,67.2446686 L162.842276,67.2446686 Z"/></g></svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -0,0 +1 @@
<svg width="57.04" height="57.04" color-interpolation-filters="sRGB" viewBox="0 0 42.78 42.78" xmlns="http://www.w3.org/2000/svg" fill="none" fill-rule="evenodd" font-size="12" overflow="visible" stroke-linecap="square" stroke-miterlimit="3"><g transform="translate(-1.5 -1.5)"><g transform="translate(1.5 -1.5)"><path d="M32.08 3v36.74L0 34.97l32.08 10.81 10.7-4.45V7.45zM11.02 23.58l9.83 9.72 5.88-2.5V11.74l-5.88-2.5-9.83 9.72-5.91-4.46-2.44.82v11.9l2.44.82zm9.83-7.41v10.2l-6.76-5.1zM5.11 17.73l3.58 3.54-3.58 3.54z" fill="#5c2d91"/></g></g></svg>

After

Width:  |  Height:  |  Size: 551 B

View File

@@ -0,0 +1 @@
<svg viewBox="0 0 96 95.503" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="1652546395" x1="48" x2="48" y1="97.75" y2="2.25" gradientTransform="matrix(1 0 0 -1 0 98)" gradientUnits="userSpaceOnUse"><stop stop-color="#fff" offset="0"/><stop stop-color="#fff" stop-opacity="0" offset="1"/></linearGradient><mask id="1652546356" x="0" y="0" width="96" height="95.51" maskUnits="userSpaceOnUse"><path transform="translate(0 -.25)" d="M68.89 95.6a6 6 0 003.93-.44l19.78-9.51a6 6 0 003.4-5.41V15.76a6 6 0 00-3.4-5.41L72.82.84a6 6 0 00-4.48-.29A6 6 0 0066 2L34.12 37.26 15.5 22l-1.63-1.4a4 4 0 00-3.61-.83 2.55 2.55 0 00-.53.18L2.46 23A4 4 0 000 26.37v43.26A4 4 0 002.46 73l7.27 3a2.55 2.55 0 00.53.18 4 4 0 003.61-.83L15.5 74l18.62-15.26L66 94a6 6 0 002.89 1.6zM72 27.68L47.21 48 72 68.32zm-60 6.59L24.41 48 12 61.73z" fill="#fff" fill-rule="evenodd"/></mask></defs><g transform="translate(0 .002)" mask="url(#1652546356)"><path d="M13.87 75.15a4 4 0 01-4.14.65l-7.27-3.05A4 4 0 010 69.08V26.42a4 4 0 012.46-3.67l7.27-3a4 4 0 014.14.65l1.63 1.35a2.21 2.21 0 00-3.5 1.8v48.4a2.21 2.21 0 003.5 1.8z" fill="#52218a"/><path d="M2.46 72.75A4 4 0 010 69.08v-.33a2.31 2.31 0 004 1.55L66 1.75A6 6 0 0172.82.59l19.78 9.52a6 6 0 013.4 5.41v.23a3.79 3.79 0 00-6.19-2.93L15.5 73.75l-1.63 1.4a4 4 0 01-4.14.65z" fill="#6c33af"/><path d="M2.46 22.75A4 4 0 000 26.42v.33a2.31 2.31 0 014-1.55l62 68.55a6 6 0 006.82 1.16l19.78-9.52a6 6 0 003.4-5.41v-.23a3.79 3.79 0 01-6.19 2.93L15.5 21.75l-1.63-1.4a4 4 0 00-4.14-.6z" fill="#854cc7"/><path d="M72.82 94.91A6 6 0 0166 93.75a3.52 3.52 0 006-2.49v-87a3.52 3.52 0 00-6-2.51A6 6 0 0172.82.59L92.6 10.1a6 6 0 013.4 5.41v64.48a6 6 0 01-3.4 5.41z" fill="#b179f1"/><path transform="translate(0 -.25)" d="M68.89 95.6a6 6 0 003.93-.44l19.78-9.51a6 6 0 003.4-5.41V15.76a6 6 0 00-3.4-5.41L72.82.84a6 6 0 00-4.48-.29A6 6 0 0066 2L34.12 37.26 15.5 22l-1.63-1.4a4 4 0 00-3.61-.83 2.55 2.55 0 00-.53.18L2.46 23A4 4 0 000 26.37v43.26A4 4 0 002.46 73l7.27 3a2.55 2.55 0 00.53.18 4 4 0 003.61-.83L15.5 74l18.62-15.26L66 94a6 6 0 002.89 1.6zM72 27.68L47.21 48 72 68.32zm-60 6.59L24.41 48 12 61.73z" fill="url(#1652546395)" fill-rule="evenodd" opacity=".25"/></g></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@@ -2,6 +2,7 @@ import { NgModule } from '@angular/core'
import { PlatformService, LogService, UpdaterService, DockingService, HostAppService, ThemesService, Platform, AppService, ConfigService, WIN_BUILD_FLUENT_BG_SUPPORTED, isWindowsBuild, HostWindowService, HotkeyProvider, ConfigProvider, FileProvider } from 'tabby-core'
import { TerminalColorSchemeProvider } from 'tabby-terminal'
import { SFTPContextMenuItemProvider, SSHProfileImporter, AutoPrivateKeyLocator } from 'tabby-ssh'
import { ShellProvider, UACService } from 'tabby-local'
import { auditTime } from 'rxjs'
import { HyperColorSchemes } from './colorSchemes'
@@ -14,10 +15,26 @@ import { ElectronHostWindow } from './services/hostWindow.service'
import { ElectronFileProvider } from './services/fileProvider.service'
import { ElectronHostAppService } from './services/hostApp.service'
import { ElectronService } from './services/electron.service'
import { DockMenuService } from './services/dockMenu.service'
import { ElectronHotkeyProvider } from './hotkeys'
import { ElectronConfigProvider } from './config'
import { EditSFTPContextMenu } from './sftpContextMenu'
import { OpenSSHImporter, PrivateKeyLocator, StaticFileImporter } from './sshImporters'
import { ElectronUACService } from './services/uac.service'
import { CmderShellProvider } from './shells/cmder'
import { Cygwin32ShellProvider } from './shells/cygwin32'
import { Cygwin64ShellProvider } from './shells/cygwin64'
import { GitBashShellProvider } from './shells/gitBash'
import { LinuxDefaultShellProvider } from './shells/linuxDefault'
import { MacOSDefaultShellProvider } from './shells/macDefault'
import { MSYS2ShellProvider } from './shells/msys2'
import { POSIXShellsProvider } from './shells/posix'
import { PowerShellCoreShellProvider } from './shells/powershellCore'
import { WindowsDefaultShellProvider } from './shells/winDefault'
import { WindowsStockShellsProvider } from './shells/windowsStock'
import { WSLShellProvider } from './shells/wsl'
import { VSDevToolsProvider } from './shells/vs'
@NgModule({
providers: [
@@ -35,6 +52,27 @@ import { OpenSSHImporter, PrivateKeyLocator, StaticFileImporter } from './sshImp
{ provide: SSHProfileImporter, useExisting: OpenSSHImporter, multi: true },
{ provide: SSHProfileImporter, useExisting: StaticFileImporter, multi: true },
{ provide: AutoPrivateKeyLocator, useExisting: PrivateKeyLocator, multi: true },
{ provide: ShellProvider, useClass: WindowsDefaultShellProvider, multi: true },
{ provide: ShellProvider, useClass: MacOSDefaultShellProvider, multi: true },
{ provide: ShellProvider, useClass: LinuxDefaultShellProvider, multi: true },
{ provide: ShellProvider, useClass: WindowsStockShellsProvider, multi: true },
{ provide: ShellProvider, useClass: PowerShellCoreShellProvider, multi: true },
{ provide: ShellProvider, useClass: CmderShellProvider, multi: true },
{ provide: ShellProvider, useClass: Cygwin32ShellProvider, multi: true },
{ provide: ShellProvider, useClass: Cygwin64ShellProvider, multi: true },
{ provide: ShellProvider, useClass: GitBashShellProvider, multi: true },
{ provide: ShellProvider, useClass: POSIXShellsProvider, multi: true },
{ provide: ShellProvider, useClass: MSYS2ShellProvider, multi: true },
{ provide: ShellProvider, useClass: WSLShellProvider, multi: true },
{ provide: ShellProvider, useClass: VSDevToolsProvider, multi: true },
{ provide: UACService, useClass: ElectronUACService },
// For WindowsDefaultShellProvider
PowerShellCoreShellProvider,
WSLShellProvider,
WindowsStockShellsProvider,
],
})
export default class ElectronModule {
@@ -47,6 +85,7 @@ export default class ElectronModule {
docking: DockingService,
themeService: ThemesService,
app: AppService,
dockMenu: DockMenuService,
) {
config.ready$.toPromise().then(() => {
touchbar.update()
@@ -87,6 +126,10 @@ export default class ElectronModule {
})
config.changed$.subscribe(() => this.updateVibrancy())
config.ready$.toPromise().then(() => {
dockMenu.update()
})
}
private registerGlobalHotkey () {

View File

@@ -0,0 +1,69 @@
import { NgZone, Injectable } from '@angular/core'
import { ConfigService, HostAppService, Platform, ProfilesService, TranslateService } from 'tabby-core'
import { ElectronService } from './electron.service'
/** @hidden */
@Injectable({ providedIn: 'root' })
export class DockMenuService {
appVersion: string
private constructor (
config: ConfigService,
private electron: ElectronService,
private hostApp: HostAppService,
private zone: NgZone,
private profilesService: ProfilesService,
private translate: TranslateService,
) {
config.changed$.subscribe(() => this.update())
}
async update (): Promise<void> {
const profiles = await this.profilesService.getProfiles()
if (this.hostApp.platform === Platform.Windows) {
this.electron.app.setJumpList([
{
type: 'custom',
name: this.translate.instant('Recent'),
items: this.profilesService.getRecentProfiles().map((profile, index) => ({
type: 'task',
program: process.execPath,
args: `recent ${index}`,
title: profile.name,
iconPath: process.execPath,
iconIndex: 0,
})),
},
{
type: 'custom',
name: this.translate.instant('Profiles'),
items: profiles.map(profile => ({
type: 'task',
program: process.execPath,
args: `profile "${profile.name}"`,
title: profile.name,
iconPath: process.execPath,
iconIndex: 0,
})),
},
])
}
if (this.hostApp.platform === Platform.macOS) {
this.electron.app.dock.setMenu(this.electron.Menu.buildFromTemplate(
[
...[...this.profilesService.getRecentProfiles(), ...profiles].map(profile => ({
label: profile.name,
click: () => this.zone.run(async () => {
this.profilesService.openNewTabForProfile(profile)
}),
})),
{
label: this.translate.instant('New Window'),
click: () => this.zone.run(() => this.hostApp.newWindow()),
},
],
))
}
}
}

View File

@@ -234,6 +234,15 @@ export class ElectronPlatformService extends PlatformService {
handler(err)
})
}
async pickDirectory (): Promise<string> {
return (await this.electron.dialog.showOpenDialog(
this.hostWindow.getWindow(),
{
properties: ['openDirectory', 'showHiddenFiles'],
},
)).filePaths[0]
}
}
class ElectronFileUpload extends FileUpload {

View File

@@ -0,0 +1,39 @@
import { Injectable } from '@angular/core'
import * as path from 'path'
import { WIN_BUILD_CONPTY_SUPPORTED, isWindowsBuild } from 'tabby-core'
import { SessionOptions, UACService } from 'tabby-local'
import { ElectronService } from './electron.service'
/** @hidden */
@Injectable()
export class ElectronUACService extends UACService {
constructor (
private electron: ElectronService,
) {
super()
this.isAvailable = isWindowsBuild(WIN_BUILD_CONPTY_SUPPORTED)
}
patchSessionOptionsForUAC (sessionOptions: SessionOptions): SessionOptions {
let helperPath = path.join(
path.dirname(this.electron.app.getPath('exe')),
'resources',
'extras',
'UAC.exe',
)
if (process.env.TABBY_DEV) {
helperPath = path.join(
path.dirname(this.electron.app.getPath('exe')),
'..', '..', '..',
'extras',
'UAC.exe',
)
}
const options = { ...sessionOptions }
options.args = [options.command, ...options.args ?? []]
options.command = helperPath
return options
}
}

View File

@@ -0,0 +1,57 @@
import * as path from 'path'
import { Injectable } from '@angular/core'
import { HostAppService, Platform } from 'tabby-core'
import { ShellProvider, Shell } from 'tabby-local'
/** @hidden */
@Injectable()
export class CmderShellProvider extends ShellProvider {
constructor (
private hostApp: HostAppService,
) {
super()
}
async provide (): Promise<Shell[]> {
if (this.hostApp.platform !== Platform.Windows) {
return []
}
if (!process.env.CMDER_ROOT) {
return []
}
return [
{
id: 'cmder',
name: 'Cmder',
command: 'cmd.exe',
args: [
'/k',
path.join(process.env.CMDER_ROOT, 'vendor', 'init.bat'),
],
icon: require('../icons/cmder.svg'),
env: {
TERM: 'cygwin',
},
},
{
id: 'cmderps',
name: 'Cmder PowerShell',
command: 'powershell.exe',
args: [
'-ExecutionPolicy',
'Bypass',
'-nologo',
'-noprofile',
'-noexit',
'-command',
`Invoke-Expression '. ''${path.join(process.env.CMDER_ROOT, 'vendor', 'profile.ps1')}'''`,
],
icon: require('../icons/cmder-powershell.svg'),
env: {},
},
]
}
}

View File

@@ -0,0 +1,44 @@
import * as path from 'path'
import { Injectable } from '@angular/core'
import { HostAppService, Platform } from 'tabby-core'
import { ShellProvider, Shell } from 'tabby-local'
/* eslint-disable block-scoped-var */
try {
var wnr = require('windows-native-registry') // eslint-disable-line @typescript-eslint/no-var-requires, no-var
} catch { }
/** @hidden */
@Injectable()
export class Cygwin32ShellProvider extends ShellProvider {
constructor (
private hostApp: HostAppService,
) {
super()
}
async provide (): Promise<Shell[]> {
if (this.hostApp.platform !== Platform.Windows) {
return []
}
const cygwinPath = wnr.getRegistryValue(wnr.HK.LM, 'Software\\WOW6432Node\\Cygwin\\setup', 'rootdir')
if (!cygwinPath) {
return []
}
return [{
id: 'cygwin32',
name: 'Cygwin (32 bit)',
command: path.join(cygwinPath, 'bin', 'bash.exe'),
args: ['--login', '-i'],
icon: require('../icons/cygwin.svg'),
env: {
TERM: 'cygwin',
},
}]
}
}

View File

@@ -0,0 +1,44 @@
import * as path from 'path'
import { Injectable } from '@angular/core'
import { HostAppService, Platform } from 'tabby-core'
import { ShellProvider, Shell } from 'tabby-local'
/* eslint-disable block-scoped-var */
try {
var wnr = require('windows-native-registry') // eslint-disable-line @typescript-eslint/no-var-requires, no-var
} catch { }
/** @hidden */
@Injectable()
export class Cygwin64ShellProvider extends ShellProvider {
constructor (
private hostApp: HostAppService,
) {
super()
}
async provide (): Promise<Shell[]> {
if (this.hostApp.platform !== Platform.Windows) {
return []
}
const cygwinPath = wnr.getRegistryValue(wnr.HK.LM, 'Software\\Cygwin\\setup', 'rootdir')
if (!cygwinPath) {
return []
}
return [{
id: 'cygwin64',
name: 'Cygwin',
command: path.join(cygwinPath, 'bin', 'bash.exe'),
args: ['--login', '-i'],
icon: require('../icons/cygwin.svg'),
env: {
TERM: 'cygwin',
},
}]
}
}

View File

@@ -0,0 +1,49 @@
import * as path from 'path'
import { Injectable } from '@angular/core'
import { Platform, ConfigService, HostAppService } from 'tabby-core'
import { Shell } from 'tabby-local'
import { WindowsBaseShellProvider } from './windowsBase'
/* eslint-disable block-scoped-var */
try {
var wnr = require('windows-native-registry') // eslint-disable-line @typescript-eslint/no-var-requires, no-var
} catch { }
/** @hidden */
@Injectable()
export class GitBashShellProvider extends WindowsBaseShellProvider {
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
constructor (
hostApp: HostAppService,
config: ConfigService,
) {
super(hostApp, config)
}
async provide (): Promise<Shell[]> {
if (this.hostApp.platform !== Platform.Windows) {
return []
}
let gitBashPath = wnr.getRegistryValue(wnr.HK.LM, 'Software\\GitForWindows', 'InstallPath')
if (!gitBashPath) {
gitBashPath = wnr.getRegistryValue(wnr.HK.CU, 'Software\\GitForWindows', 'InstallPath')
}
if (!gitBashPath) {
return []
}
return [{
id: 'git-bash',
name: 'Git Bash',
command: path.join(gitBashPath, 'bin', 'bash.exe'),
args: ['--login', '-i'],
icon: require('../icons/git-bash.svg'),
env: this.getEnvironment(),
}]
}
}

View File

@@ -0,0 +1,46 @@
import * as fs from 'mz/fs'
import { Injectable } from '@angular/core'
import { HostAppService, Platform, LogService, Logger, TranslateService } from 'tabby-core'
import { ShellProvider, Shell } from 'tabby-local'
/** @hidden */
@Injectable()
export class LinuxDefaultShellProvider extends ShellProvider {
private logger: Logger
constructor (
private hostApp: HostAppService,
private translate: TranslateService,
log: LogService,
) {
super()
this.logger = log.create('linuxDefaultShell')
}
async provide (): Promise<Shell[]> {
if (this.hostApp.platform !== Platform.Linux) {
return []
}
const line = (await fs.readFile('/etc/passwd', { encoding: 'utf-8' }))
.split('\n').find(x => x.startsWith(`${process.env.LOGNAME}:`))
if (!line) {
this.logger.warn('Could not detect user shell')
return [{
id: 'default',
name: this.translate.instant('User default'),
command: '/bin/sh',
env: {},
}]
} else {
return [{
id: 'default',
name: this.translate.instant('User default'),
command: line.split(':')[6],
args: ['--login'],
hidden: true,
env: {},
}]
}
}
}

View File

@@ -0,0 +1,44 @@
import { Injectable } from '@angular/core'
import promiseIpc, { RendererProcessType } from 'electron-promise-ipc'
import { HostAppService, Platform, TranslateService } from 'tabby-core'
import { ShellProvider, Shell } from 'tabby-local'
/** @hidden */
@Injectable()
export class MacOSDefaultShellProvider extends ShellProvider {
private cachedShell?: string
constructor (
private hostApp: HostAppService,
private translate: TranslateService,
) {
super()
}
async provide (): Promise<Shell[]> {
if (this.hostApp.platform !== Platform.macOS) {
return []
}
return [{
id: 'default',
name: this.translate.instant('OS default'),
command: await this.getDefaultShellCached(),
args: ['--login'],
hidden: true,
env: {},
}]
}
private async getDefaultShellCached () {
if (!this.cachedShell) {
this.cachedShell = await this.getDefaultShell()
}
return this.cachedShell
}
private async getDefaultShell (): Promise<string> {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
return (promiseIpc as RendererProcessType).send('get-default-mac-shell') as Promise<string>
}
}

View File

@@ -0,0 +1,48 @@
import * as fs from 'fs/promises'
import * as path from 'path'
import { Injectable } from '@angular/core'
import { HostAppService, Platform } from 'tabby-core'
import { ShellProvider, Shell } from 'tabby-local'
/** @hidden */
@Injectable()
export class MSYS2ShellProvider extends ShellProvider {
constructor (
private hostApp: HostAppService,
) {
super()
}
async provide (): Promise<Shell[]> {
if (this.hostApp.platform !== Platform.Windows) {
return []
}
const msys2Path = path.resolve(process.env.SystemRoot ?? 'C:\\Windows', '../msys64')
try {
await fs.access(msys2Path)
} catch {
return []
}
let homePath: string|undefined = path.resolve(msys2Path, 'home', process.env.USERNAME!)
try {
await fs.access(msys2Path)
} catch {
homePath = undefined
}
const environments = ['msys', 'mingw64', 'clang64', 'ucrt64']
return environments.map(e => ({
id: `msys2-${e}`,
name: `MSYS2 (${e.toUpperCase()})`,
command: path.join(msys2Path, 'msys2_shell.cmd'),
args: ['-defterm', '-here', '-no-start', '-' + e],
icon: require('../icons/msys2.svg'),
env: {},
cwd: homePath,
}))
}
}

View File

@@ -0,0 +1,41 @@
import * as fs from 'mz/fs'
import slugify from 'slugify'
import { Injectable } from '@angular/core'
import { HostAppService, Platform } from 'tabby-core'
import { ShellProvider, Shell } from 'tabby-local'
/** @hidden */
@Injectable()
export class POSIXShellsProvider extends ShellProvider {
constructor (
private hostApp: HostAppService,
) {
super()
}
async provide (): Promise<Shell[]> {
if (this.hostApp.platform === Platform.Windows) {
return []
}
let shellListPath = '/etc/shells'
try {
await fs.stat(shellListPath)
} catch {
// Solus Linux
shellListPath = '/usr/share/defaults/etc/shells'
}
return (await fs.readFile(shellListPath, { encoding: 'utf-8' }))
.split('\n')
.map(x => x.trim())
.filter(x => x && !x.startsWith('#'))
.map(x => ({
id: slugify(x),
name: x.split('/').pop(),
icon: 'fas fa-terminal',
command: x,
args: ['-l'],
env: {},
}))
}
}

View File

@@ -0,0 +1,44 @@
import { Injectable } from '@angular/core'
import { HostAppService, ConfigService, Platform } from 'tabby-core'
import { Shell } from 'tabby-local'
import { WindowsBaseShellProvider } from './windowsBase'
/* eslint-disable block-scoped-var */
try {
var wnr = require('windows-native-registry') // eslint-disable-line @typescript-eslint/no-var-requires, no-var
} catch { }
/** @hidden */
@Injectable()
export class PowerShellCoreShellProvider extends WindowsBaseShellProvider {
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
constructor (
hostApp: HostAppService,
config: ConfigService,
) {
super(hostApp, config)
}
async provide (): Promise<Shell[]> {
if (this.hostApp.platform !== Platform.Windows) {
return []
}
const pwshPath = wnr.getRegistryValue(wnr.HK.LM, 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\pwsh.exe', '')
if (!pwshPath) {
return []
}
return [{
id: 'powershell-core',
name: 'PowerShell Core',
command: pwshPath,
args: ['-nologo'],
icon: require('../icons/powershell-core.svg'),
env: this.getEnvironment(),
}]
}
}

View File

@@ -0,0 +1,78 @@
import * as path from 'path'
import * as fs from 'fs/promises'
import { Injectable } from '@angular/core'
import { HostAppService, Platform } from 'tabby-core'
import { ShellProvider, Shell } from 'tabby-local'
/* eslint-disable quote-props */
const vsIconMap: Record<string, string> = {
'2017': require('../icons/vs2017.svg'),
'2019': require('../icons/vs2019.svg'),
'2022': require('../icons/vs2022.svg'),
}
/* eslint-enable quote-props */
/** @hidden */
@Injectable()
export class VSDevToolsProvider extends ShellProvider {
constructor (
private hostApp: HostAppService,
) {
super()
}
async provide (): Promise<Shell[]> {
if (this.hostApp.platform !== Platform.Windows) {
return []
}
const x86ParentPath = path.join(process.env['programfiles(x86)'] ?? 'C:\\Program Files (x86)', 'Microsoft Visual Studio')
const x64ParentPath = path.join(process.env['programfiles'] ?? 'C:\\Program Files', 'Microsoft Visual Studio')
const result: Shell[] = []
for (const parentPath of [x86ParentPath, x64ParentPath]) {
try {
await fs.stat(parentPath)
for (const version of await fs.readdir(parentPath)) {
const bat = path.join(parentPath, version, 'Community\\Common7\\Tools\\VsDevCmd.bat')
try {
await fs.stat(bat)
} catch {
continue
}
result.push({
id: `vs-cmd-${version}`,
name: `Developer Prompt for VS ${version}`,
command: 'cmd.exe',
args: ['/k', bat],
icon: vsIconMap[version],
env: {},
})
}
} catch (_) {
// Ignore
}
}
return result
// return [
// {
// id: 'cmderps',
// name: 'Cmder PowerShell',
// command: 'powershell.exe',
// args: [
// '-ExecutionPolicy',
// 'Bypass',
// '-nologo',
// '-noprofile',
// '-noexit',
// '-command',
// `Invoke-Expression '. ''${path.join(process.env.CMDER_ROOT, 'vendor', 'profile.ps1')}'''`,
// ],
// icon: require('../icons/cmder-powershell.svg'),
// env: {},
// },
// ]
}
}

View File

@@ -0,0 +1,51 @@
import { Injectable } from '@angular/core'
import { HostAppService, Platform, TranslateService } from 'tabby-core'
import { ShellProvider, Shell } from 'tabby-local'
import { WSLShellProvider } from './wsl'
import { PowerShellCoreShellProvider } from './powershellCore'
import { WindowsStockShellsProvider } from './windowsStock'
/** @hidden */
@Injectable()
export class WindowsDefaultShellProvider extends ShellProvider {
private providers: ShellProvider[]
constructor (
psc: PowerShellCoreShellProvider,
wsl: WSLShellProvider,
stock: WindowsStockShellsProvider,
private hostApp: HostAppService,
private translate: TranslateService,
) {
super()
this.providers = [
psc,
wsl,
stock,
]
}
async provide (): Promise<Shell[]> {
if (this.hostApp.platform !== Platform.Windows) {
return []
}
// Figure out a sensible default
const shellLists = await Promise.all(this.providers.map(x => x.provide()))
for (const list of shellLists) {
if (list.length) {
const shell = list[list.length - 1]
return [{
...shell,
id: 'default',
name: this.translate.instant('OS default ({name})', shell),
hidden: true,
}]
}
}
return []
}
}

View File

@@ -0,0 +1,23 @@
import { ConfigService, HostAppService } from 'tabby-core'
import { ShellProvider } from 'tabby-local'
export abstract class WindowsBaseShellProvider extends ShellProvider {
constructor (
protected hostApp: HostAppService,
protected config: ConfigService,
) {
super()
}
protected getEnvironment (): any {
return {
wt: {
WT_SESSION: 0,
},
cygwin: {
TERM: 'cygwin',
},
}[this.config.store.terminal.identification] ?? {}
}
}

View File

@@ -0,0 +1,93 @@
import * as path from 'path'
import * as fs from 'fs/promises'
import hasbin from 'hasbin'
import { Injectable } from '@angular/core'
import { HostAppService, Platform, ConfigService } from 'tabby-core'
import { ElectronService } from '../services/electron.service'
import { Shell } from 'tabby-local'
import { WindowsBaseShellProvider } from './windowsBase'
/** @hidden */
@Injectable()
export class WindowsStockShellsProvider extends WindowsBaseShellProvider {
constructor (
hostApp: HostAppService,
config: ConfigService,
private electron: ElectronService,
) {
super(hostApp, config)
}
async provide (): Promise<Shell[]> {
if (this.hostApp.platform !== Platform.Windows) {
return []
}
let clinkPath = path.join(
path.dirname(this.electron.app.getPath('exe')),
'resources',
'extras',
'clink',
`clink_${process.arch}.exe`,
)
if (process.env.TABBY_DEV) {
clinkPath = path.join(
path.dirname(this.electron.app.getPath('exe')),
'..', '..', '..',
'extras',
'clink',
`clink_${process.arch}.exe`,
)
}
return [
{
id: 'clink',
name: 'CMD (clink)',
command: 'cmd.exe',
args: ['/k', clinkPath, 'inject'],
env: {
// Tell clink not to emulate ANSI handling
WT_SESSION: '0',
},
icon: require('../icons/clink.svg'),
},
{
id: 'cmd',
name: 'CMD (stock)',
command: 'cmd.exe',
env: {},
icon: require('../icons/cmd.svg'),
},
{
id: 'powershell',
name: 'PowerShell',
command: await this.getPowerShellPath(),
args: ['-nologo'],
icon: require('../icons/powershell.svg'),
env: this.getEnvironment(),
},
]
}
private async getPowerShellPath () {
for (const name of ['pwsh.exe', 'powershell.exe']) {
if (await new Promise(resolve => hasbin(name, resolve))) {
return name
}
}
for (const psPath of [
`${process.env.USERPROFILE}\\AppData\\Local\\Microsoft\\WindowsApps\\pwsh.exe`,
`${process.env.SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`,
`${process.env.SystemRoot}\\System32\\powershell.exe`,
(process.env.SystemRoot ?? 'C:\\Windows') + '\\powerhshell.exe',
]) {
try {
await fs.stat(psPath)
return psPath
} catch { }
}
return 'powershell.exe'
}
}

View File

@@ -0,0 +1,120 @@
import * as fs from 'mz/fs'
import slugify from 'slugify'
import { Injectable } from '@angular/core'
import { HostAppService, Platform, isWindowsBuild, WIN_BUILD_WSL_EXE_DISTRO_FLAG } from 'tabby-core'
import { ShellProvider, Shell } from 'tabby-local'
/* eslint-disable block-scoped-var */
try {
var wnr = require('windows-native-registry') // eslint-disable-line @typescript-eslint/no-var-requires, no-var
} catch { }
// WSL Distribution List
// https://docs.microsoft.com/en-us/windows/wsl/install-win10#install-your-linux-distribution-of-choice
/* eslint-disable quote-props */
const wslIconMap: Record<string, string> = {
'Alpine': require('../icons/alpine.svg'),
'Debian': require('../icons/debian.svg'),
'kali-linux': require('../icons/kali.svg'),
'SLES-12': require('../icons/suse.svg'),
'openSUSE-Leap-15-1': require('../icons/suse.svg'),
'Ubuntu-16.04': require('../icons/ubuntu.svg'),
'Ubuntu-18.04': require('../icons/ubuntu.svg'),
'Ubuntu-22.04': require('../icons/ubuntu.svg'),
'Ubuntu': require('../icons/ubuntu.svg'),
'AlmaLinux-8': require('../icons/alma.svg'),
'OracleLinux_7_9': require('../icons/oracle-linux.svg'),
'OracleLinux_8_5': require('../icons/oracle-linux.svg'),
'openEuler': require('../icons/open-euler.svg'),
'Linux': require('../icons/linux.svg'),
'docker-desktop': require('../icons/docker.svg'),
'docker-desktop-data': require('../icons/docker.svg'),
}
/* eslint-enable quote-props */
/** @hidden */
@Injectable()
export class WSLShellProvider extends ShellProvider {
constructor (
private hostApp: HostAppService,
) {
super()
}
async provide (): Promise<Shell[]> {
if (this.hostApp.platform !== Platform.Windows) {
return []
}
const bashPath = `${process.env.windir}\\system32\\bash.exe`
const wslPath = `${process.env.windir}\\system32\\wsl.exe`
const lxssPath = 'Software\\Microsoft\\Windows\\CurrentVersion\\Lxss'
const lxss = wnr.getRegistryKey(wnr.HK.CU, lxssPath)
const shells: Shell[] = []
if (lxss?.DefaultDistribution) {
const defaultDistKey = wnr.getRegistryKey(wnr.HK.CU, lxssPath + '\\' + String(lxss.DefaultDistribution.value))
if (defaultDistKey?.DistributionName) {
const shell: Shell = {
id: 'wsl',
name: 'WSL / Default distro',
command: wslPath,
env: {
TERM: 'xterm-color',
COLORTERM: 'truecolor',
},
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
icon: wslIconMap[defaultDistKey.DistributionName.value] ?? wslIconMap.Linux,
}
shells.push(shell)
}
}
if (!lxss?.DefaultDistribution || !isWindowsBuild(WIN_BUILD_WSL_EXE_DISTRO_FLAG)) {
if (await fs.exists(bashPath)) {
return [{
id: 'wsl',
name: 'WSL / Bash on Windows',
icon: wslIconMap.Linux,
command: bashPath,
env: {
TERM: 'xterm-color',
COLORTERM: 'truecolor',
},
}]
} else {
return []
}
}
for (const child of wnr.listRegistrySubkeys(wnr.HK.CU, lxssPath) as string[]) {
const childKey = wnr.getRegistryKey(wnr.HK.CU, lxssPath + '\\' + child)
if (!childKey.DistributionName || !childKey.BasePath) {
continue
}
const wslVersion = (childKey.Flags?.value || 0) & 8 ? 2 : 1
const name = childKey.DistributionName.value
const fsBase = wslVersion === 2 ? `\\\\wsl$\\${name}` : childKey.BasePath.value as string + '\\rootfs'
const slug = slugify(name, { remove: /[:.]/g })
const shell: Shell = {
id: `wsl-${slug}`,
name: `WSL / ${name}`,
command: wslPath,
args: ['-d', name],
fsBase,
env: {
TERM: 'xterm-color',
COLORTERM: 'truecolor',
},
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
icon: wslIconMap[name] ?? wslIconMap.Linux,
}
shells.push(shell)
}
return shells
}
}

View File

@@ -21,6 +21,11 @@ async@^3.2.3:
resolved "https://registry.yarnpkg.com/async/-/async-3.2.3.tgz#ac53dafd3f4720ee9e8a160628f18ea91df196c9"
integrity sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==
async@~1.5:
version "1.5.2"
resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"
integrity sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==
balanced-match@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
@@ -199,6 +204,13 @@ has@^1.0.3:
dependencies:
function-bind "^1.1.1"
hasbin@^1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/hasbin/-/hasbin-1.2.3.tgz#78c5926893c80215c2b568ae1fd3fcab7a2696b0"
integrity sha512-CCd8e/w2w28G8DyZvKgiHnQJ/5XXDz6qiUHnthvtag/6T5acUeN5lqq+HMoBqcmgWueWDhiCplrw0Kb1zDACRg==
dependencies:
async "~1.5"
inflight@^1.0.4:
version "1.0.6"
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"