Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/workspace/workspaceMonitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,11 @@ export class WorkspaceMonitor implements vscode.Disposable {
logs: readonly WorkspaceAgentLog[],
): vscode.Terminal {
const writeEmitter = new vscode.EventEmitter<string>();
// End every line so the cursor sits below the logs: xterm.js never
// reflows the cursor's line, which `open` writes before the final width.
const output = logs
.map((log) => log.output.replace(/\r?\n/g, "\r\n"))
.join("\r\n");
.map((log) => log.output.replace(/\r?\n/g, "\r\n") + "\r\n")
.join("");
return vscode.window.createTerminal({
name,
pty: {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/workspace/workspaceMonitor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ describe("WorkspaceMonitor", () => {

await vi.waitFor(() => {
expect(Object.fromEntries(writes)).toEqual({
"Startup Logs: Install deps": ["installing\r\nnpm ERR!"],
"Startup Logs: Install deps": ["installing\r\nnpm ERR!\r\n"],
});
});
});
Expand Down
Loading