From 1cde4dea4adc8f28a187892c82c20c30de0761ee 2019-01-10 07:58:45 From: Kyungdahm Yun Date: 2019-01-10 07:58:45 Subject: [PATCH] Make color_depth property for reuse --- diff --git a/IPython/terminal/interactiveshell.py b/IPython/terminal/interactiveshell.py index d31cc6a..be738f8 100644 --- a/IPython/terminal/interactiveshell.py +++ b/IPython/terminal/interactiveshell.py @@ -288,7 +288,7 @@ class TerminalInteractiveShell(InteractiveShell): include_default_pygments_style=False, mouse_support=self.mouse_support, enable_open_in_editor=self.extra_open_editor_shortcuts, - color_depth=(ColorDepth.TRUE_COLOR if self.true_color else None), + color_depth=self.color_depth, **self._extra_prompt_options()) def _make_style_from_name_or_cls(self, name_or_cls): @@ -365,6 +365,10 @@ class TerminalInteractiveShell(InteractiveShell): 'readlinelike': CompleteStyle.READLINE_LIKE, }[self.display_completions] + @property + def color_depth(self): + return (ColorDepth.TRUE_COLOR if self.true_color else None) + def _extra_prompt_options(self): """ Return the current layout option for the current Terminal InteractiveShell