shell-mirror 1.5.82 → 1.5.83

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.
@@ -910,6 +910,21 @@ function setupDataChannel(clientId) {
910
910
  sessionId: message.sessionId,
911
911
  sessionName: newSession.name
912
912
  }));
913
+
914
+ // Send buffered output for this session
915
+ const bufferedOutput = newSession.buffer.getAll();
916
+ if (bufferedOutput) {
917
+ logToFile(`[AGENT] 📤 Sending ${bufferedOutput.length} chars of buffered output for session switch`);
918
+ const success = sendLargeMessage(dataChannel, {
919
+ type: 'output',
920
+ data: bufferedOutput
921
+ }, '[AGENT]');
922
+ if (!success) {
923
+ logToFile('[AGENT] ❌ Failed to send buffered output');
924
+ }
925
+ } else {
926
+ logToFile('[AGENT] â„šī¸ No buffered output for switched session');
927
+ }
913
928
  } else {
914
929
  dataChannel.send(JSON.stringify({
915
930
  type: 'error',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shell-mirror",
3
- "version": "1.5.82",
3
+ "version": "1.5.83",
4
4
  "description": "Access your Mac shell from any device securely. Perfect for mobile coding with Claude Code CLI, Gemini CLI, and any shell tool.",
5
5
  "main": "server.js",
6
6
  "bin": {
@@ -109,26 +109,6 @@
109
109
  gap: 8px;
110
110
  }
111
111
 
112
- /* Connection Status Indicator */
113
- .connection-status {
114
- width: 12px;
115
- height: 12px;
116
- border-radius: 50%;
117
- background: #ff4444;
118
- margin-right: 12px;
119
- flex-shrink: 0;
120
- }
121
-
122
- .connection-status.connecting {
123
- background: #ffaa44;
124
- animation: pulse 1.5s ease-in-out infinite;
125
- }
126
-
127
- .connection-status.connected {
128
- background: #44ff44;
129
- box-shadow: 0 0 6px rgba(68, 255, 68, 0.5);
130
- }
131
-
132
112
  /* Session Tab Bar */
133
113
  .session-tab-bar {
134
114
  display: flex;
@@ -284,31 +264,6 @@
284
264
  #connect-container { padding: 2em; text-align: center; }
285
265
  #agent-id-input { font-size: 1.2em; padding: 8px; width: 400px; margin-bottom: 1em; }
286
266
  #connect-btn { font-size: 1.2em; padding: 10px 20px; }
287
-
288
- /* Connection Status Indicator */
289
- .connection-status {
290
- width: 8px;
291
- height: 8px;
292
- border-radius: 50%;
293
- background: #ff4444;
294
- margin-right: 4px;
295
- transition: all 0.3s ease;
296
- }
297
-
298
- .connection-status.connected {
299
- background: #44ff44;
300
- box-shadow: 0 0 8px rgba(68, 255, 68, 0.5);
301
- }
302
-
303
- .connection-status.connecting {
304
- background: #ffaa44;
305
- animation: pulse 1.5s ease-in-out infinite alternate;
306
- }
307
-
308
- @keyframes pulse {
309
- from { opacity: 1; }
310
- to { opacity: 0.4; }
311
- }
312
267
 
313
268
  /* Help Modal - Tab Navigation */
314
269
  .help-tabs {
@@ -400,9 +355,6 @@
400
355
  </div>
401
356
  <div id="terminal-container">
402
357
  <div class="session-header" id="session-header" style="display: none;">
403
- <!-- Connection Status Indicator -->
404
- <div class="connection-status" id="connection-status"></div>
405
-
406
358
  <!-- Session Tab Bar -->
407
359
  <div class="session-tab-bar" id="session-tab-bar">
408
360
  <!-- Tabs will be rendered here by JavaScript -->
@@ -153,24 +153,7 @@ const chunkAssembler = {
153
153
 
154
154
  // Connection status management
155
155
  function updateConnectionStatus(status) {
156
- const statusElement = document.getElementById('connection-status');
157
- if (!statusElement) return;
158
-
159
- statusElement.className = 'connection-status';
160
- switch(status) {
161
- case 'connecting':
162
- statusElement.classList.add('connecting');
163
- break;
164
- case 'connected':
165
- statusElement.classList.add('connected');
166
- break;
167
- case 'disconnected':
168
- default:
169
- // Default red styling already applied
170
- break;
171
- }
172
-
173
- // Update tab status indicators
156
+ // Update tab status indicators only (removed global connection-status element)
174
157
  if (currentSession) {
175
158
  renderTabs();
176
159
  }
@@ -951,9 +934,6 @@ function renderTabs() {
951
934
  return;
952
935
  }
953
936
 
954
- // Get connection status
955
- const connectionStatus = getConnectionStatus();
956
-
957
937
  // Ensure we have sessions to display
958
938
  let sessionsToRender = [];
959
939
 
@@ -968,7 +948,6 @@ function renderTabs() {
968
948
  console.log('[CLIENT] 🎨 Rendering tabs:', {
969
949
  sessionCount: sessionsToRender.length,
970
950
  currentSession: currentSession?.id,
971
- connectionStatus,
972
951
  source: availableSessions?.length > 0 ? 'agent' : 'fallback'
973
952
  });
974
953
 
@@ -979,13 +958,14 @@ function renderTabs() {
979
958
  tabsHTML = sessionsToRender.map(session => {
980
959
  const isActive = currentSession && session.id === currentSession.id;
981
960
  const displayName = session.name || 'Terminal Session';
961
+ const status = getSessionStatus(session.id); // Per-session status
982
962
 
983
963
  return `
984
964
  <button class="session-tab ${isActive ? 'active' : ''}"
985
965
  onclick="switchToSession('${session.id}')"
986
966
  ${isActive ? 'disabled' : ''}
987
967
  title="${displayName}">
988
- <span class="session-tab-status ${connectionStatus}"></span>
968
+ <span class="session-tab-status ${status}"></span>
989
969
  <span class="session-tab-name">${displayName}</span>
990
970
  </button>
991
971
  `;
@@ -999,14 +979,19 @@ function renderTabs() {
999
979
  console.log('[CLIENT] ✅ Tabs rendered:', sessionsToRender.length, 'tabs');
1000
980
  }
1001
981
 
1002
- function getConnectionStatus() {
1003
- if (dataChannel && dataChannel.readyState === 'open') {
1004
- return 'connected';
1005
- } else if (dataChannel && dataChannel.readyState === 'connecting') {
1006
- return 'connecting';
1007
- } else {
982
+ function getSessionStatus(sessionId) {
983
+ // Current/active session shows actual connection status
984
+ if (currentSession && sessionId === currentSession.id) {
985
+ if (dataChannel && dataChannel.readyState === 'open') {
986
+ return 'connected';
987
+ } else if (dataChannel && dataChannel.readyState === 'connecting') {
988
+ return 'connecting';
989
+ }
1008
990
  return 'disconnected';
1009
991
  }
992
+
993
+ // Inactive sessions show as disconnected (not currently connected)
994
+ return 'disconnected';
1010
995
  }
1011
996
 
1012
997
  function formatLastActivity(timestamp) {