vscode-matlab-interactive-terminal
vscode-matlab-interactive-terminal copied to clipboard
When type direction key"↑","↓", "→","←", it will show "^[[A", "^[[B", "^[[D", "^[[C"
As is title show, type Backspace and Tab key are ok, direction key and Esc will show symbol like "[*". Let me clear, my platform is ubuntu, and other shell/temeriels are all normal. only in matlab-interactive-terminal problem happened.
Thank you for your feedback. I cannot reproduce it however. As I use the VS Code API for Terminal, I am afraid I have little control over this behavior. I had something in the work using pseudo-terminal, but I have been quite busy lately.
The same error also happened on my ubuntu. However, I tried to create a new normal terminal, and run
matlab -nojvm -nodesktop -nodisplay -r <MatlabScriptName>
.
When the script run over, the terminal turned to MATLAB, and there was no strange sysmbol when typing direction keys.
Maybe this method help debug, or just temporarily replace the Matlab REPL Terminal before bug fixed?
Yes, this method works on Linux system but I deliberately did not use it because it is not compatible with Windows. I believe other extensions for VS Code use this to create a REPL however.
I had the same problem on my macOS.
Matlab 2017b macOS 10.12.6 vs code 1.60.1 Matlab Interactive Terminal 0.4.0
This is the problem with Python shell. Simply add this line at the top of ml_terminal.py
can solve it
import readline
If you don't have readline
, pip install
it.
Two ml_terminal.py
s are located at ~/.vscode/extensions/apommel.matlab-interactive-terminal-0.4.0/interfaces/standard/ml_terminal.py
and /Users/ce/.vscode/extensions/apommel.matlab-interactive-terminal-0.4.0/interfaces/unicode/ml_terminal.py
This is the problem with Python shell. Simply add this line at the top of
ml_terminal.py
can solve itimport readline
If you don't
readline
,pip install
it.Two
ml_terminal.py
s are located at~/.vscode/extensions/apommel.matlab-interactive-terminal-0.4.0/interfaces/standard/ml_terminal.py
and/Users/ce/.vscode/extensions/apommel.matlab-interactive-terminal-0.4.0/interfaces/unicode/ml_terminal.py
Hi @apommel, I believe this can solve the problem on macOS and Linux, but I don't know if it's compatible with Windows. If it is, we can make a pull request on this.
From the feedback I had and my experience, this issue does not exist on Windows. @zcysxy In this case, you may implement this change in a PR and import the module only if the user is on MacOS or Linux system. You can also add a check so that if the module is not installed it still works as it does currently, and I believe we could then consider this issue as solved.
Thank you very much!
This is the problem with Python shell. Simply add this line at the top of
ml_terminal.py
can solve itimport readline
If you don't have
readline
,pip install
it.Two
ml_terminal.py
s are located at~/.vscode/extensions/apommel.matlab-interactive-terminal-0.4.0/interfaces/standard/ml_terminal.py
and/Users/ce/.vscode/extensions/apommel.matlab-interactive-terminal-0.4.0/interfaces/unicode/ml_terminal.py
Add these file that need import readline
to be appended for Linux/Macos,
~/.vscode/extensions/apommel.matlab-interactive-terminal-0.4.0/interfaces/standard/ml_terminal.py
~/.vscode/extensions/apommel.matlab-interactive-terminal-0.4.0/interfaces/unicode/ml_terminal.py
~/.vscode/extensions/apommel.matlab-interactive-terminal-0.4.0/interfaces/standard/ml_script.py
~/.vscode/extensions/apommel.matlab-interactive-terminal-0.4.0/interfaces/unicode/ml_script.py
~/.vscode/extensions/apommel.matlab-interactive-terminal-0.4.0/interfaces/standard/ml_selection.py
~/.vscode/extensions/apommel.matlab-interactive-terminal-0.4.0/interfaces/unicode/ml_selection.py
This insures that all the matlab termials that are open in vscode, will accept the arrow inputs