justl.el
justl.el copied to clipboard
Run interactive tool with readline history?
I've got a number of interactive recipes that use readline, e.g. rails console (a REPL for Ruby on Rails).
If I run this from M-x shell then I can use C-up to fetch the previous item from the history inside the REPL, but that doesn't work with eshell. Any chance you could add a way to run a recipe with shell instead of eshell?
In fact I can't see any advantages in using eshell over shell because my understanding is that eshell features are useful mainly at the top (shell) level, not inside a running process, but I could be missing something.
but that doesn't work with eshell.
The key binding to fetch previous item from history inside eshell is M-p. And from a quick testing it does seem to work for me.
Ah, I see what you mean: You want to fetch history from you existing shell. Yeah, I think that's not supported by eshell.
This is definetely a feature that would be nice to have, although I'm not sure if I would have enough time to implment it soon. I would be to happy to accept a PR.
Regarding implementation: I think giving a defcustom option with two options: eshell and shell with default being eshell - and then implementing the required shell integration would be acceptable.
The recent version of justl.el support specifying vterm as an alternative shell: https://github.com/psibi/justl.el/blob/a46b95425c8f55d5ebfa674f09d606a6321e51e9/justl.el#L120
Does that solve the issue ?
🙌 It does, thank you very much!!
One small nitpick: when I run an interactive recipe that way and use C-d to exit it, I land in the shell. It would be nice if instead doing that would kill the whole process. Is it possible that something like exec is missing somewhere?
when I run an interactive recipe that way and use C-d to exit it, I land in the shell.
Unfortunately neither eshell or vterm provides an exec kind of API to do it.
I've opened #65 with a fix, let me know what you think.
Nice work! I didn't realize we had similar thing for eshell. I believe this issue can be closed then ?
Thanks again!