diff --git a/openbb_terminal/parent_classes.py b/openbb_terminal/parent_classes.py index 4ad8cb0faa9..f4f5b2da319 100644 --- a/openbb_terminal/parent_classes.py +++ b/openbb_terminal/parent_classes.py @@ -274,13 +274,14 @@ class BaseController(metaclass=ABCMeta): def log_queue(self) -> None: """Log command queue.""" - joined_queue = self.COMMAND_SEPARATOR.join(self.queue) - if self.queue and not self.contains_keys(joined_queue): - logger.info( - "QUEUE: {'path': '%s', 'queue': '%s'}", - self.PATH, - joined_queue, - ) + if self.queue: + joined_queue = self.COMMAND_SEPARATOR.join(self.queue) + if not self.contains_keys(joined_queue): + logger.info( + "QUEUE: {'path': '%s', 'queue': '%s'}", + self.PATH, + joined_queue, + ) def log_cmd_and_queue( self, known_cmd: str, other_args_str: str, the_input: str @@ -673,12 +674,7 @@ class BaseController(metaclass=ABCMeta): ns_parser = self.parse_simple_args(parser, other_args) if ns_parser: - i = console.input("Are you sure you want to logout? (y/n) ", style="info") - console.print("") - if i.lower() == "y": - self.queue.insert(0, "y") - # TODO: this command is not working properly inside menus - logout() + logout() @log_start_end(log=logger) def call_whoami(self, other_args: List[str]) -> None: @@ -942,6 +938,10 @@ class BaseController(metaclass=ABCMeta): # Process the input command self.queue = self.switch(an_input) + + if an_input == "logout": + return ["logout"] + if not self.queue or ( self.queue and self.queue[0] not in ("quit", "help") ): diff --git a/openbb_terminal/terminal_controller.py b/openbb_terminal/terminal_controller.py index b53294cfb49..c0c630232b5 100644 --- a/openbb_terminal/terminal_controller.py +++ b/openbb_terminal/terminal_controller.py @@ -916,7 +916,7 @@ def terminal(jobs_cmds: List[str] = None, test_mode=False): print_goodbye() break - if an_input == "logout" and "y" in t_controller.queue: + if an_input == "logout": break except SystemExit: