Path 1: 12 calls (1.0)

True (6) False (6)

True (12)

1def set_alt_screen(self, enable: bool = True) -> bool:
2        """Enables alternative screen mode.
3
4        Note, if you enable this mode, you should ensure that is disabled before
5        the application exits. See :meth:`~rich.Console.screen` for a context manager
6        that handles this for you.
7
8        Args:
9            enable (bool, optional): Enable (True) or disable (False) alternate screen. Defaults to True.
10
11        Returns:
12            bool: True if the control codes were written.
13
14        """
15        changed = False
16        if self.is_terminal and not self.legacy_windows:
17            self.control(Control.alt_screen(enable))
18            changed = True
19            self._is_alt_screen = enable
20        return changed