Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
wants to merge 2 commits into from

3 participants

@jstenar
Collaborator

No description provided.

@minrk
Owner

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

@jstenar
Collaborator
@takluyver
Owner

Rebased and merged. Thanks Jörgen.

@takluyver 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.
View
1  IPython/core/magic.py
@@ -3611,5 +3611,4 @@ def magic_notebook(self, s):
with open(new_fname, 'w') as f:
current.write(nb, f, new_format)
-
# end Magic
View
6 IPython/frontend/terminal/interactiveshell.py
@@ -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.