@@ -107,9 +107,18 @@ pub struct ControlledProgramInstance {
107107impl ControlledProgramInstance {
108108 pub fn new ( name : & str , exe_path : & str , arguments : Vec < String > , working_dir : String ) -> Self {
109109 let mut process = Command :: new ( exe_path) ;
110- let mut process = process. stdin ( Stdio :: piped ( ) ) ;
111- process = process. stdout ( Stdio :: piped ( ) ) ;
112- process = process. current_dir ( working_dir. clone ( ) ) ;
110+ let mut process = process //this line needs to be here to prevent dropped value error
111+ . stdin ( Stdio :: piped ( ) ) //pipe stdin
112+ . stdout ( Stdio :: piped ( ) ) //pipe stdout
113+ . current_dir ( working_dir. clone ( ) ) //set the working directory, makes the app think that its being run from within working_dir
114+ // Set environment variables to simulate a full terminal
115+ . env ( "TERM" , "xterm-256color" ) // Standard terminal type with 256 colors
116+ . env ( "COLORTERM" , "truecolor" ) // Indicate 24-bit color support
117+ . env ( "COLUMNS" , "120" ) // Default terminal width
118+ . env ( "LINES" , "30" ) // Default terminal height
119+ . env ( "TERM_PROGRAM" , "RustServerController" ) // Terminal program name
120+ . env ( "FORCE_COLOR" , "1" ) ; // Force colored output in many applications
121+
113122 for arg in arguments. iter ( ) {
114123 process = process. arg ( arg. replace ( "\\ \\ " , "\\ " ) . replace ( '\"' , "" ) ) ;
115124 }
0 commit comments