Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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
Owner

Rebased and merged. Thanks Jörgen.

Thomas Kluyver takluyver closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 20, 2011
  1. Add magic for cls on windows. Fix for #181.

    J�rgen Stenarson authored
  2. Moving magic_cls to TerminalInteractiveShell.

    J�rgen Stenarson authored
This page is out of date. Refresh to see the latest.
1  IPython/core/magic.py
View
@@ -3611,5 +3611,4 @@ def magic_notebook(self, s):
with open(new_fname, 'w') as f:
current.write(nb, f, new_format)
-
# end Magic
6 IPython/frontend/terminal/interactiveshell.py
View
@@ -604,6 +604,12 @@ def magic_paste(self, parameter_s=''):
self._execute_block(block, par)
+ if sys.platform == 'win32':
+ def magic_cls(self, s):
+ """Clear screen.
+ """
+ os.system("cls")
+
def showindentationerror(self):
super(TerminalInteractiveShell, self).showindentationerror()
print("If you want to paste code into IPython, try the %paste magic function.")
Something went wrong with that request. Please try again.