From 8ac69ff9ef59bac551bf1a0307a386eb68cc9491 Mon Sep 17 00:00:00 2001 From: Raphael Amorim Date: Sat, 21 Dec 2024 16:06:23 -0300 Subject: [PATCH] let's try to break in parts --- frontends/rioterm/src/context/grid.rs | 56 +++++++++++++-------------- frontends/rioterm/src/context/mod.rs | 34 ++++++++-------- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/frontends/rioterm/src/context/grid.rs b/frontends/rioterm/src/context/grid.rs index 007976a8b9..b5535a0214 100644 --- a/frontends/rioterm/src/context/grid.rs +++ b/frontends/rioterm/src/context/grid.rs @@ -991,34 +991,34 @@ pub mod test { assert_eq!(context_dimension.columns, 66); assert_eq!(context_dimension.lines, 88); - let rich_text_id = 1; - let route_id = 0; - let context = create_mock_context( - VoidListener {}, - WindowId::from(0), - route_id, - rich_text_id, - context_dimension, - ); - let context_width = context.dimension.width; - let context_height = context.dimension.height; - let context_margin = context.dimension.margin; - let grid = ContextGrid::::new(context, margin, [0., 0., 0., 0.]); - // The first context should fill completely w/h grid - assert_eq!(grid.width, context_width); - assert_eq!(grid.height, context_height); - - // Context margin should empty - assert_eq!(Delta::::default(), context_margin); - assert_eq!(grid.margin, margin); - - assert_eq!( - grid.objects(), - vec![Object::RichText(RichText { - id: rich_text_id, - position: [10., 20.], - })] - ); + // let rich_text_id = 1; + // let route_id = 0; + // let context = create_mock_context( + // VoidListener {}, + // WindowId::from(0), + // route_id, + // rich_text_id, + // context_dimension, + // ); + // let context_width = context.dimension.width; + // let context_height = context.dimension.height; + // let context_margin = context.dimension.margin; + // let grid = ContextGrid::::new(context, margin, [0., 0., 0., 0.]); + // // The first context should fill completely w/h grid + // assert_eq!(grid.width, context_width); + // assert_eq!(grid.height, context_height); + + // // Context margin should empty + // assert_eq!(Delta::::default(), context_margin); + // assert_eq!(grid.margin, margin); + + // assert_eq!( + // grid.objects(), + // vec![Object::RichText(RichText { + // id: rich_text_id, + // position: [10., 20.], + // })] + // ); } // #[test] diff --git a/frontends/rioterm/src/context/mod.rs b/frontends/rioterm/src/context/mod.rs index 807b552e81..f1e54e9630 100644 --- a/frontends/rioterm/src/context/mod.rs +++ b/frontends/rioterm/src/context/mod.rs @@ -240,7 +240,7 @@ impl ContextManager { let pty; #[cfg(not(target_os = "windows"))] { - // if config.use_fork { + if config.use_fork { tracing::info!("rio -> teletypewriter: create_pty_with_fork"); pty = match create_pty_with_fork( &Cow::Borrowed(&config.shell.program), @@ -253,22 +253,22 @@ impl ContextManager { return Err(Box::new(err)); } } - // } else { - // tracing::info!("rio -> teletypewriter: create_pty_with_spawn"); - // pty = match create_pty_with_spawn( - // &Cow::Borrowed(&config.shell.program), - // config.shell.args.clone(), - // &config.working_dir, - // cols, - // rows, - // ) { - // Ok(created_pty) => created_pty, - // Err(err) => { - // tracing::error!("{err:?}"); - // return Err(Box::new(err)); - // } - // } - // }; + } else { + tracing::info!("rio -> teletypewriter: create_pty_with_spawn"); + pty = match create_pty_with_spawn( + &Cow::Borrowed(&config.shell.program), + config.shell.args.clone(), + &config.working_dir, + cols, + rows, + ) { + Ok(created_pty) => created_pty, + Err(err) => { + tracing::error!("{err:?}"); + return Err(Box::new(err)); + } + } + }; } #[cfg(not(target_os = "windows"))]