terminal: Drain task output on completion (#23085)

Now we ensure that task output is fully drained and printed to Zed
terminal pane on task completion.

This change depends on a recent change to alacritty_terminal crate:
5e78d20c70.

Closes https://github.com/zed-industries/zed/issues/18342

Release Notes:

- Fixed missing task terminal output on Linux for short-running commands
This commit is contained in:
Andrew Borg (Kashin) 2025-01-17 08:00:53 +00:00 committed by GitHub
parent d4d36d1adf
commit 2ef4883937
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 24 deletions

View file

@ -187,10 +187,10 @@ impl TerminalOutput {
for byte in text.as_bytes() {
if *byte == b'\n' {
// Dirty (?) hack to move the cursor down
self.parser.advance(&mut self.handler, b'\r');
self.parser.advance(&mut self.handler, b'\n');
self.parser.advance(&mut self.handler, &[b'\r']);
self.parser.advance(&mut self.handler, &[b'\n']);
} else {
self.parser.advance(&mut self.handler, *byte);
self.parser.advance(&mut self.handler, &[*byte]);
}
}