##// END OF EJS Templates
Don't show 'try %paste' message while using magics...
mr.Shu -
Show More
@@ -150,6 +150,8 b' class TerminalMagics(Magics):'
150 150 def store_or_execute(self, block, name):
151 151 """ Execute a block, or store it in a variable, per the user's request.
152 152 """
153 self.shell.using_magics = True
154
153 155 b = self.cleanup_input(block)
154 156 if name:
155 157 # If storing it for further editing
@@ -348,6 +350,8 b' class TerminalInteractiveShell(InteractiveShell):'
348 350 help="Enable auto setting the terminal title."
349 351 )
350 352
353 using_magics = CBool(False)
354
351 355 # In the terminal, GUI control is done via PyOS_InputHook
352 356 from IPython.lib.inputhook import enable_gui
353 357 enable_gui = staticmethod(enable_gui)
@@ -721,8 +725,9 b' class TerminalInteractiveShell(InteractiveShell):'
721 725
722 726 def showindentationerror(self):
723 727 super(TerminalInteractiveShell, self).showindentationerror()
724 print("If you want to paste code into IPython, try the "
725 "%paste and %cpaste magic functions.")
728 if not self.using_magics:
729 print("If you want to paste code into IPython, try the "
730 "%paste and %cpaste magic functions.")
726 731
727 732
728 733 InteractiveShellABC.register(TerminalInteractiveShell)
General Comments 0
You need to be logged in to leave comments. Login now