patch non_interactive_mode to prevent double REPL layer