MCPcopy Create free account
hub / github.com/ipython/ipython / TerminalInteractiveShell

Class TerminalInteractiveShell

IPython/terminal/interactiveshell.py:101–639  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99
100
101class TerminalInteractiveShell(InteractiveShell):
102 mime_renderers = Dict().tag(config=True)
103
104 space_for_menu = Integer(6, help='Number of line at the bottom of the screen '
105 'to reserve for the tab completion menu, '
106 'search history, ...etc, the height of '
107 'these menus will at most this value. '
108 'Increase it is you prefer long and skinny '
109 'menus, decrease for short and wide.'
110 ).tag(config=True)
111
112 pt_app = None
113 debugger_history = None
114
115 simple_prompt = Bool(_use_simple_prompt,
116 help="""Use `raw_input` for the REPL, without completion and prompt colors.
117
118 Useful when controlling IPython as a subprocess, and piping STDIN/OUT/ERR. Known usage are:
119 IPython own testing machinery, and emacs inferior-shell integration through elpy.
120
121 This mode default to `True` if the `IPY_TEST_SIMPLE_PROMPT`
122 environment variable is set, or the current terminal is not a tty."""
123 ).tag(config=True)
124
125 @property
126 def debugger_cls(self):
127 return Pdb if self.simple_prompt else TerminalPdb
128
129 confirm_exit = Bool(True,
130 help="""
131 Set to confirm when you try to exit IPython with an EOF (Control-D
132 in Unix, Control-Z/Enter in Windows). By typing 'exit' or 'quit',
133 you can force a direct exit without any confirmation.""",
134 ).tag(config=True)
135
136 editing_mode = Unicode('emacs',
137 help="Shortcut style to use at the prompt. 'vi' or 'emacs'.",
138 ).tag(config=True)
139
140 autoformatter = Unicode(None,
141 help="Autoformatter to reformat Terminal code. Can be `'black'` or `None`",
142 allow_none=True
143 ).tag(config=True)
144
145 mouse_support = Bool(False,
146 help="Enable mouse support in the prompt\n(Note: prevents selecting text with the mouse)"
147 ).tag(config=True)
148
149 # We don't load the list of styles for the help string, because loading
150 # Pygments plugins takes time and can cause unexpected errors.
151 highlighting_style = Union([Unicode('legacy'), Type(klass=Style)],
152 help="""The name or class of a Pygments style to use for syntax
153 highlighting. To see available styles, run `pygmentize -L styles`."""
154 ).tag(config=True)
155
156 @validate('editing_mode')
157 def _validate_editing_mode(self, proposal):
158 if proposal['value'].lower() == 'vim':

Callers

nothing calls this directly

Calls 1

get_default_editorFunction · 0.85

Tested by

no test coverage detected