Skip to content
This repository

Add magic for cls on windows. Fix for #181. #912

Closed
wants to merge 2 commits into from

3 participants

Jörgen Stenarson Min RK Thomas Kluyver
Jörgen Stenarson
Collaborator

No description provided.

Min RK
Owner

I would put it on TerminalInteractiveShell, since it's a special case for Terminals, and doesn't do anything for non-terminal frontends.

Jörgen Stenarson
Collaborator
Thomas Kluyver
Collaborator

Rebased and merged. Thanks Jörgen.

Thomas Kluyver takluyver closed this October 21, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 2 unique commits by 1 author.

Oct 20, 2011
Add magic for cls on windows. Fix for #181. fa95145
Moving magic_cls to TerminalInteractiveShell. 91dda66
This page is out of date. Refresh to see the latest.
1  IPython/core/magic.py
@@ -3611,5 +3611,4 @@ def magic_notebook(self, s):
3611 3611
             with open(new_fname, 'w') as f:
3612 3612
                 current.write(nb, f, new_format)
3613 3613
 
3614  
-
3615 3614
 # end Magic
6  IPython/frontend/terminal/interactiveshell.py
@@ -604,6 +604,12 @@ def magic_paste(self, parameter_s=''):
604 604
 
605 605
         self._execute_block(block, par)
606 606
 
  607
+    if sys.platform == 'win32':
  608
+        def magic_cls(self, s):
  609
+            """Clear screen.
  610
+            """
  611
+            os.system("cls")
  612
+
607 613
     def showindentationerror(self):
608 614
         super(TerminalInteractiveShell, self).showindentationerror()
609 615
         print("If you want to paste code into IPython, try the %paste magic function.")
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.