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

Persist history of flowR REPL sessions #606

Closed
EagleoutIce opened this issue Jan 19, 2024 · 3 comments · Fixed by #641
Closed

Persist history of flowR REPL sessions #606

EagleoutIce opened this issue Jan 19, 2024 · 3 comments · Fixed by #641
Assignees
Labels
cli Refers to a Command Line Interface enhancement New feature or request good first issue Good for newcomers

Comments

@EagleoutIce
Copy link
Member

If i reopen the repl in the same terminal session it would be nice to be able to reaccess the old history (e.g., when i recompile the flowR sources and want to check a command again).

@EagleoutIce EagleoutIce added enhancement New feature or request good first issue Good for newcomers cli Refers to a Command Line Interface labels Jan 19, 2024
@EagleoutIce EagleoutIce changed the title Persist History of flowR REPL sessions Persist history of flowR REPL sessions Jan 19, 2024
@EagleoutIce
Copy link
Member Author

This can be achieved, for example, with the help of an external file which persists the history.

For more information on the history, see https://nodejs.org/api/readline.html#readlinepromisescreateinterfaceoptions, the respective code is at:
https://github.com/Code-Inspect/flowr/blob/75a417d913092e10cee2c27a251f9984ca35cf3b/src/cli/repl/core.ts#L23-L30

@EagleoutIce
Copy link
Member Author

Example:

$ node dist/src/flowr.js 
R> :help
...
R> <up>
R> :help
<ctrl+c> <ctrl+c>

$ node dist/src/flowr.js 
R> <up>
R> :help
# in other words, :help is still in the history

With <up> referring to (i.e., the up arrow), and <ctrl+c> referring to ctrl+c

@Ellpeck
Copy link
Member

Ellpeck commented Feb 5, 2024

Is there already a directory for persistent flowr data? I couldn't really find one on first try. If not, should it be like a local share / local app data sort of thing, or should it be stored with the executable?

Edit: got this reply in person:

just store it in temp, we don't really care about persisting beyond a device restart

@Ellpeck Ellpeck self-assigned this Feb 5, 2024
@Ellpeck Ellpeck linked a pull request Feb 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Refers to a Command Line Interface enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants