Repository navigation
Description
Describe the bug
While I am scrolled up reading earlier messages, or the reasoning shown with Ctrl+T, the timeline jumps forward as the agent produces output. In any terminal (Linux or Windows), I lose my reading position and have to find it again. I did not select any text, and the jump does not seem to depend on the model.
A headless mock-provider reproduction below records the same forward movement in GitHub Copilot CLI 1.0.109 and 1.0.114. The run records show sampled screen states.
Affected version
GitHub Copilot CLI 1.0.114.
Also reproduced in 1.0.109.
Steps to reproduce the behavior
The three cited runs used these conditions:
- Windows 11 Enterprise, build 26100, x64.
- A 120-column by 40-row headless terminal using
@lydell/node-ptyand@xterm/headless. - A configured 200 ms sleep between screen samples.
- Two runs of 1.0.114 and one run of 1.0.109.
- A fresh
COPILOT_HOMEwith the working folder trusted. COPILOT_PROVIDER_API_KEY=mock,COPILOT_MODEL=gpt-4.1, andCOPILOT_AUTO_UPDATE=false.
- Save the mock below as
scroll-mock.js, and leavenode scroll-mock.js 8765running in one terminal. - In a second terminal, keep the size at 120 columns by 40 rows. Set
COPILOT_HOMEto an empty folder. SetCOPILOT_PROVIDER_BASE_URL=http://127.0.0.1:8765/v1and the other provider variables listed above. Start the CLI withcopilot --no-auto-update --disable-builtin-mcps. Accept the folder-trust prompt if it appears. - Send
CMD:D:300:0:300:0. Continue after the reply showsD0300. - Send
CMD:E:200:6000:200:0, and press PageUp three times during the mock's 6 s delay. - When the one-chunk
Ereply arrives, the top visible row moves fromD0172toE0070. Return to the bottom, then repeat step 4 withCMD:F:200:6000:5:150, which sends 5-line chunks separated by a configured 150 ms sleep.
The harness logs and corresponding screen dumps give these sampled states. Times are elapsed seconds from each run's start.
version/run before E after E F control start F control end
1.0.114/1795054217169 23.52 D:172-204 25.69 E:70-102 45.03 E:72-104 61.15 E:72-104
1.0.109/1795054375898 24.07 D:172-204 26.89 E:70-102 45.60 E:72-104 61.66 E:72-104
1.0.114/1795056008161 25.73 D:172-204 28.99 E:70-102 47.22 E:72-104 63.35 E:72-104
During the F reply in each run, the harness configured a 200 ms sleep between screen samples. Between the F control start sample and the final dump, it recorded the same visible range, E0072 to E0104, and did not log a changed range.
scroll-mock.js
// Mock provider for the OpenAI Chat Completions streaming API. Usage: node scroll-mock.js [port]
// A prompt containing CMD:<P>:<count>:<delayMs>:<linesPerChunk>:<intervalMs> receives a reply of <count> list items.
// <P>0001, <P>0002, ..., streamed after <delayMs> in SSE chunks of <linesPerChunk> lines every <intervalMs>.
const http = require('http');
const sleep = ms => new Promise(r => setTimeout(r, ms));
const port = +(process.argv[2] || 8765);
http.createServer((req, res) => {
let body = '';
req.on('data', d => (body += d));
req.on('end', async () => {
const user = (JSON.parse(body || '{}').messages || []).filter(m => m.role === 'user').pop() || {};
const text = [].concat(user.content || '').map(p => (typeof p === 'string' ? p : p.text || '')).join('\n');
const m = /CMD:([A-Z]):(\d+):(\d+):(\d+):(\d+)/.exec(text);
const [count, delay, chunk, interval] = m ? m.slice(2).map(Number) : [1, 0, 1, 0];
const lines = m ? Array.from({ length: count }, (_, i) => `- ${m[1]}${String(i + 1).padStart(4, '0')} filler text`) : ['ok'];
const send = (choices, extra) => res.write(`data: ${JSON.stringify({ id: 'mock', object: 'chat.completion.chunk', created: 0, model: 'gpt-4.1', choices, ...extra })}\n\n`);
const delta = (d, finish = null) => send([{ index: 0, delta: d, finish_reason: finish }]);
res.writeHead(200, { 'content-type': 'text/event-stream' });
delta({ role: 'assistant', content: '' });
await sleep(delay);
const t0 = Date.now();
for (let i = 0; i < lines.length; i += chunk) {
if (i) await sleep(interval);
delta({ content: lines.slice(i, i + chunk).join('\n') + (i + chunk < lines.length ? '\n' : '') });
}
console.log(`${new Date().toISOString()} ${m ? m[0] : 'other'}: ${lines.length} lines in ${Date.now() - t0} ms`);
delta({}, 'stop');
send([], { usage: { prompt_tokens: 1, completion_tokens: 1, total_tokens: 2 } });
res.end('data: [DONE]\n\n');
});
}).listen(port, '127.0.0.1', () => console.log(`mock provider at http://127.0.0.1:${port}/v1`));Expected behavior
While scrolled up, the view should retain the same timeline content as rows arrive below it.
Additional context
Operating system: Red Hat Enterprise Linux 9.6 (Linux 5.14.0-570.19.1.el9_6.x86_64)
Related: #2372 describes a scrolled-up view jumping back to the bottom as output arrives and asks for an option to turn off auto-scroll. This report records a forward jump stopping short of the bottom in the two versions listed above.
The mock used one model identifier, gpt-4.1. The headless runs did not isolate a Ctrl+T-specific trigger.
Activity