Commit 2fee91e
committed
feat(Mountain): Buffer terminal output for late-listener replay
Add per-terminal output buffering to solve the same race condition that
was fixed for tree-views and SCM in 1599d76. The PTY reader task and
SkyBridge's `listen("sky://terminal/*")` installation race: in the
bundled-electron profile, the shell's first prompt fires ~50ms after
`spawn_command` while Sky's bundle still parses for ~1500ms. Without a
buffer, zsh MOTD, direnv exports, fish greetings are silently dropped
and the user sees an empty pane until they type.
The implementation adds:
- `AppendTerminalOutput()`: capture PTY bytes into a 64KB bounded buffer
(keeps most recent suffix to preserve the prompt)
- `DrainTerminalOutputBuffer()`: retrieve all buffered terminal data
- `RemoveTerminalOutputBuffer()`: clean up on terminal exit
- Extended `sky:replay-events` to emit `sky://terminal/create` for each
active terminal AND replay any buffered `sky://terminal/data` bytes
This completes the replay system for all three major feature areas:
tree-views, SCM providers, and terminals.1 parent 1f93b7e commit 2fee91e
2 files changed
Lines changed: 109 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
118 | 167 | | |
119 | 168 | | |
120 | 169 | | |
| |||
220 | 269 | | |
221 | 270 | | |
222 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
223 | 280 | | |
224 | 281 | | |
225 | 282 | | |
| |||
329 | 386 | | |
330 | 387 | | |
331 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
332 | 392 | | |
333 | 393 | | |
334 | 394 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2076 | 2076 | | |
2077 | 2077 | | |
2078 | 2078 | | |
| 2079 | + | |
| 2080 | + | |
2079 | 2081 | | |
2080 | 2082 | | |
2081 | 2083 | | |
| |||
2164 | 2166 | | |
2165 | 2167 | | |
2166 | 2168 | | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
2167 | 2210 | | |
2168 | 2211 | | |
2169 | | - | |
| 2212 | + | |
2170 | 2213 | | |
2171 | 2214 | | |
2172 | | - | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
2173 | 2218 | | |
2174 | 2219 | | |
2175 | 2220 | | |
2176 | 2221 | | |
2177 | 2222 | | |
| 2223 | + | |
| 2224 | + | |
2178 | 2225 | | |
2179 | 2226 | | |
2180 | 2227 | | |
| |||
0 commit comments