T35: review round 2: a program's link inside a prompt keeps its target and carries the prompt's number in its id, and a prompt that starts inside a link left open opens it again with the number, so a prompt all in links still starts on its first row; controls vte runs inside an escape go on before it, so only the ESC waits and a long run of them keeps the pty reading
CI / platforms (ubuntu-24.04) (push) Successful in 1m20s
CI / platforms (windows-latest) (push) Successful in 2m28s
CI / macos (push) Successful in 11m21s

This commit is contained in:
ZacharyZhang-NY committed 2026-10-17 00:17:38 -04:00
1 parent 310c219386
commit e2bb615a19
6 files changed
+136 -33

No files matched your search

+8 -3
View File
@@ -7,7 +7,12 @@ use alacritty_terminal::{
use futures::channel::mpsc::UnboundedSender;
use polling::{Event, PollMode, Poller};
use super::{marks, mouse::MouseMode, prompts::Prompts, pty::PtyEvent};
use super::{
marks,
mouse::MouseMode,
prompts::{self, Prompts},
pty::PtyEvent,
};
/// The longest OSC body kept; longer ones are dropped whole.
pub(super) const MOST: usize = 4096;
@@ -39,8 +44,8 @@ impl<P> Tapped<P> {
impl<P: EventedReadWrite> io::Read for Tapped<P> {
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
// A rewrite adds 14 bytes at most to a sequence of 6 or more, so a quarter of the room is read.
let take = buf.len().saturating_sub(self.prompts.held() + 64) / 4;
// What a rewrite adds stays inside the buffer, with room for the held sequence's own.
let take = buf.len().saturating_sub(self.prompts.held() + 300) / prompts::GROWTH;
if take == 0 {
return Ok(0);
}