Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python repl result ends with extra '^M' (CTRL-M) #439

Closed
Appalled opened this issue Nov 26, 2022 · 4 comments
Closed

python repl result ends with extra '^M' (CTRL-M) #439

Appalled opened this issue Nov 26, 2022 · 4 comments
Labels
bug Something isn't working client-python windows

Comments

@Appalled
Copy link

Dear conjure developers,
I run conjure on windows 10 with treesitter installed. Both fennel and python client work, while every line of python output ends with extra '^M', and there's an extra line contains 'None^M'. I guess it's a CRLF problem. Sorry for my poor English.

1669466905792
1669466992272

related config including:

Plug 'Olical/conjure'
let g:conjure#client#python#stdio#command = "python -iq"

system version

版本	Windows 10 专业版
版本号	22H2
安装日期	‎2021/‎4/‎4
操作系统内部版本	19045.2251
体验	Windows Feature Experience Pack 120.2212.4180.0

Here are outputs of :version

NVIM v0.8.0-1210-gd367ed9b2
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compiled by runneradmin@fv-az177-603

Here are outputs of :healthcheck

nvim-treesitter: require("nvim-treesitter.health").check()
 
## Installation
  - WARNING: `tree-sitter` executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall)
  - OK: `node` found v16.17.0 (only needed for :TSInstallFromGrammar)
  - OK: `git` executable found.
  - OK: `zig` executable found. Selected from { "zig" }
    Version: info: Usage: zig [command] [options]
  - OK: Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

## Parser/Features H L F I J
  - python         ✓ ✓ ✓ ✓ .
  - lua            ✓ ✓ ✓ ✓ ✓
  - rust           ✓ ✓ ✓ ✓ ✓

  Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
         +) multiple parsers found, only one will be used
         x) errors found in the query, try to run :TSUpdate {lang}

provider: health#provider#check

## Clipboard (optional)
  - OK: Clipboard tool found: win32yank

## Python 3 provider (optional)
  - INFO: Using: g:python3_host_prog = "python"
  - INFO: Executable: C:\Program Files\Python37\python.EXE
  - INFO: Python version: 3.7.5
  - INFO: pynvim version: 0.4.3
  - OK: Latest pynvim is installed.
@Olical Olical added bug Something isn't working client-python windows labels Nov 26, 2022
@Olical
Copy link
Owner

Olical commented Nov 26, 2022

Thank you for reporting this! And there is no need to apologise for your English, it's good and I understand the issue 🙂

I think this is because the Python REPL is printing \r\n whereas most REPLs on other OSs print \n (which Conjure splits lines on). So I think I need to split lines by \r\n on Windows for some REPLs.

I'll try to fix the Python client for now, to fix your problem, but maybe I'll need to fix other clients in the future.

@Olical
Copy link
Owner

Olical commented Nov 26, 2022

I've pushed a fix to the develop branch, I hope that works for you! I can't reproduce the issue on my machine since I don't have any development tools on my Windows PC. Please let me know if it helps. Thanks!

@Appalled
Copy link
Author

Thank you for reporting this! And there is no need to apologise for your English, it's good and I understand the issue 🙂

I think this is because the Python REPL is printing \r\n whereas most REPLs on other OSs print \n (which Conjure splits lines on). So I think I need to split lines by \r\n on Windows for some REPLs.

I'll try to fix the Python client for now, to fix your problem, but maybe I'll need to fix other clients in the future.

Thanks. It works, all '^M' go away. Both on windows and linux
there is a line contains "None" after I input \eb , is this in line with expectations?
1669474102740

@Olical
Copy link
Owner

Olical commented Nov 26, 2022

That's great! And yes, None is expected since I think that's what print returns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working client-python windows
Projects
None yet
Development

No branches or pull requests

2 participants