From 550e139b61fe2f9deeb14cf598ece9db00d6fd05 Mon Sep 17 00:00:00 2001 From: Kyle Kelley Date: Sat, 10 Aug 2024 10:28:56 -0700 Subject: [PATCH] =?UTF-8?q?repl:=20Set=20the=20default=20lines=20=E2=9C=96?= =?UTF-8?q?=EF=B8=8F=20columns=20for=20the=20REPL=20to=2032x128=20(#16061)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ![image](https://github.com/user-attachments/assets/dce938ef-bdfd-4412-a074-90c883286263) Release Notes: - Improved visuals of repl stdout/stderr by reducing default line count to 32 --- crates/repl/src/stdio.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/repl/src/stdio.rs b/crates/repl/src/stdio.rs index 349ff864a5..2be0bfa2a7 100644 --- a/crates/repl/src/stdio.rs +++ b/crates/repl/src/stdio.rs @@ -19,6 +19,9 @@ pub struct TerminalOutput { handler: alacritty_terminal::Term, } +const DEFAULT_NUM_LINES: usize = 32; +const DEFAULT_NUM_COLUMNS: usize = 128; + pub fn terminal_size(cx: &mut WindowContext) -> terminal::TerminalSize { let text_style = cx.text_style(); let text_system = cx.text_system(); @@ -33,8 +36,8 @@ pub fn terminal_size(cx: &mut WindowContext) -> terminal::TerminalSize { .unwrap() .width; - let num_lines = 200; - let columns = 120; + let num_lines = DEFAULT_NUM_LINES; + let columns = DEFAULT_NUM_COLUMNS; // Reversed math from terminal::TerminalSize to get pixel width according to terminal width let width = columns as f32 * cell_width;