Closed austinjtravis closed 2 years ago
Added \
suggestion fix in v2022.4.1 for runFile function. Unfortunately this does not work with other sendText options (appears to work with %run
magic command only.
Also change text termination using hex code \x0A
for Enter key instead of CRLF. Hopefully this fixes it.
Remove the \
to %run
command. I've tried to increase the execution lag time to 256msec and also instruct sendText
to always include a addNewLine
together with the Enter
key press hex code.
sendText
header says:
Send text to the terminal. The text is written to the stdin of the underlying pty process (shell) of the terminal.
Anyhow, the execution problem might also be something wrong in IPython overloading the terminal pty
process and the stdin is not written correctly by VSCode. An update to the IPython build may fix it.
Found problem potentially in IPython v8.2.0 compare to v7.28.0. Prior testing suggests older version of IPython is working while newer is not. Will have to debug this more closely.
Fixed with most recent commit.
When sending a command to the ipython console the new line escape sequence is not being handled properly. This leads to the editor sending the desired command plus and additional new line to the ipython terminal. To execute the command you need to enter a new line manually in the ipython terminal.
Steps to reproduce
debug.py
debug.py
print('this has issues')
Enter
button on keyboardPotential fixes
It seems adding a new line to the end of the command is not the proper escape sequence. Might make sense to change https://github.com/hoangKnLai/vscode-ipython/blob/main/src/extension.ts#L21 to
let newLine: string = ' \';
.In the ipython terminal in vscode trying:
%run c:\<path>\debug.py \
seems to give me the desired behavior