When I enter an IPython repl via python-start-or-switch-repl
, I get annoying auto completion behavior where the completions popup opens with zero characters entered. If I type one character and erase it the popup opens and stays open starting with '%%!', '%%HTML', etc. If I type a function call like print('hello')
and hit enter, Autocompletion inserts '%%!' at the end of my input and I end up entering print('hello')%%!
. Auto completion works fine in all other buffers.
Here are the results from M-x describe-mode
:
Minor modes enabled in this buffer: Anzu Company Compilation-Shell Evil-Local
Evil-Surround Font-Lock Show-Smartparens Smartparens Spacemacs-Leader-Override
Term-Cursor Undo-Tree Yas
The major mode is Inferior Python mode defined in python.el:
Major mode for Python inferior process.
Runs a Python interpreter as a subprocess of Emacs, with Python
I/O through an Emacs buffer. Variables ‘python-shell-interpreter’
and ‘python-shell-interpreter-args’ control which Python
interpreter is run. Variables
‘python-shell-prompt-regexp’,
‘python-shell-prompt-output-regexp’,
‘python-shell-prompt-block-regexp’,
‘python-shell-font-lock-enable’,
‘python-shell-completion-setup-code’,
‘python-shell-completion-string-code’,
‘python-eldoc-setup-code’,
‘python-ffap-setup-code’ can
customize this mode for different Python interpreters.
This mode resets ‘comint-output-filter-functions’ locally, so you
may want to re-add custom functions to it using the
‘inferior-python-mode-hook’.
EDIT:
Here are some company-mode
details:
Company 0.9.13
company-backends: (php-extras-company company-bbdb company-semantic company-cmake company-capf company-clang company-files
(company-dabbrev-code company-gtags company-etags company-keywords)
company-oddmuse company-dabbrev)
Used backend: company-capf
Value of c-a-p-f: (lsp-completion-at-point python-completion-at-point t)
Major mode: python-mode
Prefix: ""
EDIT: @dalanicolai requested this info:
python-shell-interpreter-args is a variable defined in ‘python.el’.
Its value is "-i --simple-prompt"
Original value was "-i"
Local in buffer *Python*; global value is "-i"
python-shell-interpreter-args
?-i
flag when usingipython
(I am not sure if it would do any harm, though).