Skip to content


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

wants to merge 2 commits into from

3 participants

IPython member

No description provided.

IPython member

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

IPython member
IPython member

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 committed
  2. Moving magic_cls to TerminalInteractiveShell.

    J�rgen Stenarson committed
Showing with 6 additions and 1 deletion.
  1. +0 −1 IPython/core/
  2. +6 −0 IPython/frontend/terminal/
1 IPython/core/
@@ -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/
@@ -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.