question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enable command history and autocompletion when using ipdb (IPython debugging)

See original GitHub issue

Description

What steps will reproduce the problem?

  1. Use the IPython console
  2. Start debugging a script using <kbd>Ctrl</kbd>+<kbd>F5</kbd> (you might have to set a breakpoint to stop the script from completing and the debugging session to end)
  3. Run any command in the IPython/ipdb console, e.g. a = 2
  4. Observe that you can’t use the <kbd>Up</kbd>/<kbd>Down</kbd> arrow keys for the command history, and that autocompletion is disabled (e.g. write the name of some class/instance, a dot, and press <kbd>Tab</kbd> or <kbd>Ctrl</kbd>+<kbd>Space</kbd>, and nothing happens)

What is the expected output? What do you see instead?

I expect command history and autocompletion to work when debugging. Preferably also multiline input (for loops, function definitions, etc.) but that might be another beast for all I know.

Note that command history and autocompletion works in the standard console (not IPython) where pdb is used. Multiline input does not work in either of the consoles.

Version and main components

  • Spyder Version: 2.3.7
  • Python Version: 2.7.10
  • Qt Versions: 4.8.6, PyQt4 (API v2) 4.10.4 on Windows

Optional dependencies

pyflakes >=0.5.0   :  0.8.1 (OK)
pep8 >=0.6         :  1.6.2 (OK)
pygments >=1.6     :  2.0.2 (OK)
IPython >=1.0      :  3.0.0 (OK)
zmq >=2.1.11       :  14.5.0 (OK)
pandas >=0.13.1    :  0.16.1 (OK)
sphinx >=0.6.6     :  1.2.3 (OK)
rope >=0.9.2       :  0.9.4 (OK)
jedi >=0.8.1;<0.9.0:  0.8.1 (OK)
matplotlib >=1.0   :  1.4.2 (OK)
sympy >=0.7.3      :  0.7.6 (OK)
pylint >=0.25      :  1.4.1 (OK)

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:5
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
Olsthoorncommented, Mar 13, 2017

Is there an alternative, not using spyder, that gives autocompletion and history commands with page up? It’s so fundamental with the literally thousands of attributes that are below the instances one has to deal with, that it severely hinders progression with debugging. Is then really nobody able to solve this longstanding issue? I hope there is. I hope we will one day reach the debugging power that Matlab has been offering its users for more than two decades. Sincerely.

0reactions
ccordoba12commented, Apr 20, 2018

Yes, it is.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugger — Spyder 5 documentation
Spyder's debugger offers syntax highlighting, code completion and command history, which work exactly like they do in the normal interactive interpreter. Use ......
Read more >
ipython ipdb, when invoked via ipdb.set_trace(), does not ...
I use pudb instead. It enables getting to a real ipython shell from the debugger and all the commands there are saved.
Read more >
25 IPython Tips for Your Next Advent of Code
IPython comes with “ipdb” — it's like the built-in Python debugger “pdb”, but with some IPython's features on top of it (syntax highlighting,...
Read more >
Release 7.20.0 The IPython Development Team
Numbered input/output prompts with command history (persistent across sessions and tied to each profile), full searching in this history and ...
Read more >
Chapter 1. IPython: Beyond Normal Python - O'Reilly
Input and Output History. Previously we saw that the IPython shell allows you to access previous commands with the up and down arrow...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found