diff --git a/src/main.rs b/src/main.rs index 205950426..e8a10418f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -171,7 +171,7 @@ fn run_shell(vm: &mut VirtualMachine) -> PyResult { debug!("You entered {:?}", input); if shell_exec(vm, &input, vars.clone()) { // Line was complete. - rl.add_history_entry(input.as_ref()); + rl.add_history_entry(input.trim_right().as_ref()); input = String::new(); } else { loop { @@ -184,7 +184,7 @@ fn run_shell(vm: &mut VirtualMachine) -> PyResult { Ok(line) => { if line.len() == 0 { if shell_exec(vm, &input, vars.clone()) { - rl.add_history_entry(input.as_ref()); + rl.add_history_entry(input.trim_right().as_ref()); input = String::new(); break; }