Package: matreplab
matREPLabThis unique python file enhances the classic matlab command window in a terminal application. you just have to launchmatreplabinstead ofmatlab -nodesktop. This can also be used for people using the-nojvmflag (see the settings section).This is very usefull when you want to code in editors different from the matlab native IDE (VS code, Sublime, Atom, emacs...) using the integrated terminals provided by those more advanced editors.Quick startfor most people:>pip3installmatreplabfor Mac OS X people, instead of pip you can use brew with the slight advantage of leaving your python site-package virgin of matreplab if it matters to you:>brewtapRobinTournemenne/matreplab>brewinstallmatreplabThen you need to make the commandmatlabexecutable by creating an alias, or adding it to your path in your ~/.bashrc or ~/.bash_profile (example for mac OS X):PATH="/Applications/MATLAB_R2018b.app/bin:$PATH"oralias matlab="/Applications/MATLAB_R2019a.app/bin/matlab"and then simply:>matreplabTroubleshootingBasically, what pip (python package management system) does is creating a shebang in the script and place it in an executable folder in your PATH.If for some reason thispip installdoesn't work, you just have to do that yourself, which is not a hustle:Clone this repository, or simply download the filematREPLabcd in the cloned folder and make this file executable using, for example:>chmod+xmatREPLabinstall the 4 dependencies manually viapip3 install package_name(Cf. Requirements)execute it!>matREPLabif it is still not working, maybe the shebang doesn't work and you will have to force the usage ofpython3:>python3matREPLabRequirementsMatlabpython 3.6+python packages (installed viapip3 install package_name):pygmentspexpect (often already installed)prompt_toolkitpathlib (often already installed)Featurescolor syntaxingAuto completion (use the file~/.matREPLab_completion_result)go to errors (line and col) in files (VS code only for the moment)history (use the file~/.matREPLab_history)multi-line handling (a little bit cleaner than matlab -nodesktop)magic functions and settingsStartupOne can tune matREPLab at launch with the following flags:-matlab_flags(change the flags called by maltab, replacing for example -nodesktop by -nojvm)-theme-disable_auto_suggest-complete_while_typing-disable_history_search-settings_filename(not possible tu use relative path or ~)-history_filename(should be useless)-completion_filename(should be useless)-log_filename(should be useless)-disable_complete_in_threads(disable responsive completer, should be useless)examples:>matreplab-matlab_flags="-nojvm -nosplash">matreplab-theme="stata-dark"-disable_auto_suggest>matreplab-settings_filename="/Users/me/Document/MATLAB/myAwesomeMatREPLabSettings.json"Some functions has been added specifically to try options directly inside the REPL (they are called magic functions):%setSettingsto change settings parameters writting directly a json array as a string. Here are the possible couples Name/Values:matlab_flags: stringtheme: stringhistory_search: true/falseauto_suggest: true/falsecomplete_while_typing: true/falsecomplete_in_threads: true/falsesettings_filename: stringhistory_filename: stringcompletion_filename: stringlog_filename: stringexample:>>%setSettings{"theme":"stata-dark","complete_while_typing":true,"auto_suggest":false}%saveSettingsto record the settings in a file (~/.matREPLab_settings by default) which will be loaded at matREPLab startup%getAvailableThemeswhich print a list of currently available themes in your pygments package.Current validated environments and other equivalent contributionsShould work on any Unix system (tested on Mac OS X Mojave and Ubuntu 18.04).Working at least for Matlab 2016 to 2019. Does not work on Matlab 2020 because they removed access to the auto-completion function. I may add a more basic solution to get completion results in this case, but it is not a priority.To my knowledge only Calysto and imatlab (stange user name) implemented a jupyter kernel to improve matlab REPL in terminals:https://github.com/imatlab/imatlabhttps://github.com/Calysto/matlab_kernelIf matREPLab works on your environment, you don't need to installMATLAB engine for Python R2016b+contrary to these two other contributions, and you don't lose the debugging capabilities (dbstop is still working).Usefull not well known Matlab functionsTo see variables in workspace:>> workspaceTo place breakspoints:>> dbstop in myFile.m at lineTo consult pretty documentation:>> doc num2strTo consult the actual Matlab history (not the one of matREPLab):>> commandhistoryLimitationsOutput is printed when expression evaluation is finished (when the user get back the control). For long commands outputing some information, you can consult the created file~/.matREPLab_live_logwhich is written in real time (and also contains the autocompletion calls).You cannot change the auto-suggest from false to true inside matREPLab.Planned Enhancementsreal-time outputs +making input possiblekeyboard interrupt, interrupts also matlab codevalidator for settings file! to avoid useless keys in jsoncheck functionning on Windows system (via VS code)common history with Matlabspecial command for history monitoringshared matlab session magic functionintegration in VS Code for breakpoints handling (and maybe more advanced stuff like debugging navigation and workspace visualization)AknowledgmentThis work has been possible thanks to the awesomepexpectproject,prompt-toolkitproject andpygmentsproject.