anvilsign in

collin/browser-terminal-extension

1<!doctype html>
2<html>
3 <head>
4 <meta charset="utf-8" />
5 <title>terminal</title>
6 <link rel="stylesheet" href="vendor/xterm.css" />
7 <link rel="stylesheet" href="sidebar.css" />
8 </head>
9 <body>
10 <div id="reveal-strip"></div>
11
12 <header>
13 <!-- The panel's own controls, held together at the left edge so the tab
14 strip owns the rest of the row and grows rightwards into it.
15 Reconnect appears only when it is actually actionable; theme and
16 density live in settings. Inline SVG rather than unicode glyphs,
17 which render at wildly different weights depending on which font the
18 platform falls back to. -->
19 <button id="reconnect" class="icon" title="Reconnect" hidden>
20 <svg viewBox="0 0 16 16" aria-hidden="true">
21 <path d="M13.5 8a5.5 5.5 0 1 1-1.7-4" fill="none" stroke="currentColor"
22 stroke-width="1.6" stroke-linecap="round"/>
23 <path d="M13.5 1.5v3.2h-3.2" fill="none" stroke="currentColor"
24 stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
25 </svg>
26 </button>
27
28 <button id="pick" class="icon" title="Pick an element on the page (Esc cancels)">
29 <svg viewBox="0 0 16 16" aria-hidden="true">
30 <circle cx="8" cy="8" r="3.1" fill="none" stroke="currentColor" stroke-width="1.6"/>
31 <path d="M8 .8v2.6M8 12.6v2.6M.8 8h2.6M12.6 8h2.6" stroke="currentColor"
32 stroke-width="1.6" stroke-linecap="round"/>
33 </svg>
34 </button>
35
36 <button id="settings-toggle" class="icon" title="Settings">
37 <svg viewBox="0 0 16 16" aria-hidden="true">
38 <path d="M2 4.5h12M2 8h12M2 11.5h12" stroke="currentColor"
39 stroke-width="1.6" stroke-linecap="round"/>
40 <circle cx="5.5" cy="4.5" r="1.9" fill="currentColor"/>
41 <circle cx="10.5" cy="11.5" r="1.9" fill="currentColor"/>
42 </svg>
43 </button>
44
45 <!-- The session the tabs belong to. Switching here moves the live tmux
46 client (switch-client), so the terminal below stays connected and
47 nothing is re-spawned. It also carries the session name that the
48 status text used to, since the tabs push that out of the row.
49
50 Dot and select are one chip so the session reads as a control and not
51 as another tab: the chip is a recessed pill with a full border, where
52 a tab is borderless and the selected one is *lifted* onto the
53 terminal's background. Same row, opposite direction. -->
54 <div id="session-chip">
55 <span id="status" class="dot off" title="disconnected"></span>
56 <select id="session-switch" title="tmux session" hidden></select>
57 </div>
58
59 <!-- Only while there is no session name to stand in for it. -->
60 <span id="status-text">disconnected</span>
61
62 <!-- One tab per window in the attached session, browser-style: the active
63 tab is lifted to the terminal's own background so the two read as one
64 surface, and the dot in its favicon slot is what Claude Code is doing
65 in that window. Clicking a tab runs select-window — the same thing
66 `prefix 2` does in the terminal, and it moves every client watching
67 the session, because a window belongs to the session and not to us.
68 Populated from the daemon's status frames. -->
69 <div id="tabs" role="tablist" aria-label="tmux windows" hidden></div>
70
71 <button id="tab-new" class="icon" title="New window" hidden>
72 <svg viewBox="0 0 16 16" aria-hidden="true">
73 <path d="M3.5 8h9M8 3.5v9" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/>
74 </svg>
75 </button>
76
77 </header>
78
79 <div id="picked" hidden>
80 <div class="picked-top">
81 <span id="picked-tag" class="chip"></span>
82 <span id="picked-meta"></span>
83 <button id="picked-copy" class="icon" title="Copy to clipboard">
84 <svg viewBox="0 0 16 16" aria-hidden="true">
85 <rect x="5.2" y="5.2" width="8.6" height="8.6" rx="1.8"
86 fill="none" stroke="currentColor" stroke-width="1.5"/>
87 <path d="M10.8 5.2V4a1.8 1.8 0 0 0-1.8-1.8H4A1.8 1.8 0 0 0 2.2 4v5a1.8 1.8 0 0 0 1.8 1.8h1.2"
88 fill="none" stroke="currentColor" stroke-width="1.5"/>
89 </svg>
90 </button>
91 <button id="picked-close" class="icon" title="Dismiss">
92 <svg viewBox="0 0 16 16" aria-hidden="true">
93 <path d="M4 4l8 8M12 4l-8 8" stroke="currentColor"
94 stroke-width="1.6" stroke-linecap="round"/>
95 </svg>
96 </button>
97 </div>
98
99 <div id="picked-formats" class="segmented" role="tablist"></div>
100 <div id="picked-value"></div>
101
102 <p id="picked-warn" class="hint warn" hidden></p>
103 <button id="picked-grant" hidden></button>
104 <button id="picked-insert">Insert into terminal</button>
105 </div>
106
107 <div id="term"></div>
108
109 <aside id="settings" hidden>
110 <h2>Pair this extension</h2>
111 <p class="hint">Run this once, then restart the daemon:</p>
112 <pre id="pair-cmd">loading…</pre>
113 <button id="copy-origin" class="ghost">copy</button>
114
115 <h2>Token</h2>
116 <p class="hint"><code>termbridge token</code> prints it.</p>
117 <input id="token" type="password" placeholder="64 hex chars" autocomplete="off" spellcheck="false" />
118 <label class="row"><input id="reveal" type="checkbox" /> reveal</label>
119 <p id="token-hint" class="hint warn" hidden></p>
120
121 <h2>Appearance</h2>
122 <div class="row">
123 <select id="theme-select">
124 <option value="auto">Follow system</option>
125 <option value="light">Light</option>
126 <option value="dark">Dark</option>
127 </select>
128 <select id="density-select" title="How much room the header takes">
129 <option value="normal">Normal header</option>
130 <option value="compact">Compact header</option>
131 <option value="hidden">Hide header</option>
132 </select>
133 </div>
134 <p class="hint" id="density-hint"></p>
135
136 <div class="row" id="font-row">
137 <span class="hint">Font size</span>
138 <button id="font-smaller" class="icon" title="Smaller (Ctrl+Alt+- or Ctrl+wheel)">
139 <svg viewBox="0 0 16 16" aria-hidden="true">
140 <path d="M3.5 8h9" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/>
141 </svg>
142 </button>
143 <span id="font-size">12</span>
144 <button id="font-bigger" class="icon" title="Bigger (Ctrl+Alt+= or Ctrl+wheel)">
145 <svg viewBox="0 0 16 16" aria-hidden="true">
146 <path d="M3.5 8h9M8 3.5v9" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/>
147 </svg>
148 </button>
149 <button id="font-reset" class="ghost" title="Reset (Ctrl+Alt+0)">reset</button>
150 </div>
151
152 <h2>tmux session</h2>
153 <p class="hint">Attaches if it exists, creates it otherwise.</p>
154 <div class="row">
155 <input id="session" list="session-list" placeholder="browser" spellcheck="false" />
156 <datalist id="session-list"></datalist>
157 <button id="session-apply" class="ghost">attach</button>
158 </div>
159
160 <h2>Daemon</h2>
161 <input id="url" value="ws://127.0.0.1:7681" spellcheck="false" />
162 <button id="connect">connect</button>
163
164 <div id="trust-hint" hidden>
165 <p class="hint warn">
166 Firefox upgrades <code>ws://</code> to <code>wss://</code>. The
167 daemon's certificate is self-signed, so it needs a one-time exception.
168 </p>
169 <button id="trust-cert" class="ghost">open https:// to trust the cert</button>
170 </div>
171
172 <h2>Log</h2>
173 <pre id="log"></pre>
174 </aside>
175
176 <script src="lib/theme.js"></script>
177 <script src="lib/sanitize.js"></script>
178 <script src="lib/shot.js"></script>
179 <script src="picker.js"></script>
180 <script src="vendor/xterm.js"></script>
181 <script src="vendor/addon-fit.js"></script>
182 <script src="sidebar.js"></script>
183 </body>
184</html>