Repository: ipython/ipython

Issue:
run -d message unclear
Prior to 1.0.dev, (0.12.1), I had to hit 'c' to start the script:

```
IPython 0.12.1 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: run -d foo.py
ERROR: File `u'foo.py'` not found.
In [2]: pwd
Out[2]: u'/Users/mhearne/src/python/scipy2013/ipython/ipython-in-depth/notebooks/figs'

In [3]: cd /Users/mhearne/src/python
/Users/mhearne/src/python

In [4]: run -d foo.
foo.py   foo.pyc  

In [4]: run -d foo.py
*** Blank or comment
*** Blank or comment
Breakpoint 1 at /Users/mhearne/src/python/foo.py:3
NOTE: Enter 'c' at the ipdb>  prompt to start your script.
> <string>(1)<module>()

ipdb> c
> /Users/mhearne/src/python/foo.py(3)<module>()
      2 
1---> 3 x = 1
      4 print 'hello world'
```

With 1.0.dev, it behaves like this ('c' not required):

```
In [1]: !cat foo.py
#!/usr/bin/env python

x = 1
print 'hello world'


In [2]: run -d foo
foo.py     foo/       foolog.py  

In [2]: run -d foo.p
foo.py   foo.pyc  

In [2]: run -d foo.py
*** Blank or comment
*** Blank or comment
*** Blank or comment
NOTE: Enter 'c' at the ipdb>  prompt to start your script.
> /Users/mhearne/src/python/foo.py(3)<module>()
      2 
----> 3 x = 1
      4 print 'hello world'
```

If this is the intended behavior, I suggest removing the misleading message.

Looks like @tkf implemented this change, @ivanov said to mention him.



Discussion:
I'm confused here - In IPython 1.0, I have to press 'c' in an `ipdb >` prompt before the script executes, just like the message says.  What's different?

My platform info:
Mac OS 10.7.5
Python 2.7.3 (Enthought Canopy 1.0.3)
IPython 1.0.dev

I do NOT have to press 'c' to start the script, as I did before, or, apparently, as you still do. @ivanov witnessed the behavior on my Mac at SciPy.

@ivanov looked through the changelog, and said he found a change in that section of the code that looked like it was implemented by @tkf.

Interesting.  What do you get with

``` python
from IPython.core.debugger import OldPdb
print OldPdb
```

?

In [1]: from IPython.core.debugger import OldPdb

In [2]: print OldPdb
pdb.Pdb

Just to confirm, if you don't press `c`, you still see the output `hello world`?  I don't see that in what you pasted.

If I run a script with run -d, I used to be required to hit 'c' to _start_ debugging the script.  Now I'm debugging the script without hitting 'c', and if I do hit 'c', it runs the program to completion.  This behavior is actually ok with me, since I never understood why I had to hit another key after "run -d".  However, although the prompt at the top tells me that hitting 'c' will _start_ my script, it actually _finishes_ it.

IPython session pasted below:

In [1]: more hello.py
#!/usr/bin/env python

print 'hello world.'

In [2]: run -d hello.py
**\* Blank or comment
**\* Blank or comment
**\* Blank or comment
NOTE: Enter 'c' at the ipdb>  prompt to start your script.

> /Users/mhearne/src/python/hello.py(3)<module>()
>       1 #!/usr/bin/env python
>       2 
> ----> 3 print 'hello world.'

ipdb> c
hello world.

Not really, it just starts it - no statements have been run until you hit 'c'. The only difference seems to be that 1.0 skips over no-op lines, while 0.12 requires one extra 'c' to get started (thus two before a single line of code is executed).

It is also not generally true that it "finishes" the script, because it will stop to debug at any breakpoints or exceptions.  It only runs to completion in this case because there is no bug to "de-".

Would changing "start your script" to "proceed with execution" be satisfactory?

Sure - if the documentation matches the implementation, then I'm almost always happy.  Plus, as I said, I actually prefer the current behavior - I just need to keep my fingers from reflexively hitting 'c' all the time :)


Resolving patch:
diff --git a/IPython/core/magics/execution.py b/IPython/core/magics/execution.py
--- a/IPython/core/magics/execution.py
+++ b/IPython/core/magics/execution.py
@@ -683,8 +683,7 @@ def _run_with_debugger(self, code, code_ns, break_point, filename):
         deb.mainpyfile = deb.canonic(filename)
 
         # Start file run
-        print "NOTE: Enter 'c' at the",
-        print "%s prompt to start your script." % deb.prompt
+        print "NOTE: Enter 'c' at the %s prompt to continue execution." % deb.prompt
         try:
             #save filename so it can be used by methods on the deb object
             deb._exec_filename = filename


Test patch: