I have a terminal command which runs code with a breakpoint in it. When I run this command in NeoVim the code execution does not stop at the breakpoint, instead I get an error, that its not a TTY terminal. The exact same command stops at the breakpoint in Vim.
I guess I need shell
command, which was removed in NeoVim. Is there any other way to run it?
:help :terminal
shows:
:sh[ell]
Removed. vim-differences:terminal :te :te[rminal][!] [{cmd}]
Run {cmd} in a non-interactive 'shell' in a new terminal-emulator buffer. Without {cmd}, start an interactive 'shell'.Type i to enter Terminal-mode, then keys are sent to the job running in the terminal. Type
<C-\><C-N>
to leave Terminal-mode.CTRL-\_CTRL-N
Update: I have this simple hello_world.py
python3 program and I want to make it print "Hello world" (variable name
value has to be changed to "world"
in the breakpoint:
def hello_world():
name = None
breakpoint()
print(f'Hello {name}')
hello_world()
When I try to execute :!python3 hello_world.py
program in the NeoVim I get this output:
:!python3 hello_world.py
> /home/niekas/cct/individual-thematics-api/backend/tmp.py(4)hello_world()
-> print(f'Hello {name}')
(Pdb)
Traceback (most recent call last):
File "hello_world.py", line 6, in <module>
hello_world()
File "hello_world.py", line 4, in hello_world
print(f'Hello {name}')
File "hello_world.py", line 4, in hello_world
print(f'Hello {name}')
File "/usr/lib/python3.8/bdb.py", line 88, in trace_dispatch
return self.dispatch_line(frame)
File "/usr/lib/python3.8/bdb.py", line 113, in dispatch_line
if self.quitting: raise BdbQuit
bdb.BdbQuit
shell returned 1
Press ENTER or type command to continue
Update: I have tried using :!bash -ic ipython
to test if interactive mode works, but it doesn't. IPython exited automatically, see the output:
:!bash -ic ipython
bash: cannot set terminal process group (5377): Inappropriate ioctl for device
bash: no job control in this shell
^[[22;0t^[]0;IPython: individual-thematics-api/backendPython 3.8.5 (default, Jul 28 2020, 12:59:40)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.20.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: Do you really want to exit ([y]/n)?
^[[23;0t
Press ENTER or type command to continue
:terminal
in neovim for interactive commands.:terminal
, however it does not start in interactive mode if I provide a command. I don't know how to automatically provide a command for terminal, which was started without a command.:terminal python3
is still a python repl). You may have to pressi
, as you quoted in the post. Without a command, it should just launch a shell—bash, zsh, whatever windows is doing these days, etc. Then you type a shell command—such as the name of a program and its arguments. Maybe you should edit and show how you run the command in vim and neovim and what output you are getting/how its not working?:!bash -ic ipython
didn't start in interactive mode for me. See the output in the update question.