termdock 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +385 -0
- package/dist/client/apple-splash-default-1170x2532.png +0 -0
- package/dist/client/apple-splash-landscape-1136x640.png +0 -0
- package/dist/client/apple-splash-landscape-1334x750.png +0 -0
- package/dist/client/apple-splash-landscape-1792x828.png +0 -0
- package/dist/client/apple-splash-landscape-2048x1536.png +0 -0
- package/dist/client/apple-splash-landscape-2160x1620.png +0 -0
- package/dist/client/apple-splash-landscape-2208x1242.png +0 -0
- package/dist/client/apple-splash-landscape-2224x1668.png +0 -0
- package/dist/client/apple-splash-landscape-2266x1488.png +0 -0
- package/dist/client/apple-splash-landscape-2360x1640.png +0 -0
- package/dist/client/apple-splash-landscape-2388x1668.png +0 -0
- package/dist/client/apple-splash-landscape-2436x1125.png +0 -0
- package/dist/client/apple-splash-landscape-2532x1170.png +0 -0
- package/dist/client/apple-splash-landscape-2556x1179.png +0 -0
- package/dist/client/apple-splash-landscape-2622x1206.png +0 -0
- package/dist/client/apple-splash-landscape-2688x1242.png +0 -0
- package/dist/client/apple-splash-landscape-2732x2048.png +0 -0
- package/dist/client/apple-splash-landscape-2778x1284.png +0 -0
- package/dist/client/apple-splash-landscape-2796x1290.png +0 -0
- package/dist/client/apple-splash-landscape-2868x1320.png +0 -0
- package/dist/client/apple-splash-portrait-1125x2436.png +0 -0
- package/dist/client/apple-splash-portrait-1170x2532.png +0 -0
- package/dist/client/apple-splash-portrait-1179x2556.png +0 -0
- package/dist/client/apple-splash-portrait-1206x2622.png +0 -0
- package/dist/client/apple-splash-portrait-1242x2208.png +0 -0
- package/dist/client/apple-splash-portrait-1242x2688.png +0 -0
- package/dist/client/apple-splash-portrait-1284x2778.png +0 -0
- package/dist/client/apple-splash-portrait-1290x2796.png +0 -0
- package/dist/client/apple-splash-portrait-1320x2868.png +0 -0
- package/dist/client/apple-splash-portrait-1488x2266.png +0 -0
- package/dist/client/apple-splash-portrait-1536x2048.png +0 -0
- package/dist/client/apple-splash-portrait-1620x2160.png +0 -0
- package/dist/client/apple-splash-portrait-1640x2360.png +0 -0
- package/dist/client/apple-splash-portrait-1668x2224.png +0 -0
- package/dist/client/apple-splash-portrait-1668x2388.png +0 -0
- package/dist/client/apple-splash-portrait-2048x2732.png +0 -0
- package/dist/client/apple-splash-portrait-640x1136.png +0 -0
- package/dist/client/apple-splash-portrait-750x1334.png +0 -0
- package/dist/client/apple-splash-portrait-828x1792.png +0 -0
- package/dist/client/apple-touch-icon-180x180.png +0 -0
- package/dist/client/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/client/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/client/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/client/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/client/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/client/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/client/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/client/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/client/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/client/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/client/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/client/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/client/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/client/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/client/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/client/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/client/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/client/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/client/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/client/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/client/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/client/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/client/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/client/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/client/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/client/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/client/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/client/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/client/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/client/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/client/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/client/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/client/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/client/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/client/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/client/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/client/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/client/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/client/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/client/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/client/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/client/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/client/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/client/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/client/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/client/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/client/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/client/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/client/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/client/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/client/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/client/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/client/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/client/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/client/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/client/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/client/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/client/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/client/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/client/assets/abnfDiagram-VRR7QNED-D0NxeSHA.js +1 -0
- package/dist/client/assets/arc-B7GoKc6u.js +1 -0
- package/dist/client/assets/architectureDiagram-ZJ3FMSHR-BQPW-wUx.js +36 -0
- package/dist/client/assets/blockDiagram-677ZJIJ3-CX_hbcgG.js +132 -0
- package/dist/client/assets/c4Diagram-LMCZKHZV-BwOMQA4x.js +10 -0
- package/dist/client/assets/channel-C2gUFcyU.js +1 -0
- package/dist/client/assets/chunk-2Q5K7J3B-BLJzEQXz.js +1 -0
- package/dist/client/assets/chunk-32BRIVSS-CjBDr_gz.js +1 -0
- package/dist/client/assets/chunk-5VM5RSS4-lddvv0x2.js +15 -0
- package/dist/client/assets/chunk-EX3LRPZG-Dtsq1Stg.js +231 -0
- package/dist/client/assets/chunk-JWPE2WC7-BG3PZx4j.js +1 -0
- package/dist/client/assets/chunk-MOJQB5TN-CMtlCuQg.js +88 -0
- package/dist/client/assets/chunk-RYQCIY6F-uplKqw64.js +1 -0
- package/dist/client/assets/chunk-V7JOEXUC-CpteLsY3.js +206 -0
- package/dist/client/assets/chunk-VR4S4FIN-1zYOJQXL.js +1 -0
- package/dist/client/assets/chunk-XXDRQBXY-C0wXH91I.js +1 -0
- package/dist/client/assets/classDiagram-OUVF2IWQ-BTOnA9HS.js +1 -0
- package/dist/client/assets/classDiagram-v2-EOCWNBFH-BTOnA9HS.js +1 -0
- package/dist/client/assets/cose-bilkent-JH36ORCC-BceT5ki2.js +1 -0
- package/dist/client/assets/cynefin-VYW2F7L2-BqCIkNeC.js +166 -0
- package/dist/client/assets/cynefinDiagram-TSTJHNR4-Dm7y-tsN.js +62 -0
- package/dist/client/assets/cytoscape.esm-D3_iZ_3b.js +321 -0
- package/dist/client/assets/dagre-VKFMJZFB-Bn8eh0lE.js +4 -0
- package/dist/client/assets/defaultLocale-CrowFXzY.js +1 -0
- package/dist/client/assets/diagram-FQU43EPY-DmZGMAsX.js +3 -0
- package/dist/client/assets/diagram-G47NLZAW-BLWSm_Rn.js +24 -0
- package/dist/client/assets/diagram-NH7WQ7WH-C2-HK8pv.js +24 -0
- package/dist/client/assets/diagram-OA4YK3LP-8Ex4XIU5.js +30 -0
- package/dist/client/assets/diagram-WEI45ONY-MRNIpBXG.js +41 -0
- package/dist/client/assets/diffWorker-B6msVyjo.js +18 -0
- package/dist/client/assets/dnd-BCFAPC0L.js +1 -0
- package/dist/client/assets/ebnfDiagram-CCIWWBDH-D7Z6wZi_.js +1 -0
- package/dist/client/assets/erDiagram-Q63AITRT-C96Q5x9y.js +85 -0
- package/dist/client/assets/flowDiagram-23GEKE2U-DzQp40QH.js +156 -0
- package/dist/client/assets/ganttDiagram-NO4QXBWP-ZzkchZJ8.js +292 -0
- package/dist/client/assets/gitGraphDiagram-IHSO6WYX-CFacEf54.js +106 -0
- package/dist/client/assets/graph-D2o_JWn5.js +1 -0
- package/dist/client/assets/index-Ca-rq7yX.js +6 -0
- package/dist/client/assets/index-Cv7q4nZR.css +1 -0
- package/dist/client/assets/index-XktPMm51.js +394 -0
- package/dist/client/assets/infoDiagram-FWYZ7A6U-CVRXs5rF.js +2 -0
- package/dist/client/assets/init-Gi6I4Gst.js +1 -0
- package/dist/client/assets/ishikawaDiagram-FXEZZL3T-B8FP_wzM.js +70 -0
- package/dist/client/assets/journeyDiagram-5HDEW3XC-BR__4Hbd.js +139 -0
- package/dist/client/assets/kanban-definition-HUTT4EX6-v39oZe6X.js +89 -0
- package/dist/client/assets/katex-55ZPZeOF.css +1 -0
- package/dist/client/assets/katex-DnlPpQZa.js +257 -0
- package/dist/client/assets/katex-HP8lGamR.js +257 -0
- package/dist/client/assets/layout-1eBIAoSl.js +1 -0
- package/dist/client/assets/linear-jlTiHqO6.js +1 -0
- package/dist/client/assets/map-BdqsVdb3.js +1 -0
- package/dist/client/assets/mermaid.core-DiiIN0EC.js +306 -0
- package/dist/client/assets/mindmap-definition-LN4V7U3C-AeUxAZeq.js +96 -0
- package/dist/client/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/client/assets/pegDiagram-2B236MQR-Dh-bgAbv.js +1 -0
- package/dist/client/assets/pieDiagram-ENE6RG2P-De7Si7Tm.js +39 -0
- package/dist/client/assets/purify.es-CC4Brkr_.js +3 -0
- package/dist/client/assets/quadrantDiagram-ABIIQ3AL-CgWfHqy0.js +7 -0
- package/dist/client/assets/railroadDiagram-RFXS5EU6-BXnQW-pI.js +1 -0
- package/dist/client/assets/react-XDCjal2T.js +8 -0
- package/dist/client/assets/requirementDiagram-TGXJPOKE-CU1nnpUM.js +84 -0
- package/dist/client/assets/sankeyDiagram-HTMAVEWB-DFK-AXY6.js +40 -0
- package/dist/client/assets/sequenceDiagram-DBY2YBRQ-D_bVDWgq.js +162 -0
- package/dist/client/assets/sizeCapture-X5ZJPWSS-nh89ExHT.js +1 -0
- package/dist/client/assets/stateDiagram-2N3HPSRC-DUvT6Ruk.js +1 -0
- package/dist/client/assets/stateDiagram-v2-6OUMAXLB-Dz-3r-Yq.js +1 -0
- package/dist/client/assets/swimlanes-5IMT3BWC-ZYa52gjG.js +2 -0
- package/dist/client/assets/swimlanesDiagram-G3AALYLV-DXR_9lf9.js +8 -0
- package/dist/client/assets/terminal-C7X98Amf.js +10 -0
- package/dist/client/assets/timeline-definition-FHXFAJF6-Bp6A49KQ.js +120 -0
- package/dist/client/assets/vennDiagram-L72KCM5P-CDDUmLOI.js +34 -0
- package/dist/client/assets/wardleyDiagram-EHGQE667-CRc2ptu7.js +78 -0
- package/dist/client/assets/xychartDiagram-FW5EYKEG-ht_S0LUA.js +7 -0
- package/dist/client/favicon.ico +0 -0
- package/dist/client/fonts/JetBrainsMonoNL-Bold.woff2 +0 -0
- package/dist/client/fonts/JetBrainsMonoNL-BoldItalic.woff2 +0 -0
- package/dist/client/fonts/JetBrainsMonoNL-Italic.woff2 +0 -0
- package/dist/client/fonts/JetBrainsMonoNL-Regular.woff2 +0 -0
- package/dist/client/fonts/JetBrainsMonoNLNerdFontMono-Bold.ttf +0 -0
- package/dist/client/fonts/JetBrainsMonoNLNerdFontMono-BoldItalic.ttf +0 -0
- package/dist/client/fonts/JetBrainsMonoNLNerdFontMono-Italic.ttf +0 -0
- package/dist/client/fonts/JetBrainsMonoNLNerdFontMono-Regular.ttf +0 -0
- package/dist/client/fonts/NotoSansMonoCJKsc-Bold-Subset.woff2 +0 -0
- package/dist/client/fonts/NotoSansMonoCJKsc-Subset.woff2 +0 -0
- package/dist/client/fonts/NotoSansSymbols2-Subset.woff2 +0 -0
- package/dist/client/fonts/SymbolsNerdFontMono-Regular.woff2 +0 -0
- package/dist/client/fonts/TermdockStarSymbol-Subset.woff2 +0 -0
- package/dist/client/index.html +255 -0
- package/dist/client/manifest.webmanifest +1 -0
- package/dist/client/maskable-icon-512x512.png +0 -0
- package/dist/client/pwa-192x192.png +0 -0
- package/dist/client/pwa-192x192.svg +5 -0
- package/dist/client/pwa-512x512.png +0 -0
- package/dist/client/pwa-512x512.svg +5 -0
- package/dist/client/pwa-64x64.png +0 -0
- package/dist/client/registerSW.js +1 -0
- package/dist/client/robots.txt +4 -0
- package/dist/client/shell-integration/termdock.bash +107 -0
- package/dist/client/shell-integration/termdock.fish +60 -0
- package/dist/client/shell-integration/termdock.zsh +164 -0
- package/dist/client/sw-notifications.js +42 -0
- package/dist/client/sw.js +1 -0
- package/dist/client/workbox-e4022e15.js +1 -0
- package/dist/server/certificateWatcher.js +111 -0
- package/dist/server/cli.js +2534 -0
- package/dist/server/config.js +54 -0
- package/dist/server/entry.js +571 -0
- package/dist/server/onboardingServer.js +54 -0
- package/dist/server/routes/auth.js +48 -0
- package/dist/server/routes/filesystem.js +3749 -0
- package/dist/server/routes/local.js +32 -0
- package/dist/server/routes/onboarding.js +134 -0
- package/dist/server/routes/terminal.js +4879 -0
- package/dist/server/utils/authProtection.js +338 -0
- package/dist/server/utils/caffeinate.js +124 -0
- package/dist/server/utils/changeAuditStore.js +521 -0
- package/dist/server/utils/cookieSecurity.js +13 -0
- package/dist/server/utils/csrfProtection.js +112 -0
- package/dist/server/utils/localAccess.js +211 -0
- package/dist/server/utils/pathValidator.js +272 -0
- package/dist/server/utils/requestSecurity.js +103 -0
- package/dist/server/utils/serverLogger.js +57 -0
- package/dist/server/utils/settings.js +157 -0
- package/dist/server/utils/tmuxFocus.js +45 -0
- package/dist/server/utils/tmuxProgramDetection.js +148 -0
- package/package.json +125 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" href="/favicon.ico" sizes="48x48" />
|
|
6
|
+
<link rel="icon" href="/pwa-512x512.svg" sizes="any" type="image/svg+xml" />
|
|
7
|
+
<link rel="manifest" href="/manifest.webmanifest" />
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover, interactive-widget=resizes-visual" />
|
|
9
|
+
<meta name="description" content="A complete web-based terminal application" />
|
|
10
|
+
<meta name="theme-color" content="#1C1B1A" />
|
|
11
|
+
<meta name="color-scheme" content="dark light" />
|
|
12
|
+
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
13
|
+
<meta name="mobile-web-app-capable" content="yes" />
|
|
14
|
+
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
|
15
|
+
<meta name="apple-mobile-web-app-title" content="Termdock" />
|
|
16
|
+
<link rel="apple-touch-icon" href="/apple-touch-icon-180x180.png" />
|
|
17
|
+
<link rel="apple-touch-startup-image" href="/apple-splash-default-1170x2532.png" />
|
|
18
|
+
<link rel="apple-touch-startup-image" media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/apple-splash-portrait-1170x2532.png?v=2" />
|
|
19
|
+
<link rel="apple-touch-startup-image" media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/apple-splash-landscape-2532x1170.png?v=2" />
|
|
20
|
+
<link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/apple-splash-portrait-1125x2436.png?v=2" />
|
|
21
|
+
<link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/apple-splash-landscape-2436x1125.png?v=2" />
|
|
22
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-splash-portrait-2048x2732.png" />
|
|
23
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/apple-splash-landscape-2732x2048.png" />
|
|
24
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-splash-portrait-1668x2388.png" />
|
|
25
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/apple-splash-landscape-2388x1668.png" />
|
|
26
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-splash-portrait-1536x2048.png" />
|
|
27
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/apple-splash-landscape-2048x1536.png" />
|
|
28
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 820px) and (device-height: 1180px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-splash-portrait-1640x2360.png" />
|
|
29
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 820px) and (device-height: 1180px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/apple-splash-landscape-2360x1640.png" />
|
|
30
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-splash-portrait-1668x2224.png" />
|
|
31
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/apple-splash-landscape-2224x1668.png" />
|
|
32
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-splash-portrait-1620x2160.png" />
|
|
33
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/apple-splash-landscape-2160x1620.png" />
|
|
34
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 744px) and (device-height: 1133px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-splash-portrait-1488x2266.png" />
|
|
35
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 744px) and (device-height: 1133px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/apple-splash-landscape-2266x1488.png" />
|
|
36
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 440px) and (device-height: 956px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/apple-splash-portrait-1320x2868.png" />
|
|
37
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 440px) and (device-height: 956px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/apple-splash-landscape-2868x1320.png" />
|
|
38
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 402px) and (device-height: 874px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/apple-splash-portrait-1206x2622.png" />
|
|
39
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 402px) and (device-height: 874px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/apple-splash-landscape-2622x1206.png" />
|
|
40
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/apple-splash-portrait-1290x2796.png" />
|
|
41
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/apple-splash-landscape-2796x1290.png" />
|
|
42
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/apple-splash-portrait-1179x2556.png" />
|
|
43
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/apple-splash-landscape-2556x1179.png" />
|
|
44
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/apple-splash-portrait-1284x2778.png" />
|
|
45
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/apple-splash-landscape-2778x1284.png" />
|
|
46
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/apple-splash-portrait-1242x2688.png" />
|
|
47
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/apple-splash-landscape-2688x1242.png" />
|
|
48
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-splash-portrait-828x1792.png" />
|
|
49
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/apple-splash-landscape-1792x828.png" />
|
|
50
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)" href="/apple-splash-portrait-1242x2208.png" />
|
|
51
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: landscape)" href="/apple-splash-landscape-2208x1242.png" />
|
|
52
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-splash-portrait-750x1334.png" />
|
|
53
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/apple-splash-landscape-1334x750.png" />
|
|
54
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="/apple-splash-portrait-640x1136.png" />
|
|
55
|
+
<link rel="apple-touch-startup-image" media="screen and (device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="/apple-splash-landscape-1136x640.png" />
|
|
56
|
+
|
|
57
|
+
<style>
|
|
58
|
+
:root {
|
|
59
|
+
background: #1C1B1A;
|
|
60
|
+
color-scheme: dark light;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
html,
|
|
64
|
+
body,
|
|
65
|
+
#root {
|
|
66
|
+
margin: 0;
|
|
67
|
+
width: 100%;
|
|
68
|
+
height: 100%;
|
|
69
|
+
min-height: 100vh;
|
|
70
|
+
background: #1C1B1A;
|
|
71
|
+
color: #CECDC3;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
html[data-theme='light'],
|
|
75
|
+
html[data-theme='light'] body,
|
|
76
|
+
html[data-theme='light'] #root {
|
|
77
|
+
background: #FFFCF0;
|
|
78
|
+
color: #100F0F;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
html[data-theme='light'] {
|
|
82
|
+
color-scheme: light;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.termdock-boot {
|
|
86
|
+
position: fixed;
|
|
87
|
+
inset: 0;
|
|
88
|
+
display: flex;
|
|
89
|
+
align-items: center;
|
|
90
|
+
justify-content: center;
|
|
91
|
+
gap: 10px;
|
|
92
|
+
min-height: 240px;
|
|
93
|
+
padding: 24px;
|
|
94
|
+
box-sizing: border-box;
|
|
95
|
+
background: #1C1B1A;
|
|
96
|
+
color: #878580;
|
|
97
|
+
font: 14px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.termdock-boot-spinner {
|
|
101
|
+
width: 16px;
|
|
102
|
+
height: 16px;
|
|
103
|
+
border: 2px solid rgba(206, 205, 195, 0.18);
|
|
104
|
+
border-top-color: #879A39;
|
|
105
|
+
border-radius: 9999px;
|
|
106
|
+
animation: termdock-boot-spin 0.9s linear infinite;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.termdock-boot-error {
|
|
110
|
+
max-width: 28rem;
|
|
111
|
+
text-align: center;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@keyframes termdock-boot-spin {
|
|
115
|
+
to { transform: rotate(360deg); }
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
</style>
|
|
119
|
+
<title>Termdock</title>
|
|
120
|
+
|
|
121
|
+
<!-- Preload the unified terminal font pack. First paint may wait for these,
|
|
122
|
+
but PWA/cache hits keep later launches and new sessions stable. -->
|
|
123
|
+
<link rel="preload" href="/fonts/JetBrainsMonoNLNerdFontMono-Regular.ttf" as="font" type="font/ttf" crossorigin="anonymous">
|
|
124
|
+
<link rel="preload" href="/fonts/JetBrainsMonoNLNerdFontMono-Bold.ttf" as="font" type="font/ttf" crossorigin="anonymous">
|
|
125
|
+
<link rel="preload" href="/fonts/TermdockStarSymbol-Subset.woff2" as="font" type="font/woff2" crossorigin="anonymous">
|
|
126
|
+
|
|
127
|
+
<!-- Self-hosted terminal fonts.
|
|
128
|
+
统一原则:每个 @font-face 都用 unicode-range 限定字符集,浏览器只在
|
|
129
|
+
实际渲染到该区间时才下载,做到 "全字符覆盖 + 不浪费带宽"。
|
|
130
|
+
所有引用(Tailwind / 业务组件 / xterm)都通过 :root 上的 --font-mono
|
|
131
|
+
CSS 变量读取,单一来源见 src/index.css。 -->
|
|
132
|
+
<style>
|
|
133
|
+
/* JetBrains Mono NL Nerd Font Mono —— 终端主字体,保持 JetBrains
|
|
134
|
+
Mono NL 的无连字风格,同时内置 Nerd Font / Powerline / devicons。
|
|
135
|
+
使用 Mono 版本保证图标按终端 cell 设计;首屏强等字体,避免从
|
|
136
|
+
fallback/tofu 跳到完整图标。 */
|
|
137
|
+
@font-face {
|
|
138
|
+
font-family: 'Termdock Mono';
|
|
139
|
+
src: url('/fonts/JetBrainsMonoNLNerdFontMono-Regular.ttf') format('truetype');
|
|
140
|
+
font-weight: 400;
|
|
141
|
+
font-style: normal;
|
|
142
|
+
font-display: block;
|
|
143
|
+
}
|
|
144
|
+
@font-face {
|
|
145
|
+
font-family: 'Termdock Mono';
|
|
146
|
+
src: url('/fonts/JetBrainsMonoNLNerdFontMono-Bold.ttf') format('truetype');
|
|
147
|
+
font-weight: 700;
|
|
148
|
+
font-style: normal;
|
|
149
|
+
font-display: block;
|
|
150
|
+
}
|
|
151
|
+
@font-face {
|
|
152
|
+
font-family: 'Termdock Mono';
|
|
153
|
+
src: url('/fonts/JetBrainsMonoNLNerdFontMono-Italic.ttf') format('truetype');
|
|
154
|
+
font-weight: 400;
|
|
155
|
+
font-style: italic;
|
|
156
|
+
font-display: block;
|
|
157
|
+
}
|
|
158
|
+
@font-face {
|
|
159
|
+
font-family: 'Termdock Mono';
|
|
160
|
+
src: url('/fonts/JetBrainsMonoNLNerdFontMono-BoldItalic.ttf') format('truetype');
|
|
161
|
+
font-weight: 700;
|
|
162
|
+
font-style: italic;
|
|
163
|
+
font-display: block;
|
|
164
|
+
}
|
|
165
|
+
/* Termdock Star Symbol —— 从 Menlo Regular 抽取 U+2726/U+2727
|
|
166
|
+
(✦/✧) 的子集。Menlo 是 macOS 上这两个符号与等宽文本视觉大小
|
|
167
|
+
最接近的系统字形,避免手机端走系统符号 fallback 后偏大。
|
|
168
|
+
|
|
169
|
+
新增类似“桌面正常、手机偏大/偏小”的自维护符号时:
|
|
170
|
+
1. 先确认本机实际看起来正常的等宽字形来源,优先检查 Menlo:
|
|
171
|
+
fc-list ':charset=<hex>' file family style
|
|
172
|
+
fc-match -v 'Menlo:style=Regular:charset=<hex>'
|
|
173
|
+
2. 不要只信默认 fc-match。它可能返回 Arial Unicode MS,但 Chrome/
|
|
174
|
+
Safari 的 CoreText fallback 不一定等同于 fontconfig 默认结果。
|
|
175
|
+
3. 优先从 Menlo Regular 追加抽取字符到这份子集,并扩展下面的
|
|
176
|
+
unicode-range;避免用 size-adjust 硬调,否则不同设备又会偏大/偏小。
|
|
177
|
+
4. 同步更新 src/index.css 的字体链说明,以及 TerminalViewport.tsx 里的
|
|
178
|
+
TERMINAL_FONT_PRELOADS 文本,确保首帧不会先走系统 fallback。 */
|
|
179
|
+
@font-face {
|
|
180
|
+
font-family: 'Termdock Star Symbol';
|
|
181
|
+
src: url('/fonts/TermdockStarSymbol-Subset.woff2') format('woff2');
|
|
182
|
+
font-weight: 400;
|
|
183
|
+
font-style: normal;
|
|
184
|
+
font-display: swap;
|
|
185
|
+
unicode-range: U+2726, U+2727;
|
|
186
|
+
}
|
|
187
|
+
/* Noto Sans Symbols 2 —— 只补足 JetBrains Mono / Nerd Font 都未收录且
|
|
188
|
+
容易被 emoji / 系统符号字体抢走的少数字符:⏸⏹⏺ / ✓✗。
|
|
189
|
+
不覆盖整段 Dingbats,否则 ❖ 等装饰符号会命中 Noto 的大号字形,
|
|
190
|
+
在终端 cell 里显得过大。 */
|
|
191
|
+
@font-face {
|
|
192
|
+
font-family: 'Noto Sans Symbols 2';
|
|
193
|
+
src: url('/fonts/NotoSansSymbols2-Subset.woff2') format('woff2');
|
|
194
|
+
font-weight: 400;
|
|
195
|
+
font-style: normal;
|
|
196
|
+
font-display: swap;
|
|
197
|
+
unicode-range: U+23F8-23FA, U+2713, U+2717;
|
|
198
|
+
}
|
|
199
|
+
/* Noto Sans Mono CJK SC —— 自托管的等宽中日韩字体子集(GB2312 一级
|
|
200
|
+
常用字 + 中文标点 + 全角区),用于在终端 / UI 中正确渲染 CJK,
|
|
201
|
+
不依赖系统字体可用性。CJK 区由 unicode-range 守住,不会接管拉丁字。
|
|
202
|
+
U+3400-4DBF (CJK Ext A) 和 U+FE30-FE4F (CJK Compat Forms) 在子集
|
|
203
|
+
里为空,不声明,避免无谓的字体回退查找。
|
|
204
|
+
Regular + Bold 两种变体自托管,替代 xterm 合成 bold CJK。 */
|
|
205
|
+
@font-face {
|
|
206
|
+
font-family: 'Noto Sans Mono CJK SC';
|
|
207
|
+
src: url('/fonts/NotoSansMonoCJKsc-Subset.woff2') format('woff2');
|
|
208
|
+
font-weight: 400;
|
|
209
|
+
font-style: normal;
|
|
210
|
+
font-display: swap;
|
|
211
|
+
unicode-range: U+3000-303F, U+4E00-9FFF, U+FF00-FFEF;
|
|
212
|
+
}
|
|
213
|
+
@font-face {
|
|
214
|
+
font-family: 'Noto Sans Mono CJK SC';
|
|
215
|
+
src: url('/fonts/NotoSansMonoCJKsc-Bold-Subset.woff2') format('woff2');
|
|
216
|
+
font-weight: 700;
|
|
217
|
+
font-style: normal;
|
|
218
|
+
font-display: swap;
|
|
219
|
+
unicode-range: U+3000-303F, U+4E00-9FFF, U+FF00-FFEF;
|
|
220
|
+
}
|
|
221
|
+
</style>
|
|
222
|
+
<script type="module" crossorigin src="/assets/index-XktPMm51.js"></script>
|
|
223
|
+
<link rel="modulepreload" crossorigin href="/assets/react-XDCjal2T.js">
|
|
224
|
+
<link rel="modulepreload" crossorigin href="/assets/dnd-BCFAPC0L.js">
|
|
225
|
+
<link rel="modulepreload" crossorigin href="/assets/terminal-C7X98Amf.js">
|
|
226
|
+
<link rel="stylesheet" crossorigin href="/assets/index-Cv7q4nZR.css">
|
|
227
|
+
<link rel="manifest" href="/manifest.webmanifest"><script id="vite-plugin-pwa:register-sw" src="/registerSW.js"></script></head>
|
|
228
|
+
<body>
|
|
229
|
+
<div id="root">
|
|
230
|
+
<div class="termdock-boot">
|
|
231
|
+
<div class="termdock-boot-spinner" aria-hidden="true"></div>
|
|
232
|
+
<span>Loading Termdock</span>
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
235
|
+
<script>
|
|
236
|
+
function showTermdockBootError(event) {
|
|
237
|
+
var root = document.getElementById('root');
|
|
238
|
+
if (!root || root.children.length !== 1 || !root.querySelector('.termdock-boot')) return;
|
|
239
|
+
var message = event && event.message ? event.message : 'Termdock failed to start.';
|
|
240
|
+
if (!event.message && event.reason) {
|
|
241
|
+
message = event.reason && event.reason.message ? event.reason.message : String(event.reason);
|
|
242
|
+
}
|
|
243
|
+
root.textContent = '';
|
|
244
|
+
var errorBox = document.createElement('div');
|
|
245
|
+
errorBox.className = 'termdock-boot termdock-boot-error';
|
|
246
|
+
var text = document.createElement('span');
|
|
247
|
+
text.textContent = message;
|
|
248
|
+
errorBox.appendChild(text);
|
|
249
|
+
root.appendChild(errorBox);
|
|
250
|
+
}
|
|
251
|
+
window.addEventListener('error', showTermdockBootError, true);
|
|
252
|
+
window.addEventListener('unhandledrejection', showTermdockBootError);
|
|
253
|
+
</script>
|
|
254
|
+
</body>
|
|
255
|
+
</html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"Termdock","short_name":"Termdock","description":"A complete web-based terminal application","start_url":"/","display":"standalone","background_color":"#1C1B1A","theme_color":"#1C1B1A","lang":"en","scope":"/","icons":[{"src":"/pwa-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/pwa-512x512.png","sizes":"512x512","type":"image/png","purpose":"any"},{"src":"/maskable-icon-512x512.png","sizes":"512x512","type":"image/png","purpose":"maskable"}]}
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 192 192" width="192" height="192">
|
|
2
|
+
<rect width="192" height="192" fill="#1C1B1A"/>
|
|
3
|
+
<text x="96" y="110" font-family="monospace" font-size="48" fill="#66800B" text-anchor="middle">>_</text>
|
|
4
|
+
<text x="96" y="140" font-family="monospace" font-size="14" fill="#CECDC3" text-anchor="middle">Termdock</text>
|
|
5
|
+
</svg>
|
|
Binary file
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="512" height="512">
|
|
2
|
+
<rect width="512" height="512" fill="#1C1B1A"/>
|
|
3
|
+
<text x="256" y="280" font-family="monospace" font-size="120" fill="#66800B" text-anchor="middle">>_</text>
|
|
4
|
+
<text x="256" y="340" font-family="monospace" font-size="36" fill="#CECDC3" text-anchor="middle">Termdock</text>
|
|
5
|
+
</svg>
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
if('serviceWorker' in navigator) {window.addEventListener('load', () => {navigator.serviceWorker.register('/sw.js', { scope: '/' })})}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Termdock shell integration for bash.
|
|
2
|
+
# Based on Ghostty's bash integration (GPL-3.0), adapted for termdock.
|
|
3
|
+
#
|
|
4
|
+
# Emits:
|
|
5
|
+
# OSC 133;P — prompt start (in PS1)
|
|
6
|
+
# OSC 133;B — input start (in PS1)
|
|
7
|
+
# OSC 133;C — command start (preexec via PS0)
|
|
8
|
+
# OSC 133;D;exitcode — command end (precmd)
|
|
9
|
+
# OSC 2;title — window title (cwd when idle, command when running)
|
|
10
|
+
# OSC 7;cwd — current working directory
|
|
11
|
+
|
|
12
|
+
if [[ "$-" != *i* ]]; then builtin return; fi
|
|
13
|
+
|
|
14
|
+
_termdock_executing=""
|
|
15
|
+
_termdock_last_reported_cwd=""
|
|
16
|
+
|
|
17
|
+
function __termdock_precmd() {
|
|
18
|
+
local ret="$?"
|
|
19
|
+
if test "$_termdock_executing" != "0"; then
|
|
20
|
+
_TERMDOCK_SAVE_PS1="$PS1"
|
|
21
|
+
_TERMDOCK_SAVE_PS2="$PS2"
|
|
22
|
+
|
|
23
|
+
PS1='\[\e]133;P;k=i\a\]'$PS1'\[\e]133;B\a\]'
|
|
24
|
+
PS2='\[\e]133;P;k=s\a\]'$PS2'\[\e]133;B\a\]'
|
|
25
|
+
|
|
26
|
+
if [[ "$PS1" == *"\n"* ]]; then
|
|
27
|
+
PS1="${PS1//\\n/\\n$'\\[\\e]133;P;k=s\\a\\]'}"
|
|
28
|
+
fi
|
|
29
|
+
|
|
30
|
+
# Title: cwd when idle
|
|
31
|
+
PS1=$PS1'\[\e]2;\w\a\]'
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
if test "$_termdock_executing" != ""; then
|
|
35
|
+
builtin printf "\e]133;D;%s;aid=%s\a" "$ret" "$BASHPID"
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
builtin printf "\e]133;A;redraw=last;cl=line;aid=%s\a" "$BASHPID"
|
|
39
|
+
|
|
40
|
+
if [[ "$_termdock_last_reported_cwd" != "$PWD" ]]; then
|
|
41
|
+
_termdock_last_reported_cwd="$PWD"
|
|
42
|
+
builtin printf "\e]7;kitty-shell-cwd://%s%s\a" "$HOSTNAME" "$PWD"
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
_termdock_executing=0
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function __termdock_preexec() {
|
|
49
|
+
builtin local cmd="$1"
|
|
50
|
+
|
|
51
|
+
PS1="$_TERMDOCK_SAVE_PS1"
|
|
52
|
+
PS2="$_TERMDOCK_SAVE_PS2"
|
|
53
|
+
|
|
54
|
+
# Title: command name when running
|
|
55
|
+
if [[ -n $cmd ]]; then
|
|
56
|
+
builtin printf "\e]2;%s\a" "${cmd//[[:cntrl:]]/}"
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
# End of input, start of output
|
|
60
|
+
builtin printf "\e]133;C\a"
|
|
61
|
+
_termdock_executing=1
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (( BASH_VERSINFO[0] > 4 || (BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] >= 4) )); then
|
|
65
|
+
__termdock_preexec_hook() {
|
|
66
|
+
builtin local cmd
|
|
67
|
+
cmd=$(LC_ALL=C HISTTIMEFORMAT='' builtin history 1)
|
|
68
|
+
cmd="${cmd#*[[:digit:]][* ] }"
|
|
69
|
+
[[ -n "$cmd" ]] && __termdock_preexec "$cmd"
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
__termdock_hook() {
|
|
73
|
+
builtin local ret=$?
|
|
74
|
+
__termdock_precmd "$ret"
|
|
75
|
+
|
|
76
|
+
if [[ "$PS0" != *"__termdock_preexec_hook"* ]]; then
|
|
77
|
+
if (( BASH_VERSINFO[0] > 5 || (BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >= 3) )); then
|
|
78
|
+
PS0+='${ __termdock_preexec_hook; }'
|
|
79
|
+
else
|
|
80
|
+
PS0+='$(__termdock_preexec_hook >/dev/tty)'
|
|
81
|
+
fi
|
|
82
|
+
fi
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
# shellcheck disable=SC2128,SC2178,SC2179
|
|
86
|
+
if [[ ";${PROMPT_COMMAND[*]:-};" != *";__termdock_hook 2>/dev/null;"* ]]; then
|
|
87
|
+
if [[ -z "${PROMPT_COMMAND[*]}" ]]; then
|
|
88
|
+
if (( BASH_VERSINFO[0] > 5 || (BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >= 1) )); then
|
|
89
|
+
PROMPT_COMMAND=("__termdock_hook 2>/dev/null")
|
|
90
|
+
else
|
|
91
|
+
PROMPT_COMMAND="__termdock_hook 2>/dev/null"
|
|
92
|
+
fi
|
|
93
|
+
elif [[ $(builtin declare -p PROMPT_COMMAND 2>/dev/null) == "declare -a "* ]]; then
|
|
94
|
+
PROMPT_COMMAND+=("__termdock_hook 2>/dev/null")
|
|
95
|
+
else
|
|
96
|
+
[[ "${PROMPT_COMMAND}" =~ (\;[[:space:]]*|$'\n')$ ]] || PROMPT_COMMAND+=";"
|
|
97
|
+
PROMPT_COMMAND+="__termdock_hook 2>/dev/null"
|
|
98
|
+
fi
|
|
99
|
+
fi
|
|
100
|
+
else
|
|
101
|
+
# Bash < 4.4: use bash-preexec.sh if available
|
|
102
|
+
if [[ -f "$(dirname -- "${BASH_SOURCE[0]}")/bash-preexec.sh" ]]; then
|
|
103
|
+
builtin source "$(dirname -- "${BASH_SOURCE[0]}")/bash-preexec.sh"
|
|
104
|
+
preexec_functions+=(__termdock_preexec)
|
|
105
|
+
precmd_functions+=(__termdock_precmd)
|
|
106
|
+
fi
|
|
107
|
+
fi
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Termdock shell integration for fish.
|
|
2
|
+
# Based on Ghostty's fish integration (GPL-3.0), adapted for termdock.
|
|
3
|
+
#
|
|
4
|
+
# Emits:
|
|
5
|
+
# OSC 133;A — prompt start
|
|
6
|
+
# OSC 133;C — command start (preexec)
|
|
7
|
+
# OSC 133;D;exitcode — command end (postexec)
|
|
8
|
+
# OSC 2;title — window title (cwd when idle, command when running)
|
|
9
|
+
# OSC 7;cwd — current working directory
|
|
10
|
+
|
|
11
|
+
function _termdock_exit -d "exit the shell integration setup"
|
|
12
|
+
functions -e _termdock_exit
|
|
13
|
+
exit 0
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
status --is-interactive || _termdock_exit
|
|
17
|
+
|
|
18
|
+
function __termdock_setup --on-event fish_prompt -d "Setup termdock integration"
|
|
19
|
+
functions -e __termdock_setup
|
|
20
|
+
|
|
21
|
+
set -g __termdock_prompt_start_mark "\e]133;A\a"
|
|
22
|
+
|
|
23
|
+
# Prompt marks
|
|
24
|
+
function __termdock_mark_prompt_start --on-event fish_prompt --on-event fish_posterror
|
|
25
|
+
if test "$__termdock_prompt_state" != prompt-start
|
|
26
|
+
echo -en "\e]133;D\a"
|
|
27
|
+
end
|
|
28
|
+
set --global __termdock_prompt_state prompt-start
|
|
29
|
+
echo -en $__termdock_prompt_start_mark
|
|
30
|
+
|
|
31
|
+
# Title: cwd when idle
|
|
32
|
+
printf '\e]2;%s\a' (string replace -r "^$HOME" "~" -- "$PWD" 2>/dev/null; or echo "$PWD")
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
function __termdock_mark_output_start --on-event fish_preexec
|
|
36
|
+
set --global __termdock_prompt_state pre-exec
|
|
37
|
+
# Title: command name when running
|
|
38
|
+
printf '\e]2;%s\a' (string replace -r '[[:cntrl:]]' '' -- "$argv" 2>/dev/null; or echo "$argv")
|
|
39
|
+
echo -en "\e]133;C\a"
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
function __termdock_mark_output_end --on-event fish_postexec
|
|
43
|
+
set --global __termdock_prompt_state post-exec
|
|
44
|
+
echo -en "\e]133;D;$status\a"
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Report cwd
|
|
48
|
+
function __update_cwd_osc --on-variable PWD -d 'Notify terminal when PWD changes'
|
|
49
|
+
if status --is-command-substitution || set -q INSIDE_EMACS
|
|
50
|
+
return
|
|
51
|
+
end
|
|
52
|
+
printf \e\]7\;kitty-shell-cwd://%s%s\a $hostname (string escape --style=url $PWD)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Initial calls for first prompt
|
|
56
|
+
__termdock_mark_prompt_start
|
|
57
|
+
__update_cwd_osc
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
_termdock_exit
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# Termdock shell integration for zsh.
|
|
2
|
+
# Based on Ghostty's zsh integration (GPL-3.0), adapted for termdock.
|
|
3
|
+
#
|
|
4
|
+
# Emits:
|
|
5
|
+
# OSC 133;A — prompt start (precmd)
|
|
6
|
+
# OSC 133;C — command start (preexec)
|
|
7
|
+
# OSC 133;D;exitcode — command end (precmd)
|
|
8
|
+
# OSC 2;title — window title (cwd when idle, command when running)
|
|
9
|
+
# OSC 7;cwd — current working directory
|
|
10
|
+
|
|
11
|
+
_entrypoint() {
|
|
12
|
+
builtin emulate -L zsh -o no_warn_create_global -o no_aliases
|
|
13
|
+
|
|
14
|
+
[[ -o interactive ]] || builtin return 0
|
|
15
|
+
(( ! $+_termdock_state )) || builtin return 0
|
|
16
|
+
|
|
17
|
+
builtin typeset -gi _termdock_state
|
|
18
|
+
# 0: no OSC 133 [AC] marks yet. 1: last C not closed with D. 2: other.
|
|
19
|
+
|
|
20
|
+
# Open a private fd to the TTY so OSC sequences reach the terminal
|
|
21
|
+
# even when stdout is redirected.
|
|
22
|
+
typeset -gi _termdock_fd
|
|
23
|
+
{
|
|
24
|
+
builtin zmodload zsh/system && (( $+builtins[sysopen] )) && {
|
|
25
|
+
{ [[ -w $TTY ]] && builtin sysopen -o cloexec -wu _termdock_fd -- $TTY } ||
|
|
26
|
+
{ [[ -w /dev/tty ]] && builtin sysopen -o cloexec -wu _termdock_fd -- /dev/tty }
|
|
27
|
+
}
|
|
28
|
+
} 2>/dev/null || (( _termdock_fd = 1 ))
|
|
29
|
+
|
|
30
|
+
builtin typeset -ag precmd_functions
|
|
31
|
+
precmd_functions+=(_termdock_deferred_init)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
_termdock_deferred_init() {
|
|
35
|
+
builtin emulate -L zsh -o no_warn_create_global -o no_aliases
|
|
36
|
+
|
|
37
|
+
_termdock_precmd() {
|
|
38
|
+
builtin local -i cmd_status=$?
|
|
39
|
+
builtin emulate -L zsh -o no_warn_create_global -o no_aliases
|
|
40
|
+
|
|
41
|
+
if ! builtin zle; then
|
|
42
|
+
if (( _termdock_state == 1 )); then
|
|
43
|
+
builtin print -nu $_termdock_fd '\e]133;D;'$cmd_status'\a'
|
|
44
|
+
(( _termdock_state = 2 ))
|
|
45
|
+
elif (( _termdock_state == 2 )); then
|
|
46
|
+
builtin print -nu $_termdock_fd '\e]133;D\a'
|
|
47
|
+
fi
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
builtin local mark1=$'%{\e]133;A;cl=line\a%}'
|
|
51
|
+
if [[ -o prompt_percent ]]; then
|
|
52
|
+
builtin typeset -g precmd_functions
|
|
53
|
+
if [[ ${precmd_functions[-1]} == _termdock_precmd ]]; then
|
|
54
|
+
builtin local ps1_changed=0
|
|
55
|
+
if [[ -n ${_termdock_saved_ps1+x} ]]; then
|
|
56
|
+
if [[ $PS1 == $_termdock_marked_ps1 ]]; then
|
|
57
|
+
PS1=$_termdock_saved_ps1
|
|
58
|
+
PS2=$_termdock_saved_ps2
|
|
59
|
+
elif [[ $PS1 != $_termdock_saved_ps1 ]]; then
|
|
60
|
+
ps1_changed=1
|
|
61
|
+
fi
|
|
62
|
+
fi
|
|
63
|
+
|
|
64
|
+
_termdock_saved_ps1=$PS1
|
|
65
|
+
_termdock_saved_ps2=$PS2
|
|
66
|
+
|
|
67
|
+
builtin local mark2=$'%{\e]133;P;k=s\a%}'
|
|
68
|
+
builtin local markB=$'%{\e]133;B\a%}'
|
|
69
|
+
[[ $PS1 == *[^%]% || $PS1 == % ]] && PS1=$PS1%
|
|
70
|
+
PS1=${mark1}${PS1}${markB}
|
|
71
|
+
|
|
72
|
+
if (( ! ps1_changed )) && [[ $PS1 == *$'\n'* ]]; then
|
|
73
|
+
PS1=${PS1//$'\n'/$'\n'${mark2}}
|
|
74
|
+
fi
|
|
75
|
+
|
|
76
|
+
[[ $PS2 == *[^%]% || $PS2 == % ]] && PS2=$PS2%
|
|
77
|
+
PS2=${mark2}${PS2}${markB}
|
|
78
|
+
|
|
79
|
+
_termdock_marked_ps1=$PS1
|
|
80
|
+
(( _termdock_state = 2 ))
|
|
81
|
+
else
|
|
82
|
+
precmd_functions=(${precmd_functions:#_termdock_precmd} _termdock_precmd)
|
|
83
|
+
if ! builtin zle; then
|
|
84
|
+
builtin print -rnu $_termdock_fd -- $mark1[3,-3]
|
|
85
|
+
(( _termdock_state = 2 ))
|
|
86
|
+
fi
|
|
87
|
+
fi
|
|
88
|
+
elif ! builtin zle; then
|
|
89
|
+
builtin print -rnu $_termdock_fd -- $mark1[3,-3]
|
|
90
|
+
(( _termdock_state = 2 ))
|
|
91
|
+
fi
|
|
92
|
+
|
|
93
|
+
# Title: cwd when idle
|
|
94
|
+
builtin print -rnu $_termdock_fd $'\e]2;'"${(%):-%(4~|…/%3~|%~)}"$'\a'
|
|
95
|
+
|
|
96
|
+
# Report cwd
|
|
97
|
+
builtin print -nu $_termdock_fd '\e]7;kitty-shell-cwd://'"$HOST""$PWD"'\a'
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
_termdock_preexec() {
|
|
101
|
+
builtin emulate -L zsh -o no_warn_create_global -o no_aliases
|
|
102
|
+
|
|
103
|
+
if [[ -n ${_termdock_saved_ps1+x} && $PS1 == $_termdock_marked_ps1 ]]; then
|
|
104
|
+
PS1=$_termdock_saved_ps1
|
|
105
|
+
PS2=$_termdock_saved_ps2
|
|
106
|
+
fi
|
|
107
|
+
|
|
108
|
+
# Title: command name when running
|
|
109
|
+
builtin print -rnu $_termdock_fd $'\e]2;'"${1//[[:cntrl:]]}"$'\a'
|
|
110
|
+
|
|
111
|
+
# End of input, start of output
|
|
112
|
+
builtin print -nu $_termdock_fd '\e]133;C\a'
|
|
113
|
+
(( _termdock_state = 1 ))
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
# Emit prompt marks at line-init if PS1 doesn't contain our marks
|
|
117
|
+
(( $+functions[_termdock_zle_line_init] )) || _termdock_zle_line_init() { builtin true; }
|
|
118
|
+
functions[_termdock_zle_line_init]="
|
|
119
|
+
if [[ \$PS1 != *$'%{\\e]133;A'* ]]; then
|
|
120
|
+
builtin print -nu \$_termdock_fd '\\e]133;P;k=i\\a\\e]133;B\\a'
|
|
121
|
+
fi
|
|
122
|
+
"${functions[_termdock_zle_line_init]}
|
|
123
|
+
|
|
124
|
+
builtin local hook func widget orig_widget flag
|
|
125
|
+
for hook in line-init line-finish keymap-select; do
|
|
126
|
+
func=_termdock_zle_${hook/-/_}
|
|
127
|
+
(( $+functions[$func] )) || builtin continue
|
|
128
|
+
widget=zle-$hook
|
|
129
|
+
if [[ $widgets[$widget] == user:azhw:* &&
|
|
130
|
+
$+functions[add-zle-hook-widget] -eq 1 ]]; then
|
|
131
|
+
add-zle-hook-widget $hook $func
|
|
132
|
+
else
|
|
133
|
+
if (( $+widgets[$widget] )); then
|
|
134
|
+
orig_widget=._termdock_orig_$widget
|
|
135
|
+
builtin zle -A $widget $orig_widget
|
|
136
|
+
if [[ $widgets[$widget] == user:* ]]; then
|
|
137
|
+
flag=
|
|
138
|
+
else
|
|
139
|
+
flag=w
|
|
140
|
+
fi
|
|
141
|
+
functions[$func]+="
|
|
142
|
+
builtin zle $orig_widget -N$flag -- \"\$@\""
|
|
143
|
+
fi
|
|
144
|
+
builtin zle -N $widget $func
|
|
145
|
+
fi
|
|
146
|
+
done
|
|
147
|
+
|
|
148
|
+
if (( $+functions[_termdock_preexec] )); then
|
|
149
|
+
builtin typeset -ag preexec_functions
|
|
150
|
+
preexec_functions+=(_termdock_preexec)
|
|
151
|
+
fi
|
|
152
|
+
|
|
153
|
+
builtin typeset -ag precmd_functions
|
|
154
|
+
if (( $+functions[_termdock_precmd] )); then
|
|
155
|
+
precmd_functions=(${precmd_functions:#_termdock_deferred_init} _termdock_precmd)
|
|
156
|
+
_termdock_precmd
|
|
157
|
+
else
|
|
158
|
+
precmd_functions=(${precmd_functions:#_termdock_deferred_init})
|
|
159
|
+
fi
|
|
160
|
+
|
|
161
|
+
builtin unfunction _termdock_deferred_init
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
_entrypoint
|