|
75 | 75 | background: #44ff44; |
76 | 76 | } |
77 | 77 |
|
| 78 | + .alt-screen-indicator { |
| 79 | + display: inline-block; |
| 80 | + padding: 4px 12px; |
| 81 | + margin-left: 15px; |
| 82 | + background: rgba(255, 255, 255, 0.15); |
| 83 | + border-radius: 4px; |
| 84 | + font-size: 0.85rem; |
| 85 | + font-weight: 500; |
| 86 | + opacity: 0; |
| 87 | + transition: opacity 0.3s ease; |
| 88 | + } |
| 89 | + |
| 90 | + .alt-screen-indicator.active { |
| 91 | + opacity: 1; |
| 92 | + background: rgba(255, 200, 100, 0.25); |
| 93 | + color: #ffd700; |
| 94 | + } |
| 95 | + |
78 | 96 | @keyframes pulse { |
79 | 97 | 0%, |
80 | 98 | 100% { |
@@ -269,6 +287,7 @@ <h1>🖥️ Ghostty Terminal</h1> |
269 | 287 | <div class="status-indicator"> |
270 | 288 | <div class="status-dot" id="status-dot"></div> |
271 | 289 | <span id="status-text">Connecting...</span> |
| 290 | + <span id="alt-screen-indicator" class="alt-screen-indicator">ALT SCREEN</span> |
272 | 291 | </div> |
273 | 292 | <div> |
274 | 293 | <small id="ws-url" style="opacity: 0.7; margin-right: 15px"></small> |
@@ -376,12 +395,14 @@ <h3>🔍 Buffer Access API (NEW!)</h3> |
376 | 395 | // If it's a string (raw PTY output), write directly to terminal |
377 | 396 | if (typeof data === 'string') { |
378 | 397 | term.write(data); |
| 398 | + updateAltScreenIndicator(); |
379 | 399 | } |
380 | 400 | // Otherwise try JSON parsing for file-browser-server compatibility |
381 | 401 | else { |
382 | 402 | try { |
383 | 403 | const jsonData = JSON.parse(data); |
384 | 404 | handleServerMessage(jsonData); |
| 405 | + updateAltScreenIndicator(); |
385 | 406 | } catch (error) { |
386 | 407 | console.error('Failed to parse message:', error); |
387 | 408 | } |
@@ -475,6 +496,18 @@ <h3>🔍 Buffer Access API (NEW!)</h3> |
475 | 496 | textEl.textContent = text; |
476 | 497 | } |
477 | 498 |
|
| 499 | + function updateAltScreenIndicator() { |
| 500 | + const indicator = document.getElementById('alt-screen-indicator'); |
| 501 | + if (!term || !term.wasmTerm) return; |
| 502 | + |
| 503 | + const isAltScreen = term.wasmTerm.isAlternateScreen(); |
| 504 | + if (isAltScreen) { |
| 505 | + indicator.classList.add('active'); |
| 506 | + } else { |
| 507 | + indicator.classList.remove('active'); |
| 508 | + } |
| 509 | + } |
| 510 | + |
478 | 511 | function updateCwdDisplay(cwd) { |
479 | 512 | const display = document.getElementById('cwd-display'); |
480 | 513 | // Shorten long paths |
|
0 commit comments