Someone said at some time that not knowing history dooms us to repeat it. Well, I wouldn’t necessarily call repetition “doom”, as there are many situations when reproducing what has been previously done is desired.
(I’m purposely misinterpreting things for the sake of the joke)
When working with an interactive shell of any interpreted language, having access to the history of last issued commands is useful for one not having to retype them over and over. On a Linux terminal, for example, you can browse through them using up and down arrow keys.
For that reason (I’m just guessing wildly), Jupyter protocol defines history_{request,reply} message types, with a lot of options for a client to get this information.
Basically, the message fields allow one to request, from the list of recorded previous commands (and their respective outputs), a continuous range of strings or the entries that match a given pattern. Regardless of how the backend gets this information, the reply must be structured in the specified format of a list of tuples.
Scilab has a HistoryManager and a HistorySearch classes that partially (AFAIK) implements those functionalities. But before jumping to hasty conclusions without further investigation, I decided to implement what seemed achievable with the current interface, and discuss later with my mentor if it should be extended to provide all the required operations.
So, at the JupyterKernel class, now we have an almost complete history handling method:
From JupyterKernel.cpp
Well, that was a rather short and quick post, but I hope that it was clear enough. I’ll probably update it after there is a resolution for what to do about the missing pieces.