mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-21 17:27:54 +00:00
Merge pull request #996 from wrapss/windows-newline-fix
fix: Stream parsing for Windows Zed integration
This commit is contained in:
@@ -7,7 +7,6 @@
|
|||||||
/* ACP defines a schema for a simple (experimental) JSON-RPC protocol that allows GUI applications to interact with agents. */
|
/* ACP defines a schema for a simple (experimental) JSON-RPC protocol that allows GUI applications to interact with agents. */
|
||||||
|
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
import { EOL } from 'node:os';
|
|
||||||
import * as schema from './schema.js';
|
import * as schema from './schema.js';
|
||||||
export * from './schema.js';
|
export * from './schema.js';
|
||||||
|
|
||||||
@@ -173,7 +172,7 @@ class Connection {
|
|||||||
const decoder = new TextDecoder();
|
const decoder = new TextDecoder();
|
||||||
for await (const chunk of output) {
|
for await (const chunk of output) {
|
||||||
content += decoder.decode(chunk, { stream: true });
|
content += decoder.decode(chunk, { stream: true });
|
||||||
const lines = content.split(EOL);
|
const lines = content.split('\n');
|
||||||
content = lines.pop() || '';
|
content = lines.pop() || '';
|
||||||
|
|
||||||
for (const line of lines) {
|
for (const line of lines) {
|
||||||
|
|||||||
Reference in New Issue
Block a user