Fix repl "plain" terminals enqueing events without ever dequeuing (#23641)
Bringing back part of #23631 which was reverted in #23636. Different but related memory leak to what's described in #23008 Release Notes: - N/A
This commit is contained in:
parent
75b507d38a
commit
5f417eda25
1 changed files with 4 additions and 10 deletions
|
@ -16,6 +16,7 @@
|
||||||
//!
|
//!
|
||||||
|
|
||||||
use alacritty_terminal::{
|
use alacritty_terminal::{
|
||||||
|
event::VoidListener,
|
||||||
grid::Dimensions as _,
|
grid::Dimensions as _,
|
||||||
index::{Column, Line, Point},
|
index::{Column, Line, Point},
|
||||||
term::Config,
|
term::Config,
|
||||||
|
@ -24,8 +25,6 @@ use alacritty_terminal::{
|
||||||
use gpui::{canvas, size, ClipboardItem, FontStyle, Model, TextStyle, WhiteSpace};
|
use gpui::{canvas, size, ClipboardItem, FontStyle, Model, TextStyle, WhiteSpace};
|
||||||
use language::Buffer;
|
use language::Buffer;
|
||||||
use settings::Settings as _;
|
use settings::Settings as _;
|
||||||
use std::mem;
|
|
||||||
use terminal::ZedListener;
|
|
||||||
use terminal_view::terminal_element::TerminalElement;
|
use terminal_view::terminal_element::TerminalElement;
|
||||||
use theme::ThemeSettings;
|
use theme::ThemeSettings;
|
||||||
use ui::{prelude::*, IntoElement};
|
use ui::{prelude::*, IntoElement};
|
||||||
|
@ -50,7 +49,7 @@ pub struct TerminalOutput {
|
||||||
/// ANSI escape sequence processor for parsing input text.
|
/// ANSI escape sequence processor for parsing input text.
|
||||||
parser: Processor,
|
parser: Processor,
|
||||||
/// Alacritty terminal instance that manages the terminal state and content.
|
/// Alacritty terminal instance that manages the terminal state and content.
|
||||||
handler: alacritty_terminal::Term<ZedListener>,
|
handler: alacritty_terminal::Term<VoidListener>,
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEFAULT_NUM_LINES: usize = 32;
|
const DEFAULT_NUM_LINES: usize = 32;
|
||||||
|
@ -124,14 +123,9 @@ impl TerminalOutput {
|
||||||
/// and sets up the necessary components for handling terminal events and rendering.
|
/// and sets up the necessary components for handling terminal events and rendering.
|
||||||
///
|
///
|
||||||
pub fn new(cx: &mut WindowContext) -> Self {
|
pub fn new(cx: &mut WindowContext) -> Self {
|
||||||
let (events_tx, events_rx) = futures::channel::mpsc::unbounded();
|
let term =
|
||||||
let term = alacritty_terminal::Term::new(
|
alacritty_terminal::Term::new(Config::default(), &terminal_size(cx), VoidListener);
|
||||||
Config::default(),
|
|
||||||
&terminal_size(cx),
|
|
||||||
terminal::ZedListener(events_tx.clone()),
|
|
||||||
);
|
|
||||||
|
|
||||||
mem::forget(events_rx);
|
|
||||||
Self {
|
Self {
|
||||||
parser: Processor::new(),
|
parser: Processor::new(),
|
||||||
handler: term,
|
handler: term,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue