Frage

How can I access the command history when running irb in the emacs eshell?

When I run irb at the command line outside of emacs, I can use the up arrow to get the last command or ctrl-r to search the command history. In irb inside eshell, the up arrow does nothing (i.e. it runs eshell-previous-matching-input-from-input which does nothing in irb) and ctrl-r uses the emacs reverse search of the buffer instead of searching the command history. I guess irb never receives the up-arrow keystroke because it's bound to eshell-previous-matching-input-from-input, but I'm not sure how to fix it. Running (global-unset-key (kbd "<up>")) doesn't unbind the up-arrow in eshell and I'm not sure that's desirable anyway.

I know about inf-ruby, but I prefer using irb in eshell and besides up-arrow and ctrl-r don't work with that either.

It could be a problem with readline in irb, but I don't think so. conf.use_readline is nil on the commandline where irb command history works fine. Running irb --readline in eshell switches conf.use_readline to true but doesn't fix the up arrow or ctrl-r.

War es hilfreich?

Lösung

Emacs term mode (M-x term) in combination with C-c C-j / C-c C-k to temporarily allow yanking seems to be a good option. See another answer here.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top