The feature of send line to repl of ipython always sends lines with a suffix.
Aquaakuma opened this issue · 3 comments
Describe the bug
The command :TREPLsendline
always sends lines with a character ````^[``` in ipython.
To Reproduce
Steps to reproduce the behavior:
- Opened a neoterm with
:T ipython
- Type a command
TREPLsendline
- See line with a character
^[
Expected behavior
The ipython repl can be adapted like python repl.
Versions (Issues without this information will take longer to be answered/solved):
- OS: Windows
- neoterm commit master/latest
- Add all the configuration you have for neoterm
Plug 'kassio/neoterm' let g:neoterm_shell = 'powershell' let g:neoterm_default_mod = "belowright" let g:neoterm_size = 20 let g:neoterm_autoscroll = 1 if has("win32") let g:neoterm_eof = "\r" endif
- Vim or Neovim
- vim
- neovim
- Version [0.5.0]
Additional context
Add any other context about the problem here.
@incoggnito can you help me with this one, please?
Using these settings in my init.vim
solved it me using windows terminal with git bash's built in bash.exe
as the shell. Maybe you have \n
as the line ending somehow in nvim-qt?
Setting the eof to "\n" somehow fixed it for me.
if has("win32")
let &shell='bash.exe'
let &shellcmdflag = '-c'
let &shellredir = '>%s 2>&1'
set shellquote= shellxescape=
set noshelltemp
set shellxquote=
let &shellpipe='2>&1| tee'
endif
let $TMP="/tmp"
if has('win32')
let g:neoterm_eof= "\n"
end
Update on in case anyone stumbles upon it. I managed to get this working really well with ipython 8.0.2. No shell configuration needed if you open neovim from inside git bash in windows terminal (nvim is broken inside the default MSYS terminal that comes with git bash so have to use windows terminal).
Config is in lua but you can change it to vim script. The important thing was setting vim.g.neoterm_marker = ';#neoterm'
to the unixy one instead of the windows one. These lines attempt to set you up for using the command prompt but that won't work in the git bash terminal.
the only things I needed to set are vim.g.neoterm_repl_python
and vim.g.neoterm_marker
. I changed the &shell
stuff from my vim config. i.e. no tmp config.
if has("win32")
let &shell='bash.exe'
let &shellcmdflag = '-c'
let &shellredir = '>%s 2>&1'
set shellquote= shellxescape=
set noshelltemp
set shellxquote=
let &shellpipe='2>&1| tee'
endif
Note: this will not work in nvim-qt.exe. Opening nvim from inside Windows terminal with the git bash shell is a requirement, not an option.
local M = {}
M.setup = function()
-- no autoindent is very important
vim.g.neoterm_repl_python = { "ipython --no-autoindent" }
-- We need to set this for git bash
vim.g.neoterm_marker = ';#neoterm'
-- Do not set these for git bash in windows terminal! They are commented out!
-- vim.g.neoterm_shell = "/bin/bash"
-- vim.g.neoterm_eof = "\r\n"
end
return M